summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication_s60.cpp
diff options
context:
space:
mode:
authorGareth Stockwell <ext-gareth.stockwell@nokia.com>2009-11-25 14:47:32 (GMT)
committerGareth Stockwell <ext-gareth.stockwell@nokia.com>2009-11-26 14:42:07 (GMT)
commite9704a297f788bb79b2a89e9b16214443931af5d (patch)
treeda38fb443edb091de6f133d1b534c61970305887 /src/gui/kernel/qapplication_s60.cpp
parentbff3e6d8d810dbba29978d666949f4f3bb70503f (diff)
downloadQt-e9704a297f788bb79b2a89e9b16214443931af5d.zip
Qt-e9704a297f788bb79b2a89e9b16214443931af5d.tar.gz
Qt-e9704a297f788bb79b2a89e9b16214443931af5d.tar.bz2
Symbian control invokes slots before and after native draw ops
Direct Screen Access (DSA) allows a client to request notification from the window server when drawing is performed by other threads, into a specified region of the screen. This allows DSA rendering - for example video - to be suspended when notifications are drawn, preventing the video content from overwriting the notification. If the drawing originates from the same thread as that which holds the DSA session, DSA must be suspended while drawing takes place. This change allows a widget to request notification when native drawing is about to be performed by QSymbianControl::Draw. Task-number: QTBUG-5467 Reviewed-by: Jason Barron
Diffstat (limited to 'src/gui/kernel/qapplication_s60.cpp')
-rw-r--r--src/gui/kernel/qapplication_s60.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index ae7b494..d1471eb 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -812,6 +812,12 @@ void QSymbianControl::Draw(const TRect& controlRect) const
if (!engine)
return;
+ const bool sendNativePaintEvents = qwidget->d_func()->extraData()->receiveNativePaintEvents;
+ if (sendNativePaintEvents) {
+ const QRect r = qt_TRect2QRect(controlRect);
+ QMetaObject::invokeMethod(qwidget, "beginNativePaintEvent", Qt::DirectConnection, Q_ARG(QRect, r));
+ }
+
// Map source rectangle into coordinates of the backing store.
const QPoint controlBase(controlRect.iTl.iX, controlRect.iTl.iY);
const QPoint backingStoreBase = qwidget->mapTo(qwidget->window(), controlBase);
@@ -851,6 +857,19 @@ void QSymbianControl::Draw(const TRect& controlRect) const
} else {
surface->flush(qwidget, QRegion(qt_TRect2QRect(backingStoreRect)), QPoint());
}
+
+ if (sendNativePaintEvents) {
+ const QRect r = qt_TRect2QRect(controlRect);
+ // The draw ops aren't actually sent to WSERV until the graphics
+ // context is deactivated, which happens in the function calling
+ // this one. We therefore delay the delivery of endNativePaintEvent,
+ // to ensure that drawing has completed by the time the widget
+ // receives the event. Note that, if the widget needs to ensure
+ // that the draw ops have actually been executed into the output
+ // framebuffer, a call to RWsSession::Flush is required in the
+ // endNativePaintEvent implementation.
+ QMetaObject::invokeMethod(qwidget, "endNativePaintEvent", Qt::QueuedConnection, Q_ARG(QRect, r));
+ }
}
void QSymbianControl::SizeChanged()