<model> should create a model-owning compositing layer
https://bugs.webkit.org/show_bug.cgi?id=222798
Reviewed by Simon Fraser.
Source/JavaScriptCore:
* inspector/protocol/LayerTree.json:
Add a compositing reason for <model>.
Source/WebCore:
Test: model-element/model-element-graphics-layers.html
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::setContentsToModel):
* platform/graphics/Model.cpp: Added.
(WebCore::Model::create):
(WebCore::Model::Model):
(WebCore::operator<<):
* platform/graphics/Model.h: Added.
(WebCore::Model::encode const):
(WebCore::Model::decode):
Add Model, a wrapper for the model.
For now, it just wraps a SharedBuffer.
In the future, it may contain other things, like file paths, identifiers, etc.
* Modules/model-element/HTMLModelElement.cpp:
(WebCore::HTMLModelElement::model const):
* Modules/model-element/HTMLModelElement.h:
HTMLModelElement can now vend a Model instead of just a SharedBuffer.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::createPlatformCALayer):
(WebCore::GraphicsLayerCA::setContentsToModel):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.cpp:
(WebCore::operator<<):
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
Allow a GraphicsLayer to be given a Model as contents (as we do for e.g. Image and other things).
For simplicity's sake, and because anything more is unnecessary, just re-create
the ModelLayer when the model changes.
* rendering/RenderBoxModelObject.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::contentChanged):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::RenderLayerBacking::contentChanged):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingLayer const):
(WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
(WebCore::RenderLayerCompositor::reasonsForCompositing const):
(WebCore::RenderLayerCompositor::logReasonsForCompositing):
(WebCore::RenderLayerCompositor::requiresCompositingForModel const):
* rendering/RenderLayerCompositor.h:
* rendering/RenderModel.cpp:
(WebCore::RenderModel::requiresLayer const):
(WebCore::RenderModel::updateFromElement):
(WebCore::RenderModel::update):
* rendering/RenderModel.h:
Require compositing for <model>, and add a custom layer type.
* inspector/agents/InspectorLayerTreeAgent.cpp:
(WebCore::InspectorLayerTreeAgent::reasonsForCompositingLayer):
Add a compositing reason for <model>.
Source/WebInspectorUI:
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
(WI.LayerTreeDetailsSidebarPanel.prototype._populateListOfCompositingReasons):
(WI.LayerTreeDetailsSidebarPanel):
* UserInterface/Views/Layers3DContentView.js:
(WI.Layers3DContentView.prototype._updateReasonsList):
(WI.Layers3DContentView):
Add a compositing reason for <model>.
Source/WebKit:
* Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::display):
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::encode const):
(WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
(WebKit::RemoteLayerTreeTransaction::description const):
* SourcesCocoa.txt:
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::makeNode):
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
(WebKit::RemoteLayerTreeHost::makeNode):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.cpp:
(WebKit::GraphicsLayerCARemote::createPlatformCALayer):
* WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.h:
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::create):
(WebKit::PlatformCALayerRemote::populateCreationProperties):
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.h:
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
(WebKit::PlatformCALayerRemoteCustom::populateCreationProperties):
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteModelHosting.h: Added.
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteModelHosting.mm: Added.
(WebKit::PlatformCALayerRemoteModelHosting::create):
(WebKit::PlatformCALayerRemoteModelHosting::PlatformCALayerRemoteModelHosting):
(WebKit::PlatformCALayerRemoteModelHosting::clone const):
(WebKit::PlatformCALayerRemoteModelHosting::populateCreationProperties):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::layerDidEnterContext):
Create a new PlatformCALayerRemote subclass that knows about Model, and
passes its model along in the layer creation properties.
For now, the special model layer type will just make a plain layer.
Future patches will replace it with model-specific rendering.
LayoutTests:
* model-element/model-element-graphics-layers-expected.txt: Added.
* model-element/model-element-graphics-layers.html: Added.
* model-element/model-element-renderer-expected.txt:
* model-element/model-element-renderer-no-source-expected.txt:
Add a test ensuring that we make a compositing layer via layer dump, and update
existing tests that also happen to reveal this via render tree dump as well.
Canonical link: https://commits.webkit.org/234969@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274033 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 11:13:42 +00:00
|
|
|
(GraphicsLayer
|
|
|
|
(anchor 0.00 0.00)
|
|
|
|
(bounds 800.00 600.00)
|
|
|
|
(children 1
|
|
|
|
(GraphicsLayer
|
|
|
|
(bounds 800.00 600.00)
|
|
|
|
(contentsOpaque 1)
|
|
|
|
(children 1
|
|
|
|
(GraphicsLayer
|
|
|
|
(position 8.00 8.00)
|
|
|
|
(bounds 300.00 150.00)
|
|
|
|
(drawsContent 1)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|