Changeset 233909 in webkit


Ignore:
Timestamp:
Jul 18, 2018 3:20:21 AM (6 years ago)
Author:
zandobersek@gmail.com
Message:

[CoordGraphics] Start tracking Nicosia layers in CoordinatedGraphicsState
https://bugs.webkit.org/show_bug.cgi?id=187751

Reviewed by Carlos Garcia Campos.

Start including the Nicosia::CompositionLayer objects in the
CoordinatedGraphicsState struct, under a separate NicosiaState struct.
References to all the layers in a given scene are kept in a HashSet,
and a separate reference to the root layer kept in a separate member
variable.

Source/WebCore:

  • platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:

(WebCore::CoordinatedGraphicsLayer::compositionLayer const):

  • platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:

Add the getter method that returns internal Nicosia::CompositionLayer
object. This can't be defined in the class definition because of
WEBCORE_EXPORT used on the CoordinatedGraphicsLayer class.

  • platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:

Source/WebKit:

CompositingCoordinator now takes care of adding or removing the
Nicosia::CompositionLayer objects to the NicosiaState's HashSet, as well
as setting the root layer object when it's being initialized. Additions
and removals of Nicosia::CompositionLayer correspond to the additions
and removals of CoordinatedGraphicsLayer objects to the coordinator's
m_registeredLayers HashMap.

Upon each state commit that's done in CoordinatedGraphicsScene, the
NicosiaState object will be copied into the member variable. Nothing is
done yet with that state object, but in the near future it will be used
to finally commit all the state details into the TextureMapper layers.

  • Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:

(WebKit::CoordinatedGraphicsScene::commitSceneState):

  • Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
  • WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:

(WebKit::CompositingCoordinator::initializeRootCompositingLayerIfNeeded):
(WebKit::CompositingCoordinator::createGraphicsLayer):
(WebKit::CompositingCoordinator::detachLayer):
(WebKit::CompositingCoordinator::attachLayer):

