make sure we polishItems also in plain render loop
authorGunnar Sletta <gunnar.sletta@nokia.com>
Thu, 8 Sep 2011 10:36:53 +0000 (12:36 +0200)
committerLars Knoll <lars.knoll@nokia.com>
Thu, 8 Sep 2011 11:38:31 +0000 (13:38 +0200)
Change-Id: Ife8ab271c77a8daeaca9463e72296714aba17df9
Reviewed-on: http://codereview.qt-project.org/4430
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
src/declarative/items/qsgcanvas.cpp
src/declarative/items/qsgcanvas_p.h

index 6c11e12..d84f322 100644 (file)
@@ -70,9 +70,10 @@ DEFINE_BOOL_CONFIG_OPTION(qmlNoThreadedRenderer, QML_BAD_GUI_RENDER_LOOP)
 
 extern Q_GUI_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha);
 
-void QSGCanvasRenderLoop::updateFocusItemTransform()
+void QSGCanvasPrivate::updateFocusItemTransform()
 {
-    QSGItem *focus = renderer->activeFocusItem();
+    Q_Q(QSGCanvas);
+    QSGItem *focus = q->activeFocusItem();
     if (focus && qApp->inputPanel()->inputItem() == focus)
         qApp->inputPanel()->setInputItemTransform(QSGItemPrivate::get(focus)->itemToCanvasTransform());
 }
@@ -92,7 +93,7 @@ public:
     virtual void paint() {
         if (animationRunning && animationDriver())
             animationDriver()->advance();
-        updateFocusItemTransform();
+        polishItems();
         syncSceneGraph();
         makeCurrent();
         glViewport(0, 0, size.width(), size.height());
@@ -387,6 +388,7 @@ void QSGCanvasPrivate::polishItems()
         QSGItemPrivate::get(item)->polishScheduled = false;
         item->updatePolish();
     }
+    updateFocusItemTransform();
 }
 
 
@@ -2037,7 +2039,6 @@ void QSGCanvasRenderThread::sync(bool guiAlreadyLocked)
     renderThreadAwakened = false;
 
     polishItems();
-    updateFocusItemTransform();
 
     wake();
     wait();
index b0c63f0..d73c57d 100644 (file)
@@ -131,6 +131,7 @@ public:
     void notifyFocusChangesRecur(QSGItem **item, int remaining);
 
     void updateInputMethodData();
+    void updateFocusItemTransform();
 
     void dirtyItem(QSGItem *);
     void cleanup(QSGNode *);
@@ -205,7 +206,6 @@ protected:
     void renderSceneGraph(const QSize &size) { d->renderSceneGraph(size); }
     void polishItems() { d->polishItems(); }
     QAnimationDriver *animationDriver() const { return d->animationDriver; }
-    void updateFocusItemTransform();
 
     inline QOpenGLContext *glContext() const { return gl; }
     void createGLContext();