- Revision
- 233909
- Author
- [email protected]
- Date
- 2018-07-18 03:20:21 -0700 (Wed, 18 Jul 2018)
Log 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):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (233908 => 233909)
--- trunk/Source/WebCore/ChangeLog 2018-07-18 07:02:02 UTC (rev 233908)
+++ trunk/Source/WebCore/ChangeLog 2018-07-18 10:20:21 UTC (rev 233909)
@@ -1,3 +1,24 @@
+2018-07-18 Zan Dobersek <[email protected]>
+
+ [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.
+
+ * 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:
+
2018-07-18 Simon Fraser <[email protected]>
Shrink CompositeAnimation and AnimationBase
Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp (233908 => 233909)
--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp 2018-07-18 07:02:02 UTC (rev 233908)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp 2018-07-18 10:20:21 UTC (rev 233909)
@@ -1111,6 +1111,11 @@
downcast<CoordinatedGraphicsLayer>(*child).setCoordinatorIncludingSubLayersIfNeeded(coordinator);
}
+const RefPtr<Nicosia::CompositionLayer>& CoordinatedGraphicsLayer::compositionLayer() const
+{
+ return m_nicosia.layer;
+}
+
void CoordinatedGraphicsLayer::setNeedsVisibleRectAdjustment()
{
if (shouldHaveBackingStore())
Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h (233908 => 233909)
--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h 2018-07-18 07:02:02 UTC (rev 233908)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h 2018-07-18 10:20:21 UTC (rev 233909)
@@ -134,6 +134,8 @@
void setNeedsVisibleRectAdjustment();
void purgeBackingStores();
+ const RefPtr<Nicosia::CompositionLayer>& compositionLayer() const;
+
private:
bool isCoordinatedGraphicsLayer() const override { return true; }
Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h (233908 => 233909)
--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h 2018-07-18 07:02:02 UTC (rev 233908)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h 2018-07-18 10:20:21 UTC (rev 233909)
@@ -37,6 +37,7 @@
#include "IntRect.h"
#include "IntSize.h"
#include "NicosiaBuffer.h"
+#include "NicosiaPlatformLayer.h"
#include "SurfaceUpdateInfo.h"
#include "TextureMapperAnimation.h"
#include "TransformationMatrix.h"
@@ -174,6 +175,11 @@
};
struct CoordinatedGraphicsState {
+ struct NicosiaState {
+ HashSet<RefPtr<Nicosia::CompositionLayer>> layers;
+ RefPtr<Nicosia::CompositionLayer> rootLayer;
+ } nicosia;
+
uint32_t rootCompositingLayer;
Vector<CoordinatedLayerID> layersToCreate;
Modified: trunk/Source/WebKit/ChangeLog (233908 => 233909)
--- trunk/Source/WebKit/ChangeLog 2018-07-18 07:02:02 UTC (rev 233908)
+++ trunk/Source/WebKit/ChangeLog 2018-07-18 10:20:21 UTC (rev 233909)
@@ -1,3 +1,37 @@
+2018-07-18 Zan Dobersek <[email protected]>
+
+ [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.
+
+ 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):
+
2018-07-17 Tim Horton <[email protected]>
REGRESSION (iOS 12): Can't scroll to the bottom of the page in WKWebView while keyboard is up on pages with viewport-fit=cover
Modified: trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp (233908 => 233909)
--- trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp 2018-07-18 07:02:02 UTC (rev 233908)
+++ trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp 2018-07-18 10:20:21 UTC (rev 233909)
@@ -431,6 +431,9 @@
if (!m_client)
return;
+ m_nicosia = state.nicosia;
+ // FIXME: Start using the Nicosia layer state for updates.
+
CommitScope commitScope;
createLayers(state.layersToCreate);
Modified: trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h (233908 => 233909)
--- trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h 2018-07-18 07:02:02 UTC (rev 233908)
+++ trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h 2018-07-18 10:20:21 UTC (rev 233909)
@@ -142,6 +142,8 @@
void onNewBufferAvailable() override;
#endif
+ WebCore::CoordinatedGraphicsState::NicosiaState m_nicosia;
+
std::unique_ptr<WebCore::TextureMapper> m_textureMapper;
HashMap<WebCore::CoordinatedImageBackingID, RefPtr<CoordinatedBackingStore>> m_imageBackings;
Modified: trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp (233908 => 233909)
--- trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp 2018-07-18 07:02:02 UTC (rev 233908)
+++ trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp 2018-07-18 10:20:21 UTC (rev 233909)
@@ -171,7 +171,9 @@
if (m_didInitializeRootCompositingLayer)
return;
- m_state.rootCompositingLayer = downcast<CoordinatedGraphicsLayer>(*m_rootLayer).id();
+ auto& rootLayer = downcast<CoordinatedGraphicsLayer>(*m_rootLayer);
+ m_state.nicosia.rootLayer = rootLayer.compositionLayer();
+ m_state.rootCompositingLayer = rootLayer.id();
m_didInitializeRootCompositingLayer = true;
m_shouldSyncFrame = true;
}
@@ -261,6 +263,7 @@
{
CoordinatedGraphicsLayer* layer = new CoordinatedGraphicsLayer(layerType, client);
layer->setCoordinator(this);
+ m_state.nicosia.layers.add(layer->compositionLayer());
m_registeredLayers.add(layer->id(), layer);
m_state.layersToCreate.append(layer->id());
layer->setNeedsVisibleRectAdjustment();
@@ -301,6 +304,7 @@
if (m_isPurging)
return;
+ m_state.nicosia.layers.remove(layer->compositionLayer());
m_registeredLayers.remove(layer->id());
size_t index = m_state.layersToCreate.find(layer->id());
@@ -316,6 +320,7 @@
void CompositingCoordinator::attachLayer(CoordinatedGraphicsLayer* layer)
{
layer->setCoordinator(this);
+ m_state.nicosia.layers.add(layer->compositionLayer());
m_registeredLayers.add(layer->id(), layer);
m_state.layersToCreate.append(layer->id());
layer->setNeedsVisibleRectAdjustment();