Title: [196058] trunk/Source/WebCore
Revision
196058
Author
[email protected]
Date
2016-02-03 01:54:20 -0800 (Wed, 03 Feb 2016)

Log Message

[TexMap] CompositingCoordinator should store the overlay layer, flush it as appropriate
https://bugs.webkit.org/show_bug.cgi?id=152058

Reviewed by Michael Catanzaro.

Previously, the CompositingCoordinator only added the overlay layer to the
layer tree, but flushing its compositing state is also required. For that to
happen, CompositingCoordinator has to store a pointer to the overlay layer
object and flush it in ::flushPendingLayerChanges().

Overlay layers are most prominently used by the Web Inspector to highlight
the DOM elements on the Web page that are being hovered in the inspector.

* platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
(WebCore::CompositingCoordinator::CompositingCoordinator):
(WebCore::CompositingCoordinator::setRootCompositingLayer):
(WebCore::CompositingCoordinator::flushPendingLayerChanges):
* platform/graphics/texmap/coordinated/CompositingCoordinator.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (196057 => 196058)


--- trunk/Source/WebCore/ChangeLog	2016-02-03 08:48:49 UTC (rev 196057)
+++ trunk/Source/WebCore/ChangeLog	2016-02-03 09:54:20 UTC (rev 196058)
@@ -1,5 +1,26 @@
 2016-02-03  Zan Dobersek  <[email protected]>
 
+        [TexMap] CompositingCoordinator should store the overlay layer, flush it as appropriate
+        https://bugs.webkit.org/show_bug.cgi?id=152058
+
+        Reviewed by Michael Catanzaro.
+
+        Previously, the CompositingCoordinator only added the overlay layer to the
+        layer tree, but flushing its compositing state is also required. For that to
+        happen, CompositingCoordinator has to store a pointer to the overlay layer
+        object and flush it in ::flushPendingLayerChanges().
+
+        Overlay layers are most prominently used by the Web Inspector to highlight
+        the DOM elements on the Web page that are being hovered in the inspector.
+
+        * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
+        (WebCore::CompositingCoordinator::CompositingCoordinator):
+        (WebCore::CompositingCoordinator::setRootCompositingLayer):
+        (WebCore::CompositingCoordinator::flushPendingLayerChanges):
+        * platform/graphics/texmap/coordinated/CompositingCoordinator.h:
+
+2016-02-03  Zan Dobersek  <[email protected]>
+
         [CoordinatedGraphics] CompositingCoordinator destructor is scheduling layer flushes
         https://bugs.webkit.org/show_bug.cgi?id=153823
 

Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp (196057 => 196058)


--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp	2016-02-03 08:48:49 UTC (rev 196057)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp	2016-02-03 09:54:20 UTC (rev 196058)
@@ -47,6 +47,7 @@
     : m_page(page)
     , m_client(client)
     , m_rootCompositingLayer(nullptr)
+    , m_overlayCompositingLayer(nullptr)
     , m_isDestructing(false)
     , m_isPurging(false)
     , m_isFlushingLayerChanges(false)
@@ -78,8 +79,9 @@
     if (m_rootCompositingLayer)
         m_rootLayer->addChildAtIndex(m_rootCompositingLayer, 0);
 
-    if (overlayLayer)
-        m_rootLayer->addChild(overlayLayer);
+    m_overlayCompositingLayer = overlayLayer;
+    if (m_overlayCompositingLayer)
+        m_rootLayer->addChild(m_overlayCompositingLayer);
 }
 
 void CompositingCoordinator::sizeDidChange(const IntSize& newSize)
@@ -94,9 +96,13 @@
 
     initializeRootCompositingLayerIfNeeded();
 
-    m_rootLayer->flushCompositingStateForThisLayerOnly(m_page->mainFrame().view()->viewportIsStable());
+    bool viewportIsStable = m_page->mainFrame().view()->viewportIsStable();
+    m_rootLayer->flushCompositingStateForThisLayerOnly(viewportIsStable);
     m_client->didFlushRootLayer(m_visibleContentsRect);
 
+    if (m_overlayCompositingLayer)
+        m_overlayCompositingLayer->flushCompositingState(FloatRect(FloatPoint(), m_rootLayer->size()), viewportIsStable);
+
     bool didSync = m_page->mainFrame().view()->flushCompositingStateIncludingSubframes();
 
     toCoordinatedGraphicsLayer(m_rootLayer.get())->updateContentBuffersIncludingSubLayers();

Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.h (196057 => 196058)


--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.h	2016-02-03 08:48:49 UTC (rev 196057)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.h	2016-02-03 09:54:20 UTC (rev 196058)
@@ -129,6 +129,7 @@
 
     std::unique_ptr<GraphicsLayer> m_rootLayer;
     GraphicsLayer* m_rootCompositingLayer;
+    GraphicsLayer* m_overlayCompositingLayer;
 
     CoordinatedGraphicsState m_state;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to