diff options
-rw-r--r-- | src/gui/kernel/qcocoaview_mac.mm | 8 | ||||
-rw-r--r-- | src/gui/painting/qbackingstore_p.h | 13 |
2 files changed, 15 insertions, 6 deletions
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index 4c2a14a..417d54c 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -51,6 +51,7 @@ #include <private/qmacinputcontext_p.h> #include <private/qmultitouch_mac_p.h> #include <private/qevent_p.h> +#include <private/qbackingstore_p.h> #include <qscrollarea.h> #include <qhash.h> @@ -503,6 +504,13 @@ extern "C" { - (void)drawRect:(NSRect)aRect { + qDebug("drawRect"); + if (QApplicationPrivate::graphicsSystem() != 0) { + if (QWidgetBackingStore *bs = qwidgetprivate->maybeBackingStore()) + bs->markDirty(qwidget->rect(), qwidget); + qwidgetprivate->syncBackingStore(qwidget->rect()); + return; + } CGContextRef cg = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; qwidgetprivate->hd = cg; CGContextSaveGState(cg); diff --git a/src/gui/painting/qbackingstore_p.h b/src/gui/painting/qbackingstore_p.h index 94d756e..63518fb 100644 --- a/src/gui/painting/qbackingstore_p.h +++ b/src/gui/painting/qbackingstore_p.h @@ -1,4 +1,4 @@ -/**************************************************************************** + /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. @@ -97,6 +97,12 @@ public: ); } + // ### Qt 4.6: Merge into a template function (after MSVC isn't supported anymore). + void markDirty(const QRegion &rgn, QWidget *widget, bool updateImmediately = false, + bool invalidateBuffer = false); + void markDirty(const QRect &rect, QWidget *widget, bool updateImmediately = false, + bool invalidateBuffer = false); + private: QWidget *tlw; QRegion dirtyOnScreen; // needsFlush @@ -126,11 +132,6 @@ private: QRegion dirtyRegion(QWidget *widget = 0) const; QRegion staticContents(QWidget *widget = 0, const QRect &withinClipRect = QRect()) const; - // ### Qt 4.6: Merge into a template function (after MSVC isn't supported anymore). - void markDirty(const QRegion &rgn, QWidget *widget, bool updateImmediately = false, - bool invalidateBuffer = false); - void markDirty(const QRect &rect, QWidget *widget, bool updateImmediately = false, - bool invalidateBuffer = false); void markDirtyOnScreen(const QRegion &dirtyOnScreen, QWidget *widget, const QPoint &topLevelOffset); void removeDirtyWidget(QWidget *w); |