From 01f94b710bd66f3289f545e3ac97433ce8419043 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Thu, 8 Sep 2011 12:36:53 +0200 Subject: [PATCH] make sure we polishItems also in plain render loop Change-Id: Ife8ab271c77a8daeaca9463e72296714aba17df9 Reviewed-on: http://codereview.qt-project.org/4430 Reviewed-by: Qt Sanity Bot Reviewed-by: Lars Knoll --- src/declarative/items/qsgcanvas.cpp | 9 +++++---- src/declarative/items/qsgcanvas_p.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/declarative/items/qsgcanvas.cpp b/src/declarative/items/qsgcanvas.cpp index 6c11e12..d84f322 100644 --- a/src/declarative/items/qsgcanvas.cpp +++ b/src/declarative/items/qsgcanvas.cpp @@ -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(); diff --git a/src/declarative/items/qsgcanvas_p.h b/src/declarative/items/qsgcanvas_p.h index b0c63f0..d73c57d 100644 --- a/src/declarative/items/qsgcanvas_p.h +++ b/src/declarative/items/qsgcanvas_p.h @@ -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(); -- 1.7.2.5