Location:
trunk/Source
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r233908 r233909  
     12018-07-18  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        [CoordGraphics] Start tracking Nicosia layers in CoordinatedGraphicsState
     4        https://bugs.webkit.org/show_bug.cgi?id=187751
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        Start including the Nicosia::CompositionLayer objects in the
     9        CoordinatedGraphicsState struct, under a separate NicosiaState struct.
     10        References to all the layers in a given scene are kept in a HashSet,
     11        and a separate reference to the root layer kept in a separate member
     12        variable.
     13
     14        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
     15        (WebCore::CoordinatedGraphicsLayer::compositionLayer const):
     16        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
     17        Add the getter method that returns internal Nicosia::CompositionLayer
     18        object. This can't be defined in the class definition because of
     19        WEBCORE_EXPORT used on the CoordinatedGraphicsLayer class.
     20        * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
     21
    1222018-07-18  Simon Fraser  <simon.fraser@apple.com>
    223
  • trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp

    r233845 r233909  
    11121112}
    11131113
     1114const RefPtr<Nicosia::CompositionLayer>& CoordinatedGraphicsLayer::compositionLayer() const
     1115{
     1116    return m_nicosia.layer;
     1117}
     1118
    11141119void CoordinatedGraphicsLayer::setNeedsVisibleRectAdjustment()
    11151120{
  • trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h

    r233845 r233909  
    135135    void purgeBackingStores();
    136136
     137    const RefPtr<Nicosia::CompositionLayer>& compositionLayer() const;
     138
    137139private:
    138140    bool isCoordinatedGraphicsLayer() const override { return true; }
  • trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h

    r230955 r233909  
    3838#include "IntSize.h"
    3939#include "NicosiaBuffer.h"
     40#include "NicosiaPlatformLayer.h"
    4041#include "SurfaceUpdateInfo.h"
    4142#include "TextureMapperAnimation.h"
     
    175176
    176177struct CoordinatedGraphicsState {
     178    struct NicosiaState {
     179        HashSet<RefPtr<Nicosia::CompositionLayer>> layers;
     180        RefPtr<Nicosia::CompositionLayer> rootLayer;
     181    } nicosia;
     182
    177183    uint32_t rootCompositingLayer;
    178184
  • trunk/Source/WebKit/ChangeLog

    r233905 r233909  
     12018-07-18  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        [CoordGraphics] Start tracking Nicosia layers in CoordinatedGraphicsState
     4        https://bugs.webkit.org/show_bug.cgi?id=187751
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        Start including the Nicosia::CompositionLayer objects in the
     9        CoordinatedGraphicsState struct, under a separate NicosiaState struct.
     10        References to all the layers in a given scene are kept in a HashSet,
     11        and a separate reference to the root layer kept in a separate member
     12        variable.
     13
     14        CompositingCoordinator now takes care of adding or removing the
     15        Nicosia::CompositionLayer objects to the NicosiaState's HashSet, as well
     16        as setting the root layer object when it's being initialized. Additions
     17        and removals of Nicosia::CompositionLayer correspond to the additions
     18        and removals of CoordinatedGraphicsLayer objects to the coordinator's
     19        m_registeredLayers HashMap.
     20
     21        Upon each state commit that's done in CoordinatedGraphicsScene, the
     22        NicosiaState object will be copied into the member variable. Nothing is
     23        done yet with that state object, but in the near future it will be used
     24        to finally commit all the state details into the TextureMapper layers.
     25
     26        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
     27        (WebKit::CoordinatedGraphicsScene::commitSceneState):
     28        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
     29        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
     30        (WebKit::CompositingCoordinator::initializeRootCompositingLayerIfNeeded):
     31        (WebKit::CompositingCoordinator::createGraphicsLayer):
     32        (WebKit::CompositingCoordinator::detachLayer):
     33        (WebKit::CompositingCoordinator::attachLayer):
     34
    1352018-07-17  Tim Horton  <timothy_horton@apple.com>
    236
  • trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp

    r233080 r233909  
    432432        return;
    433433
     434    m_nicosia = state.nicosia;
     435    // FIXME: Start using the Nicosia layer state for updates.
     436
    434437    CommitScope commitScope;
    435438
  • trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h

    r230955 r233909  
    143143#endif
    144144
     145    WebCore::CoordinatedGraphicsState::NicosiaState m_nicosia;
     146
    145147    std::unique_ptr<WebCore::TextureMapper> m_textureMapper;
    146148
  • trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp

    r233193 r233909  
    172172        return;
    173173
    174     m_state.rootCompositingLayer = downcast<CoordinatedGraphicsLayer>(*m_rootLayer).id();
     174    auto& rootLayer = downcast<CoordinatedGraphicsLayer>(*m_rootLayer);
     175    m_state.nicosia.rootLayer = rootLayer.compositionLayer();
     176    m_state.rootCompositingLayer = rootLayer.id();
    175177    m_didInitializeRootCompositingLayer = true;
    176178    m_shouldSyncFrame = true;
     
    262264    CoordinatedGraphicsLayer* layer = new CoordinatedGraphicsLayer(layerType, client);
    263265    layer->setCoordinator(this);
     266    m_state.nicosia.layers.add(layer->compositionLayer());
    264267    m_registeredLayers.add(layer->id(), layer);
    265268    m_state.layersToCreate.append(layer->id());
     
    302305        return;
    303306
     307    m_state.nicosia.layers.remove(layer->compositionLayer());
    304308    m_registeredLayers.remove(layer->id());
    305309
     
    317321{
    318322    layer->setCoordinator(this);
     323    m_state.nicosia.layers.add(layer->compositionLayer());
    319324    m_registeredLayers.add(layer->id(), layer);
    320325    m_state.layersToCreate.append(layer->id());
Note: See TracChangeset for help on using the changeset viewer.