Title: [100410] trunk/Source/WebKit/qt
Revision
100410
Author
[email protected]
Date
2011-11-15 23:09:24 -0800 (Tue, 15 Nov 2011)

Log Message

[TexMap][Qt] Start PageClientQ[Graphics]Widget::syncTimer only when the syncTimer
is inactive.
https://bugs.webkit.org/show_bug.cgi?id=70407

Make sure we only activate the synchronization timer in
PageClientQWidget/PageClientQGraphicsWidget if it's not already active,
otherwise syncLayers may be called redundantly.

Patch by Huang Dongsung <[email protected]> on 2011-11-15
Reviewed by Noam Rosenthal.

* WebCoreSupport/PageClientQt.cpp:
(WebCore::PageClientQWidget::markForSync):
(WebCore::PageClientQWidget::syncLayers):
(WebCore::PageClientQGraphicsWidget::syncLayers):
(WebCore::PageClientQGraphicsWidget::markForSync):
* WebCoreSupport/PageClientQt.h:
(WebCore::PageClientQGraphicsWidget::PageClientQGraphicsWidget):

Modified Paths

Diff

Modified: trunk/Source/WebKit/qt/ChangeLog (100409 => 100410)


--- trunk/Source/WebKit/qt/ChangeLog	2011-11-16 06:46:48 UTC (rev 100409)
+++ trunk/Source/WebKit/qt/ChangeLog	2011-11-16 07:09:24 UTC (rev 100410)
@@ -1,3 +1,23 @@
+2011-11-15  Huang Dongsung  <[email protected]>
+
+        [TexMap][Qt] Start PageClientQ[Graphics]Widget::syncTimer only when the syncTimer
+        is inactive.
+        https://bugs.webkit.org/show_bug.cgi?id=70407
+
+        Make sure we only activate the synchronization timer in
+        PageClientQWidget/PageClientQGraphicsWidget if it's not already active,
+        otherwise syncLayers may be called redundantly.
+
+        Reviewed by Noam Rosenthal.
+
+        * WebCoreSupport/PageClientQt.cpp:
+        (WebCore::PageClientQWidget::markForSync):
+        (WebCore::PageClientQWidget::syncLayers):
+        (WebCore::PageClientQGraphicsWidget::syncLayers):
+        (WebCore::PageClientQGraphicsWidget::markForSync):
+        * WebCoreSupport/PageClientQt.h:
+        (WebCore::PageClientQGraphicsWidget::PageClientQGraphicsWidget):
+
 2011-11-15  Jochen Eisinger  <[email protected]>
 
         Rename ReferrerPolicy to clarify its meaning

Modified: trunk/Source/WebKit/qt/WebCoreSupport/PageClientQt.cpp (100409 => 100410)


--- trunk/Source/WebKit/qt/WebCoreSupport/PageClientQt.cpp	2011-11-16 06:46:48 UTC (rev 100409)
+++ trunk/Source/WebKit/qt/WebCoreSupport/PageClientQt.cpp	2011-11-16 07:09:24 UTC (rev 100410)
@@ -85,6 +85,8 @@
 
 void PageClientQWidget::markForSync(bool scheduleSync)
 {
+    if (syncTimer.isActive())
+        return;
     syncTimer.startOneShot(0);
 }
 
@@ -95,7 +97,7 @@
     QWebFramePrivate::core(page->mainFrame())->view()->syncCompositingStateIncludingSubframes();
     if (!textureMapperNodeClient)
         return;
-    if (textureMapperNodeClient->rootNode()->descendantsOrSelfHaveRunningAnimations())
+    if (textureMapperNodeClient->rootNode()->descendantsOrSelfHaveRunningAnimations() && !syncTimer.isActive())
         syncTimer.startOneShot(1.0 / 60.0);
     update(view->rect());
 }
@@ -251,12 +253,9 @@
     if (!textureMapperNodeClient)
         return;
 
-    if (textureMapperNodeClient->rootNode()->descendantsOrSelfHaveRunningAnimations())
+    if (textureMapperNodeClient->rootNode()->descendantsOrSelfHaveRunningAnimations() && !syncTimer.isActive())
         syncTimer.startOneShot(1.0 / 60.0);
     update(view->boundingRect().toAlignedRect());
-    if (!shouldSync)
-        return;
-    shouldSync = false;
 #endif
 }
 
@@ -298,7 +297,8 @@
 
 void PageClientQGraphicsWidget::markForSync(bool scheduleSync)
 {
-    shouldSync = true;
+    if (syncTimer.isActive())
+        return;
     syncTimer.startOneShot(0);
 }
 

Modified: trunk/Source/WebKit/qt/WebCoreSupport/PageClientQt.h (100409 => 100410)


--- trunk/Source/WebKit/qt/WebCoreSupport/PageClientQt.h	2011-11-16 06:46:48 UTC (rev 100409)
+++ trunk/Source/WebKit/qt/WebCoreSupport/PageClientQt.h	2011-11-16 07:09:24 UTC (rev 100410)
@@ -161,7 +161,6 @@
         , viewResizesToContents(false)
 #if USE(ACCELERATED_COMPOSITING)
         , syncTimer(this, &PageClientQGraphicsWidget::syncLayersTimeout)
-        , shouldSync(false)
 #endif
         , overlay(0)
     {
@@ -230,10 +229,6 @@
 #endif
     // we have to flush quite often, so we use a meta-method instead of QTimer::singleShot for putting the event in the queue
     Timer<PageClientQGraphicsWidget> syncTimer;
-
-    // we need to sync the layers if we get a special call from the WebCore
-    // compositor telling us to do so. We'll get that call from ChromeClientQt
-    bool shouldSync;
 #endif
     // the overlay gets instantiated when the root layer is attached, and get deleted when it's detached
     QGraphicsItemOverlay* overlay;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to