[Merge] lp:~albaguirre/qtubuntu/use-mir-surface-apis into lp:qtubuntu
Alberto Aguirre
alberto.aguirre at canonical.com
Tue Oct 27 17:12:17 UTC 2015
> In UbuntuWindow::handleSurfaceResize
>
> """
> auto const numRepaints = mSurface->needsRepaint();
> DLOG("[ubuntumirclient QPA] handleSurfaceResize(window=%p) redraw %d
> times", window(), numRepaints);
> for (int i = 0; i < numRepaints; i++) {
> DLOG("[ubuntumirclient QPA] handleSurfaceResize(window=%p) repainting
> width=%d, height=%d", window(), geometry().size().width(),
> geometry().size().height());
> QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(),
> geometry().size()));
> }
> """
>
> You sure this works as you expect?
>
> From what I understand, if you queue two expose events for processing, they
> will both be processed on the same event loop iteration and the second one
> will be pretty much a NO-OP as a redraw will already be scheduled at that
> point (ie, window will already be dirty/exposed).
Yeah you can see the output logs that the two redraw events are handled and it makes
sense because this is the callstack for an expose event for a QQuickWindow:
QSGGuiThreadRenderLoop::renderWindow (https://github.com/qtproject/qtdeclarative/blob/5.4/src/quick/scenegraph/qsgrenderloop.cpp#L301)
QSGGuiThreadRenderLoop::exposureChanged (https://github.com/qtproject/qtdeclarative/blob/5.4/src/quick/scenegraph/qsgrenderloop.cpp#L406)
QQuickWindow::exposeEvent (https://github.com/qtproject/qtdeclarative/blob/5.4/src/quick/items/qquickwindow.cpp#L202)
QGuiApplicationPrivate::processExposeEvent (https://github.com/qtproject/qtbase/blob/5.4/src/gui/kernel/qguiapplication.cpp#L2589)
QWindowSystemInterface::handleExposeEvent (https://github.com/qtproject/qtbase/blob/5.4/src/gui/kernel/qwindowsysteminterface.cpp#L523)
The main checks through out that call stack are:
- QWindow::isExposed, QPlatformWindow::isExposed (both will be true if the surface is visible)
In QSGGuiThreadRenderLoop::renderWindow checks
- QQuickWindowPrivate::isRenderable() (https://github.com/qtproject/qtdeclarative/blob/5.4/src/quick/scenegraph/qsgrenderloop.cpp#L304)
--- which does: (https://github.com/qtproject/qtdeclarative/blob/5.4/src/quick/items/qquickwindow.cpp#L2463)
- and another isVisible check before issuing a swapBuffers (https://github.com/qtproject/qtdeclarative/blob/5.4/src/quick/scenegraph/qsgrenderloop.cpp#L374)
The end result is that issuing the two calls, the first event waits for swapBuffers, which can then update the geometry (and that geometry change event I suppose is prioritized because it's generated by the rendering thread) - in the second event, then the scengraph should render with the new geometry.
--
https://code.launchpad.net/~albaguirre/qtubuntu/use-mir-surface-apis/+merge/267228
Your team Ubuntu Phablet Team is subscribed to branch lp:qtubuntu.
More information about the Ubuntu-reviews
mailing list