Skip to content
Permalink
Browse files
<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
  • Loading branch information
hortont424 committed Mar 6, 2021
1 parent 7e708cb commit 9e0516fa884f353548f618a1314e3451b3e2a517
Showing 49 changed files with 715 additions and 16 deletions.
@@ -1,3 +1,17 @@
2021-03-06 Tim Horton <timothy_horton@apple.com>

<model> should create a model-owning compositing layer
https://bugs.webkit.org/show_bug.cgi?id=222798

Reviewed by Simon Fraser.

* 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.

2021-03-05 Said Abou-Hallawa <said@apple.com>

[GPU Process] Tests under imported/blink/fast/canvas are now fixed by r273956
@@ -0,0 +1,18 @@
(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)
)
)
)
)
)

@@ -0,0 +1,30 @@
<!DOCTYPE html><!-- webkit-test-runner [ ModelElementEnabled=true ] -->
<html>
<body>
<model id="model">
<source src="resources/heart.usdz">
</model>
<pre id="layers"></p>
<script>
let layers = document.getElementById("layers");

if (window.testRunner) {
testRunner.waitUntilDone();
testRunner.dumpAsText();
} else
layers.textContent = "This test requires testRunner.";

let model = document.getElementById("model");

model.ready.then(value => {
if (window.testRunner)
layers.innerText = window.internals.layerTreeAsText(document);
}, reason => {
layers.textContent = `Failed. Model did not load: ${reason}`;
}).finally(() => {
if (window.testRunner)
testRunner.notifyDone();
});
</script>
</body>
</html>
@@ -3,5 +3,6 @@ layer at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
RenderModel {MODEL} at (0,0) size 300x150
RenderText {#text} at (0,0) size 0x0
layer at (8,8) size 300x150
RenderModel {MODEL} at (0,0) size 300x150
@@ -3,5 +3,6 @@ layer at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
RenderModel {MODEL} at (0,0) size 300x150
RenderText {#text} at (0,0) size 0x0
layer at (8,8) size 300x150
RenderModel {MODEL} at (0,0) size 300x150
@@ -1,3 +1,13 @@
2021-03-06 Tim Horton <timothy_horton@apple.com>

<model> should create a model-owning compositing layer
https://bugs.webkit.org/show_bug.cgi?id=222798

Reviewed by Simon Fraser.

* inspector/protocol/LayerTree.json:
Add a compositing reason for <model>.

2021-03-05 Yusuke Suzuki <ysuzuki@apple.com>

Unreviewed, suppress warning as it is done in DFGOperations.cpp
@@ -53,6 +53,7 @@
{ "name": "canvas", "type": "boolean", "optional": true, "description": "Composition due to the element being a <canvas> element." },
{ "name": "plugin", "type": "boolean", "optional": true, "description": "Composition due to association with a plugin." },
{ "name": "iFrame", "type": "boolean", "optional": true, "description": "Composition due to association with an <iframe> element." },
{ "name": "model", "type": "boolean", "optional": true, "description": "Composition due to association with a <model> element." },
{ "name": "backfaceVisibilityHidden", "type": "boolean", "optional": true, "description": "Composition due to association with an element with a \"backface-visibility: hidden\" style." },
{ "name": "clipsCompositingDescendants", "type": "boolean", "optional": true, "description": "Composition due to association with an element clipping compositing descendants." },
{ "name": "animation", "type": "boolean", "optional": true, "description": "Composition due to association with an animated element." },
@@ -1,3 +1,69 @@
2021-03-06 Tim Horton <timothy_horton@apple.com>

<model> should create a model-owning compositing layer
https://bugs.webkit.org/show_bug.cgi?id=222798

Reviewed by Simon Fraser.

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>.

2021-03-05 Wenson Hsieh <wenson_hsieh@apple.com>

[iOS] Implement additional accessibility support for image overlays
@@ -34,6 +34,8 @@
#include "HTMLNames.h"
#include "HTMLParserIdioms.h"
#include "HTMLSourceElement.h"
#include "JSEventTarget.h"
#include "Model.h"
#include "RenderModel.h"
#include <wtf/IsoMallocInlines.h>
#include <wtf/URL.h>
@@ -69,6 +71,13 @@ RefPtr<SharedBuffer> HTMLModelElement::modelData() const
return m_data;
}

RefPtr<Model> HTMLModelElement::model() const
{
if (auto modelData = this->modelData())
return Model::create(*modelData);
return nullptr;
}

void HTMLModelElement::sourcesChanged()
{
if (!document().hasBrowsingContext()) {
@@ -37,6 +37,8 @@

namespace WebCore {

class Model;

template<typename IDLType> class DOMPromiseProxyWithResolveCallback;

class HTMLModelElement final : public HTMLElement, private CachedRawResourceClient {
@@ -52,6 +54,8 @@ class HTMLModelElement final : public HTMLElement, private CachedRawResourceClie
ReadyPromise& ready() { return m_readyPromise.get(); }

RefPtr<SharedBuffer> modelData() const;

RefPtr<Model> model() const;

private:
HTMLModelElement(const QualifiedName&, Document&);
@@ -1987,6 +1987,7 @@ platform/graphics/LayoutRect.cpp
platform/graphics/LayoutSize.cpp
platform/graphics/MIMETypeCache.cpp
platform/graphics/MediaPlayer.cpp
platform/graphics/Model.cpp
platform/graphics/NamedImageGeneratedImage.cpp
platform/graphics/NativeImage.cpp
platform/graphics/Path.cpp
@@ -843,6 +843,7 @@
2D9F0E1314FF1CBF00BA0FF7 /* linearSRGB.icc in Resources */ = {isa = PBXBuildFile; fileRef = 2D9F0E1214FF1CBF00BA0FF7 /* linearSRGB.icc */; };
2DACB9E923755D0000B4C185 /* GraphicsContextImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F00123F1FAD87D600531D76 /* GraphicsContextImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
2DAF343D1EA7E0F100382CD3 /* ConstantPropertyMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DAF343B1EA7E0F100382CD3 /* ConstantPropertyMap.h */; };
2DC8D39825F2FE9700CFCBAB /* Model.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DC8D39725F2FE9400CFCBAB /* Model.h */; settings = {ATTRIBUTES = (Private, ); }; };
2DD5A7271EBEE47D009BA597 /* CompositionUnderline.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DD5A7261EBEE47D009BA597 /* CompositionUnderline.h */; settings = {ATTRIBUTES = (Private, ); }; };
2DE70023192FE82A00B0975C /* DisplayRefreshMonitorMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DE70022192FE82A00B0975C /* DisplayRefreshMonitorMac.h */; };
2DF512CE1D873E47001D6780 /* ReplaceRangeWithTextCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DF512CC1D873E47001D6780 /* ReplaceRangeWithTextCommand.h */; };
@@ -7238,6 +7239,8 @@
2DAAE32D19DCAF6000E002D2 /* MockPageOverlayClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MockPageOverlayClient.h; sourceTree = "<group>"; };
2DAF343A1EA7E0F100382CD3 /* ConstantPropertyMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConstantPropertyMap.cpp; sourceTree = "<group>"; };
2DAF343B1EA7E0F100382CD3 /* ConstantPropertyMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConstantPropertyMap.h; sourceTree = "<group>"; };
2DC8D39625F2FE9300CFCBAB /* Model.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Model.cpp; sourceTree = "<group>"; };
2DC8D39725F2FE9400CFCBAB /* Model.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Model.h; sourceTree = "<group>"; };
2DD5A7261EBEE47D009BA597 /* CompositionUnderline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CompositionUnderline.h; sourceTree = "<group>"; };
2DE70022192FE82A00B0975C /* DisplayRefreshMonitorMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DisplayRefreshMonitorMac.h; sourceTree = "<group>"; };
2DF512CB1D873E47001D6780 /* ReplaceRangeWithTextCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReplaceRangeWithTextCommand.cpp; sourceTree = "<group>"; };
@@ -26835,6 +26838,8 @@
07611DB8243FB75C00D80704 /* MediaUsageInfo.h */,
07B93FFB23B92AAB0036F8EA /* MIMETypeCache.cpp */,
07B93FF923B92AAA0036F8EA /* MIMETypeCache.h */,
2DC8D39625F2FE9300CFCBAB /* Model.cpp */,
2DC8D39725F2FE9400CFCBAB /* Model.h */,
314BE3A41B3103FB00141982 /* NamedImageGeneratedImage.cpp */,
314BE3A51B3103FB00141982 /* NamedImageGeneratedImage.h */,
7252396B254CADC200F5FB15 /* NativeImage.cpp */,
@@ -29644,9 +29649,9 @@
C2015C091BE6FE2C00822389 /* FontVariantBuilder.h */,
CD4E0AFA11F7BC27009D3811 /* fullscreen.css */,
93CA4C9909DF93FA00DF8677 /* html.css */,
E54CA6DD255DE2D500F901A3 /* legacyFormControlsIOS.css */,
E55F4979151B888000BB67DB /* LengthFunctions.cpp */,
E5BA7D62151437CA00FE1E3F /* LengthFunctions.h */,
E54CA6DD255DE2D500F901A3 /* legacyFormControlsIOS.css */,
93CA4C9A09DF93FA00DF8677 /* make-css-file-arrays.pl */,
93CA4C9B09DF93FA00DF8677 /* makeprop.pl */,
43B85ED018CBEACE00E31AF4 /* makeSelectorPseudoClassAndCompatibilityElementMap.py */,
@@ -33962,6 +33967,7 @@
CDF2B0171820540700F2B424 /* MockSourceBufferPrivate.h in Headers */,
CDF2B0191820540700F2B424 /* MockTracks.h in Headers */,
5715610C234C1CA1008FC7AB /* MockWebAuthenticationConfiguration.h in Headers */,
2DC8D39825F2FE9700CFCBAB /* Model.h in Headers */,
C6D74AD509AA282E000B0A52 /* ModifySelectionListLevel.h in Headers */,
709A01FE1E3D0BDD006B0D4C /* ModuleFetchFailureKind.h in Headers */,
E3201C1A1F8E82130076A032 /* ModuleFetchParameters.h in Headers */,
@@ -257,6 +257,8 @@ Protocol::ErrorStringOr<Ref<Protocol::LayerTree::CompositingReasons>> InspectorL
compositingReasons->setPlugin(true);
else if (reasons.contains(CompositingReason::IFrame))
compositingReasons->setIFrame(true);
else if (reasons.contains(CompositingReason::Model))
compositingReasons->setModel(true);

