Changeset 196058 in webkit


Ignore:
Timestamp:
Feb 3, 2016 1:54:20 AM (8 years ago)
Author:
zandobersek@gmail.com
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:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r196056 r196058  
     12016-02-03  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        [TexMap] CompositingCoordinator should store the overlay layer, flush it as appropriate
     4        https://bugs.webkit.org/show_bug.cgi?id=152058
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        Previously, the CompositingCoordinator only added the overlay layer to the
     9        layer tree, but flushing its compositing state is also required. For that to
     10        happen, CompositingCoordinator has to store a pointer to the overlay layer
     11        object and flush it in ::flushPendingLayerChanges().
     12
     13        Overlay layers are most prominently used by the Web Inspector to highlight
     14        the DOM elements on the Web page that are being hovered in the inspector.
     15
     16        * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
     17        (WebCore::CompositingCoordinator::CompositingCoordinator):
     18        (WebCore::CompositingCoordinator::setRootCompositingLayer):
     19        (WebCore::CompositingCoordinator::flushPendingLayerChanges):
     20        * platform/graphics/texmap/coordinated/CompositingCoordinator.h:
     21
    1222016-02-03  Zan Dobersek  <zdobersek@igalia.com>
    223
  • trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp

    r196056 r196058  
    4848    , m_client(client)
    4949    , m_rootCompositingLayer(nullptr)
     50    , m_overlayCompositingLayer(nullptr)
    5051    , m_isDestructing(false)
    5152    , m_isPurging(false)
     
    7980        m_rootLayer->addChildAtIndex(m_rootCompositingLayer, 0);
    8081
    81     if (overlayLayer)
    82         m_rootLayer->addChild(overlayLayer);
     82    m_overlayCompositingLayer = overlayLayer;
     83    if (m_overlayCompositingLayer)
     84        m_rootLayer->addChild(m_overlayCompositingLayer);
    8385}
    8486
     
    9597    initializeRootCompositingLayerIfNeeded();
    9698
    97     m_rootLayer->flushCompositingStateForThisLayerOnly(m_page->mainFrame().view()->viewportIsStable());
     99    bool viewportIsStable = m_page->mainFrame().view()->viewportIsStable();
     100    m_rootLayer->flushCompositingStateForThisLayerOnly(viewportIsStable);
    98101    m_client->didFlushRootLayer(m_visibleContentsRect);
     102
     103    if (m_overlayCompositingLayer)
     104        m_overlayCompositingLayer->flushCompositingState(FloatRect(FloatPoint(), m_rootLayer->size()), viewportIsStable);
    99105
    100106    bool didSync = m_page->mainFrame().view()->flushCompositingStateIncludingSubframes();
  • trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.h

    r196056 r196058  
    130130    std::unique_ptr<GraphicsLayer> m_rootLayer;
    131131    GraphicsLayer* m_rootCompositingLayer;
     132    GraphicsLayer* m_overlayCompositingLayer;
    132133
    133134    CoordinatedGraphicsState m_state;
Note: See TracChangeset for help on using the changeset viewer.