if (reasons.contains(CompositingReason::BackfaceVisibilityHidden))
compositingReasons->setBackfaceVisibilityHidden(true);
@@ -59,6 +59,7 @@ class Animation;
class GraphicsContext;
class GraphicsLayerFactory;
class Image;
class Model;
class TiledBacking;
class TimingFunction;
class TransformationMatrix;
@@ -509,12 +510,16 @@ class GraphicsLayer : public RefCounted<GraphicsLayer> {
Media,
Canvas,
BackgroundColor,
Plugin
Plugin,
Model
};

// Pass an invalid color to remove the contents layer.
virtual void setContentsToSolidColor(const Color&) { }
virtual void setContentsToPlatformLayer(PlatformLayer*, ContentsLayerPurpose) { }
#if ENABLE(MODEL_ELEMENT)
virtual void setContentsToModel(RefPtr<Model>&&) { }
#endif
virtual bool usesContentsLayer() const { return false; }

// Callback from the underlying graphics system to draw layer contents.
@@ -0,0 +1,56 @@
/*
* Copyright (C) 2021 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "config.h"
#include "Model.h"

#if ENABLE(MODEL_ELEMENT)

namespace WebCore {

Ref<Model> Model::create(Ref<SharedBuffer> data)
{
return adoptRef(*new Model(data));
}

Model::Model(Ref<SharedBuffer> data)
: m_data(data)
{
}

Model::~Model() = default;

TextStream& operator<<(TextStream& ts, const Model& model)
{
TextStream::GroupScope groupScope(ts);

ts.dumpProperty("data-size", model.data()->size());

return ts;
}

}

#endif // ENABLE(MODEL_ELEMENT)

0 comments on commit 9e0516f

Please sign in to comment.