summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornektar <nektar@chromium.org>2016-02-29 13:43:35 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-29 21:44:48 +0000
commit1c9988c3a3f8c1f6d07c1b66c25bdc7a95a7cc4e (patch)
treec7b0cd6e046a6be8188c20c42984d5c5c2e43bbd
parente2d58400ee8fcfd27b5927e0d00031ccb24df6ba (diff)
downloadchromium_src-1c9988c3a3f8c1f6d07c1b66c25bdc7a95a7cc4e.zip
chromium_src-1c9988c3a3f8c1f6d07c1b66c25bdc7a95a7cc4e.tar.gz
chromium_src-1c9988c3a3f8c1f6d07c1b66c25bdc7a95a7cc4e.tar.bz2
Revert of [SPv2] Support composited plugins via foreign layers. (patchset #11 id:200001 of https://codereview.chromium.org/1714153002/ )
Reason for revert: webkit_unit_tests on Mac-10.9 Original issue's description: > [SPv2] Support composited plugins via foreign layers. > > BUG=587970 > CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel > > Committed: https://crrev.com/bf29b13a060e17f0e1cf96886ab1c798f7d54cc8 > Cr-Commit-Position: refs/heads/master@{#378117} > > Committed: https://crrev.com/c5a5aaba0445bf16820fdf0a5e0093f98e06dd23 > Cr-Commit-Position: refs/heads/master@{#378148} TBR=dcheng@chromium.org,enne@chromium.org,pdr@chromium.org,trchen@chromium.org,jbroman@chromium.org # Not skipping CQ checks because original CL landed more than 1 days ago. BUG=587970 Review URL: https://codereview.chromium.org/1746873002 Cr-Commit-Position: refs/heads/master@{#378279}
-rw-r--r--cc/blink/web_layer_impl.cc4
-rw-r--r--cc/blink/web_layer_impl.h1
-rw-r--r--third_party/WebKit/LayoutTests/TestExpectations2
-rw-r--r--third_party/WebKit/Source/platform/BUILD.gn1
-rw-r--r--third_party/WebKit/Source/platform/blink_platform.gypi2
-rw-r--r--third_party/WebKit/Source/platform/blink_platform_tests.gyp1
-rw-r--r--third_party/WebKit/Source/platform/geometry/IntSize.cpp6
-rw-r--r--third_party/WebKit/Source/platform/geometry/IntSize.h6
-rw-r--r--third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp83
-rw-r--r--third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.h8
-rw-r--r--third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp16
-rw-r--r--third_party/WebKit/Source/platform/graphics/paint/DisplayItem.cpp12
-rw-r--r--third_party/WebKit/Source/platform/graphics/paint/DisplayItem.h6
-rw-r--r--third_party/WebKit/Source/platform/graphics/paint/ForeignLayerDisplayItem.cpp76
-rw-r--r--third_party/WebKit/Source/platform/graphics/paint/ForeignLayerDisplayItem.h66
-rw-r--r--third_party/WebKit/Source/platform/graphics/paint/PaintChunk.h6
-rw-r--r--third_party/WebKit/Source/platform/graphics/paint/PaintChunker.cpp17
-rw-r--r--third_party/WebKit/Source/platform/graphics/paint/PaintChunker.h11
-rw-r--r--third_party/WebKit/Source/platform/graphics/paint/PaintChunkerTest.cpp84
-rw-r--r--third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp9
-rw-r--r--third_party/WebKit/Source/platform/graphics/paint/README.md7
-rw-r--r--third_party/WebKit/Source/platform/testing/DEPS2
-rw-r--r--third_party/WebKit/Source/platform/testing/TestPaintArtifact.cpp12
-rw-r--r--third_party/WebKit/Source/platform/testing/TestPaintArtifact.h6
-rw-r--r--third_party/WebKit/Source/web/WebPluginContainerImpl.cpp11
-rw-r--r--third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp113
-rw-r--r--third_party/WebKit/Source/web/tests/data/plugin.html7
-rw-r--r--third_party/WebKit/public/platform/WebLayer.h1
28 files changed, 78 insertions, 498 deletions
diff --git a/cc/blink/web_layer_impl.cc b/cc/blink/web_layer_impl.cc
index 5c5dd2c..eed02ff 100644
--- a/cc/blink/web_layer_impl.cc
+++ b/cc/blink/web_layer_impl.cc
@@ -462,10 +462,6 @@ const cc::Layer* WebLayerImpl::ccLayer() const {
return layer_.get();
}
-cc::Layer* WebLayerImpl::ccLayer() {
- return layer_.get();
-}
-
void WebLayerImpl::setElementId(uint64_t id) {
layer_->SetElementId(id);
}
diff --git a/cc/blink/web_layer_impl.h b/cc/blink/web_layer_impl.h
index 04fc7f1..28da932 100644
--- a/cc/blink/web_layer_impl.h
+++ b/cc/blink/web_layer_impl.h
@@ -147,7 +147,6 @@ class WebLayerImpl : public blink::WebLayer {
void setScrollClient(blink::WebLayerScrollClient* client) override;
void setLayerClient(cc::LayerClient* client) override;
const cc::Layer* ccLayer() const override;
- cc::Layer* ccLayer() override;
void setElementId(uint64_t id) override;
uint64_t elementId() const override;
void setCompositorMutableProperties(uint32_t properties) override;
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations
index 58c3e42..97599da 100644
--- a/third_party/WebKit/LayoutTests/TestExpectations
+++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -450,8 +450,6 @@ crbug.com/580355 virtual/spv2/fast/block/positioning/relayout-on-position-change
crbug.com/537409 virtual/spv2/svg/as-image/svg-image-with-data-uri.html [ Pass ]
crbug.com/587236 virtual/spv2/compositing/backface-visibility/backface-visibility-3d.html [ Pass ]
crbug.com/587236 virtual/spv2/compositing/backface-visibility/backface-visibility-simple.html [ Pass ]
-crbug.com/587970 virtual/spv2/compositing/plugins/webplugin-alpha.html [ Pass ]
-crbug.com/587970 virtual/spv2/compositing/plugins/webplugin-no-alpha.html [ Pass ]
# In imported/web-platform-tests/html/, we prefer checking in failure
# expectation files. The following tests with [ Failure ] don't have failure
diff --git a/third_party/WebKit/Source/platform/BUILD.gn b/third_party/WebKit/Source/platform/BUILD.gn
index f42d890..f9ae6ae 100644
--- a/third_party/WebKit/Source/platform/BUILD.gn
+++ b/third_party/WebKit/Source/platform/BUILD.gn
@@ -458,7 +458,6 @@ source_set("test_support") {
public_deps = [
":platform",
- "//cc",
"//testing/gmock",
]
diff --git a/third_party/WebKit/Source/platform/blink_platform.gypi b/third_party/WebKit/Source/platform/blink_platform.gypi
index 9b8d1a5..5ffb920 100644
--- a/third_party/WebKit/Source/platform/blink_platform.gypi
+++ b/third_party/WebKit/Source/platform/blink_platform.gypi
@@ -762,8 +762,6 @@
'graphics/paint/FilterDisplayItem.h',
'graphics/paint/FloatClipDisplayItem.cpp',
'graphics/paint/FloatClipDisplayItem.h',
- 'graphics/paint/ForeignLayerDisplayItem.cpp',
- 'graphics/paint/ForeignLayerDisplayItem.h',
'graphics/paint/PaintArtifact.cpp',
'graphics/paint/PaintArtifact.h',
'graphics/paint/PaintArtifactToSkCanvas.cpp',
diff --git a/third_party/WebKit/Source/platform/blink_platform_tests.gyp b/third_party/WebKit/Source/platform/blink_platform_tests.gyp
index 90569f0..bd453eb 100644
--- a/third_party/WebKit/Source/platform/blink_platform_tests.gyp
+++ b/third_party/WebKit/Source/platform/blink_platform_tests.gyp
@@ -111,7 +111,6 @@
'../wtf/wtf.gyp:wtf',
'blink_platform.gyp:blink_common',
'blink_platform.gyp:blink_platform',
- '<(DEPTH)/cc/cc.gyp:cc',
'<(DEPTH)/device/battery/battery.gyp:device_battery_mojo_bindings',
'<(DEPTH)/mojo/mojo_base.gyp:mojo_environment_chromium',
'<(DEPTH)/mojo/mojo_edk.gyp:mojo_system_impl',
diff --git a/third_party/WebKit/Source/platform/geometry/IntSize.cpp b/third_party/WebKit/Source/platform/geometry/IntSize.cpp
index cadeac5..b849445 100644
--- a/third_party/WebKit/Source/platform/geometry/IntSize.cpp
+++ b/third_party/WebKit/Source/platform/geometry/IntSize.cpp
@@ -4,16 +4,10 @@
#include "platform/geometry/IntSize.h"
-#include "ui/gfx/geometry/size.h"
#include "wtf/text/WTFString.h"
namespace blink {
-IntSize::operator gfx::Size() const
-{
- return gfx::Size(width(), height());
-}
-
#ifndef NDEBUG
String IntSize::toString() const
{
diff --git a/third_party/WebKit/Source/platform/geometry/IntSize.h b/third_party/WebKit/Source/platform/geometry/IntSize.h
index d3f51fe..cbbcb86 100644
--- a/third_party/WebKit/Source/platform/geometry/IntSize.h
+++ b/third_party/WebKit/Source/platform/geometry/IntSize.h
@@ -40,10 +40,6 @@ typedef struct CGSize CGSize;
#endif
#endif
-namespace gfx {
-class Size;
-}
-
namespace blink {
class PLATFORM_EXPORT IntSize {
@@ -131,8 +127,6 @@ public:
#endif
#endif
- operator gfx::Size() const;
-
#ifndef NDEBUG
String toString() const;
#endif
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
index 67b1e5f..4f89ff8 100644
--- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
+++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
@@ -16,7 +16,6 @@
#include "platform/graphics/paint/ClipPaintPropertyNode.h"
#include "platform/graphics/paint/DisplayItem.h"
#include "platform/graphics/paint/DrawingDisplayItem.h"
-#include "platform/graphics/paint/ForeignLayerDisplayItem.h"
#include "platform/graphics/paint/PaintArtifact.h"
#include "platform/graphics/paint/TransformPaintPropertyNode.h"
#include "public/platform/Platform.h"
@@ -238,24 +237,6 @@ private:
Vector<NodeLayerPair, 16> m_clipLayers;
};
-scoped_refptr<cc::Layer> foreignLayerForPaintChunk(const PaintArtifact& paintArtifact, const PaintChunk& paintChunk, gfx::Transform transform)
-{
- if (paintChunk.size() != 1)
- return nullptr;
-
- const auto& displayItem = paintArtifact.displayItemList()[paintChunk.beginIndex];
- if (!displayItem.isForeignLayer())
- return nullptr;
-
- const auto& foreignLayerDisplayItem = static_cast<const ForeignLayerDisplayItem&>(displayItem);
- scoped_refptr<cc::Layer> layer = foreignLayerDisplayItem.layer();
- transform.Translate(foreignLayerDisplayItem.location().x(), foreignLayerDisplayItem.location().y());
- layer->SetTransform(transform);
- layer->SetBounds(foreignLayerDisplayItem.bounds());
- layer->SetIsDrawable(true);
- return layer;
-}
-
} // namespace
void PaintArtifactCompositor::update(const PaintArtifact& paintArtifact)
@@ -270,47 +251,37 @@ void PaintArtifactCompositor::update(const PaintArtifact& paintArtifact)
ClipLayerManager clipLayerManager(m_rootLayer.get());
for (const PaintChunk& paintChunk : paintArtifact.paintChunks()) {
cc::Layer* parent = clipLayerManager.switchToNewClipLayer(paintChunk.properties.clip.get());
+
+ gfx::Rect combinedBounds = enclosingIntRect(paintChunk.bounds);
+ scoped_refptr<cc::DisplayItemList> displayList = recordPaintChunk(paintArtifact, paintChunk, combinedBounds);
+ OwnPtr<ContentLayerClientImpl> contentLayerClient = adoptPtr(
+ new ContentLayerClientImpl(std::move(displayList), gfx::Rect(combinedBounds.size())));
+
+ // Include the offset in the transform, because it needs to apply in
+ // this layer's transform space (whereas layer position applies in its
+ // parent's transform space).
gfx::Transform transform = transformToTransformSpace(paintChunk.properties.transform.get(), localTransformSpace(paintChunk.properties.clip.get()));
- scoped_refptr<cc::Layer> layer = layerForPaintChunk(paintArtifact, paintChunk, transform);
+ gfx::Vector2dF offset = gfx::PointF(combinedBounds.origin()).OffsetFromOrigin();
+ if (const auto* clip = paintChunk.properties.clip.get()) {
+ // If a clip was applied, its origin needs to be cancelled out in
+ // this transform.
+ FloatPoint offsetDueToClipOffset = clip->clipRect().rect().location();
+ offset -= gfx::Vector2dF(offsetDueToClipOffset.x(), offsetDueToClipOffset.y());
+ }
+ transform.Translate(offset.x(), offset.y());
+
+ scoped_refptr<cc::PictureLayer> layer = cc::PictureLayer::Create(cc::LayerSettings(), contentLayerClient.get());
+ layer->SetBounds(combinedBounds.size());
+ layer->SetTransform(transform);
+ layer->SetIsDrawable(true);
+ layer->SetDoubleSided(!paintChunk.properties.backfaceHidden);
+ if (paintChunk.knownToBeOpaque)
+ layer->SetContentsOpaque(true);
layer->SetNeedsDisplay();
- parent->AddChild(std::move(layer));
- }
-}
-scoped_refptr<cc::Layer> PaintArtifactCompositor::layerForPaintChunk(const PaintArtifact& paintArtifact, const PaintChunk& paintChunk, gfx::Transform transform)
-{
- // If the paint chunk is a foreign layer, just return that layer.
- if (scoped_refptr<cc::Layer> foreignLayer = foreignLayerForPaintChunk(paintArtifact, paintChunk, transform))
- return foreignLayer;
-
- // The common case: create a layer for painted content.
- gfx::Rect combinedBounds = enclosingIntRect(paintChunk.bounds);
- scoped_refptr<cc::DisplayItemList> displayList = recordPaintChunk(paintArtifact, paintChunk, combinedBounds);
- OwnPtr<ContentLayerClientImpl> contentLayerClient = adoptPtr(
- new ContentLayerClientImpl(std::move(displayList), gfx::Rect(combinedBounds.size())));
-
- // Include the offset in the transform, because it needs to apply in
- // this layer's transform space (whereas layer position applies in its
- // parent's transform space).
- gfx::Vector2dF offset = gfx::PointF(combinedBounds.origin()).OffsetFromOrigin();
- if (const auto* clip = paintChunk.properties.clip.get()) {
- // If a clip was applied, its origin needs to be cancelled out in
- // this transform.
- FloatPoint offsetDueToClipOffset = clip->clipRect().rect().location();
- offset -= gfx::Vector2dF(offsetDueToClipOffset.x(), offsetDueToClipOffset.y());
+ m_contentLayerClients.append(contentLayerClient.release());
+ parent->AddChild(std::move(layer));
}
- transform.Translate(offset.x(), offset.y());
-
- scoped_refptr<cc::PictureLayer> layer = cc::PictureLayer::Create(cc::LayerSettings(), contentLayerClient.get());
- layer->SetBounds(combinedBounds.size());
- layer->SetTransform(transform);
- layer->SetIsDrawable(true);
- layer->SetDoubleSided(!paintChunk.properties.backfaceHidden);
- if (paintChunk.knownToBeOpaque)
- layer->SetContentsOpaque(true);
- m_contentLayerClients.append(contentLayerClient.release());
- return layer;
}
-
} // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.h b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.h
index 7872785..358c3be 100644
--- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.h
+++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.h
@@ -15,15 +15,10 @@ namespace cc {
class Layer;
}
-namespace gfx {
-class Transform;
-}
-
namespace blink {
class PaintArtifact;
class WebLayer;
-struct PaintChunk;
// Responsible for managing compositing in terms of a PaintArtifact.
//
@@ -52,9 +47,6 @@ public:
private:
class ContentLayerClientImpl;
- // Builds a leaf layer that represents a single paint chunk.
- scoped_refptr<cc::Layer> layerForPaintChunk(const PaintArtifact&, const PaintChunk&, gfx::Transform);
-
scoped_refptr<cc::Layer> m_rootLayer;
OwnPtr<WebLayer> m_webLayer;
Vector<OwnPtr<ContentLayerClientImpl>> m_contentLayerClients;
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp
index 0ca76e9..5def30a 100644
--- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp
@@ -5,7 +5,6 @@
#include "platform/graphics/compositing/PaintArtifactCompositor.h"
#include "cc/layers/layer.h"
-#include "cc/layers/layer_settings.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/graphics/paint/PaintArtifact.h"
#include "platform/testing/PictureMatchers.h"
@@ -307,20 +306,5 @@ TEST_F(PaintArtifactCompositorTest, SiblingClips)
}
}
-TEST_F(PaintArtifactCompositorTest, ForeignLayerPassesThrough)
-{
- scoped_refptr<cc::Layer> layer = cc::Layer::Create(cc::LayerSettings());
-
- TestPaintArtifact artifact;
- artifact.chunk(PaintChunkProperties())
- .foreignLayer(FloatPoint(50, 100), IntSize(400, 300), layer);
- update(artifact.build());
-
- ASSERT_EQ(1u, rootLayer()->children().size());
- EXPECT_EQ(layer, rootLayer()->child_at(0));
- EXPECT_EQ(gfx::Size(400, 300), layer->bounds());
- EXPECT_EQ(translation(50, 100), layer->transform());
-}
-
} // namespace
} // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/paint/DisplayItem.cpp b/third_party/WebKit/Source/platform/graphics/paint/DisplayItem.cpp
index e92c387..775c7a3 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/DisplayItem.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/DisplayItem.cpp
@@ -122,14 +122,6 @@ static WTF::String drawingTypeAsDebugString(DisplayItem::Type type)
return "Drawing" + specialDrawingTypeAsDebugString(type);
}
-static String foreignLayerTypeAsDebugString(DisplayItem::Type type)
-{
- switch (type) {
- DEBUG_STRING_CASE(ForeignLayerPlugin);
- DEFAULT_CASE;
- }
-}
-
static WTF::String clipTypeAsDebugString(DisplayItem::Type type)
{
PAINT_PHASE_BASED_DEBUG_STRINGS(ClipBox);
@@ -179,10 +171,6 @@ WTF::String DisplayItem::typeAsDebugString(Type type)
return drawingTypeAsDebugString(type);
if (isCachedDrawingType(type))
return "Cached" + drawingTypeAsDebugString(cachedDrawingTypeToDrawingType(type));
-
- if (isForeignLayerType(type))
- return foreignLayerTypeAsDebugString(type);
-
if (isClipType(type))
return clipTypeAsDebugString(type);
if (isEndClipType(type))
diff --git a/third_party/WebKit/Source/platform/graphics/paint/DisplayItem.h b/third_party/WebKit/Source/platform/graphics/paint/DisplayItem.h
index 73e6e84..fc44e8e 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/DisplayItem.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/DisplayItem.h
@@ -113,10 +113,6 @@ public:
CachedDrawingFirst,
CachedDrawingLast = CachedDrawingFirst + DrawingLast - DrawingFirst,
- ForeignLayerFirst,
- ForeignLayerPlugin = ForeignLayerFirst,
- ForeignLayerLast = ForeignLayerPlugin,
-
ClipFirst,
ClipBoxPaintPhaseFirst = ClipFirst,
ClipBoxPaintPhaseLast = ClipBoxPaintPhaseFirst + PaintPhaseMax,
@@ -306,8 +302,6 @@ public:
DEFINE_CATEGORY_METHODS(CachedDrawing)
DEFINE_CONVERSION_METHODS(Drawing, drawing, CachedDrawing, cachedDrawing)
- DEFINE_CATEGORY_METHODS(ForeignLayer)
-
DEFINE_PAIRED_CATEGORY_METHODS(Clip, clip)
DEFINE_PAINT_PHASE_CONVERSION_METHOD(ClipLayerFragment)
DEFINE_PAINT_PHASE_CONVERSION_METHOD(ClipBox)
diff --git a/third_party/WebKit/Source/platform/graphics/paint/ForeignLayerDisplayItem.cpp b/third_party/WebKit/Source/platform/graphics/paint/ForeignLayerDisplayItem.cpp
deleted file mode 100644
index a08876b..0000000
--- a/third_party/WebKit/Source/platform/graphics/paint/ForeignLayerDisplayItem.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "platform/graphics/paint/ForeignLayerDisplayItem.h"
-
-#include "cc/layers/layer.h"
-#include "platform/graphics/GraphicsContext.h"
-#include "platform/graphics/paint/PaintController.h"
-#include "public/platform/WebLayer.h"
-#include "wtf/Assertions.h"
-#include <utility>
-
-namespace blink {
-
-ForeignLayerDisplayItem::ForeignLayerDisplayItem(
- const DisplayItemClient& client, Type type,
- scoped_refptr<cc::Layer> layer,
- const FloatPoint& location, const IntSize& bounds)
- : DisplayItem(client, type, sizeof(*this))
- , m_layer(std::move(layer))
- , m_location(location)
- , m_bounds(bounds)
-{
- ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
- ASSERT(isForeignLayerType(type));
- ASSERT(m_layer);
-}
-
-ForeignLayerDisplayItem::~ForeignLayerDisplayItem()
-{
-}
-
-void ForeignLayerDisplayItem::replay(GraphicsContext&) const
-{
- ASSERT_NOT_REACHED();
-}
-
-void ForeignLayerDisplayItem::appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const
-{
- ASSERT_NOT_REACHED();
-}
-
-bool ForeignLayerDisplayItem::drawsContent() const
-{
- return true;
-}
-
-#if ENABLE(ASSERT)
-bool ForeignLayerDisplayItem::equals(const DisplayItem& other) const
-{
- return DisplayItem::equals(other)
- && m_layer == static_cast<const ForeignLayerDisplayItem&>(other).m_layer;
-}
-#endif // ENABLE(ASSERT)
-
-#ifndef NDEBUG
-void ForeignLayerDisplayItem::dumpPropertiesAsDebugString(StringBuilder& stringBuilder) const
-{
- DisplayItem::dumpPropertiesAsDebugString(stringBuilder);
- stringBuilder.append(String::format(", layer: %d", m_layer->id()));
-}
-#endif // NDEBUG
-
-void recordForeignLayer(GraphicsContext& context,
- const DisplayItemClient& client, DisplayItem::Type type,
- WebLayer* webLayer, const FloatPoint& location, const IntSize& bounds)
-{
- PaintController& paintController = context.paintController();
- if (paintController.displayItemConstructionIsDisabled())
- return;
-
- paintController.createAndAppend<ForeignLayerDisplayItem>(client, type, webLayer->ccLayer(), location, bounds);
-}
-
-} // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/paint/ForeignLayerDisplayItem.h b/third_party/WebKit/Source/platform/graphics/paint/ForeignLayerDisplayItem.h
deleted file mode 100644
index 715d0ec..0000000
--- a/third_party/WebKit/Source/platform/graphics/paint/ForeignLayerDisplayItem.h
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef ForeignLayerDisplayItem_h
-#define ForeignLayerDisplayItem_h
-
-#include "base/memory/ref_counted.h"
-#include "platform/PlatformExport.h"
-#include "platform/RuntimeEnabledFeatures.h"
-#include "platform/graphics/paint/DisplayItem.h"
-
-namespace cc {
-class Layer;
-}
-
-namespace blink {
-
-class GraphicsContext;
-class WebLayer;
-
-// Represents foreign content (produced outside Blink) which draws to a layer.
-// A client supplies a layer which can be unwrapped and inserted into the full
-// layer tree.
-//
-// Before SPv2, this content is not painted, but is instead inserted into the
-// GraphicsLayer tree.
-class PLATFORM_EXPORT ForeignLayerDisplayItem final : public DisplayItem {
-public:
- ForeignLayerDisplayItem(
- const DisplayItemClient&, Type,
- scoped_refptr<cc::Layer>,
- const FloatPoint& location,
- const IntSize& bounds);
- ~ForeignLayerDisplayItem();
-
- cc::Layer* layer() const { return m_layer.get(); }
- const FloatPoint& location() const { return m_location; }
- const IntSize& bounds() const { return m_bounds; }
-
- // DisplayItem
- void replay(GraphicsContext&) const override;
- void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const override;
- bool drawsContent() const override;
-#if ENABLE(ASSERT)
- bool equals(const DisplayItem&) const override;
-#endif
-#ifndef NDEBUG
- void dumpPropertiesAsDebugString(StringBuilder&) const override;
-#endif
-
-private:
- scoped_refptr<cc::Layer> m_layer;
- FloatPoint m_location;
- IntSize m_bounds;
-};
-
-// Records a foreign layer into a GraphicsContext.
-// Use this where you would use a recorder class.
-PLATFORM_EXPORT void recordForeignLayer(
- GraphicsContext&, const DisplayItemClient&, DisplayItem::Type,
- WebLayer*, const FloatPoint& location, const IntSize& bounds);
-
-} // namespace blink
-
-#endif // ForeignLayerDisplayItem_h
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintChunk.h b/third_party/WebKit/Source/platform/graphics/paint/PaintChunk.h
index bafb829..add21e8 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintChunk.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintChunk.h
@@ -24,12 +24,6 @@ struct PaintChunk {
PaintChunk(unsigned begin, unsigned end, const PaintChunkProperties& props)
: beginIndex(begin), endIndex(end), properties(props), knownToBeOpaque(false) { }
- unsigned size() const
- {
- ASSERT(endIndex >= beginIndex);
- return endIndex - beginIndex;
- }
-
// Index of the first drawing in this chunk.
unsigned beginIndex;
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.cpp
index 485ec00..9fc9cb0 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.cpp
@@ -23,29 +23,24 @@ void PaintChunker::updateCurrentPaintChunkProperties(const PaintChunkProperties&
m_currentProperties = properties;
}
-void PaintChunker::incrementDisplayItemIndex(ItemBehavior behavior)
+void PaintChunker::incrementDisplayItemIndex()
{
ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
if (m_chunks.isEmpty()) {
PaintChunk newChunk(0, 1, m_currentProperties);
m_chunks.append(newChunk);
- m_chunkBehavior.append(behavior);
return;
}
auto& lastChunk = m_chunks.last();
- bool canContinueChunk = m_currentProperties == lastChunk.properties
- && behavior != RequiresSeparateChunk
- && m_chunkBehavior.last() != RequiresSeparateChunk;
- if (canContinueChunk) {
+ if (m_currentProperties == lastChunk.properties) {
lastChunk.endIndex++;
return;
}
PaintChunk newChunk(lastChunk.endIndex, lastChunk.endIndex + 1, m_currentProperties);
m_chunks.append(newChunk);
- m_chunkBehavior.append(behavior);
}
void PaintChunker::decrementDisplayItemIndex()
@@ -54,18 +49,15 @@ void PaintChunker::decrementDisplayItemIndex()
ASSERT(!m_chunks.isEmpty());
auto& lastChunk = m_chunks.last();
- if ((lastChunk.endIndex - lastChunk.beginIndex) > 1) {
+ if ((lastChunk.endIndex - lastChunk.beginIndex) > 1)
lastChunk.endIndex--;
- } else {
+ else
m_chunks.removeLast();
- m_chunkBehavior.removeLast();
- }
}
void PaintChunker::clear()
{
m_chunks.clear();
- m_chunkBehavior.clear();
m_currentProperties = PaintChunkProperties();
}
@@ -73,7 +65,6 @@ Vector<PaintChunk> PaintChunker::releasePaintChunks()
{
Vector<PaintChunk> chunks;
chunks.swap(m_chunks);
- m_chunkBehavior.clear();
m_currentProperties = PaintChunkProperties();
return chunks;
}
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.h b/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.h
index 2bf85b9..ef86714 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.h
@@ -21,14 +21,6 @@ class PLATFORM_EXPORT PaintChunker final {
DISALLOW_NEW();
WTF_MAKE_NONCOPYABLE(PaintChunker);
public:
- enum ItemBehavior {
- // Can be combined with adjacent items when building chunks.
- DefaultBehavior = 0,
-
- // Item requires its own paint chunk.
- RequiresSeparateChunk,
- };
-
PaintChunker();
~PaintChunker();
@@ -37,7 +29,7 @@ public:
const PaintChunkProperties& currentPaintChunkProperties() const { return m_currentProperties; }
void updateCurrentPaintChunkProperties(const PaintChunkProperties&);
- void incrementDisplayItemIndex(ItemBehavior);
+ void incrementDisplayItemIndex();
void decrementDisplayItemIndex();
void clear();
@@ -48,7 +40,6 @@ public:
private:
Vector<PaintChunk> m_chunks;
- Vector<ItemBehavior> m_chunkBehavior;
PaintChunkProperties m_currentProperties;
};
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintChunkerTest.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintChunkerTest.cpp
index 4d03798..e6821e5 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintChunkerTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintChunkerTest.cpp
@@ -41,8 +41,8 @@ TEST_F(PaintChunkerTest, SingleNonEmptyRange)
{
PaintChunker chunker;
chunker.updateCurrentPaintChunkProperties(rootPaintChunkProperties());
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
+ chunker.incrementDisplayItemIndex();
+ chunker.incrementDisplayItemIndex();
Vector<PaintChunk> chunks = chunker.releasePaintChunks();
EXPECT_THAT(chunks, ElementsAre(
@@ -53,10 +53,10 @@ TEST_F(PaintChunkerTest, SamePropertiesTwiceCombineIntoOneChunk)
{
PaintChunker chunker;
chunker.updateCurrentPaintChunkProperties(rootPaintChunkProperties());
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
+ chunker.incrementDisplayItemIndex();
+ chunker.incrementDisplayItemIndex();
chunker.updateCurrentPaintChunkProperties(rootPaintChunkProperties());
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
+ chunker.incrementDisplayItemIndex();
Vector<PaintChunk> chunks = chunker.releasePaintChunks();
EXPECT_THAT(chunks, ElementsAre(
@@ -67,10 +67,10 @@ TEST_F(PaintChunkerTest, CanRewindDisplayItemIndex)
{
PaintChunker chunker;
chunker.updateCurrentPaintChunkProperties(rootPaintChunkProperties());
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
+ chunker.incrementDisplayItemIndex();
+ chunker.incrementDisplayItemIndex();
chunker.decrementDisplayItemIndex();
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
+ chunker.incrementDisplayItemIndex();
Vector<PaintChunk> chunks = chunker.releasePaintChunks();
EXPECT_THAT(chunks, ElementsAre(
@@ -81,19 +81,19 @@ TEST_F(PaintChunkerTest, BuildMultipleChunksWithSinglePropertyChanging)
{
PaintChunker chunker;
chunker.updateCurrentPaintChunkProperties(rootPaintChunkProperties());
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
+ chunker.incrementDisplayItemIndex();
+ chunker.incrementDisplayItemIndex();
PaintChunkProperties simpleTransform;
simpleTransform.transform = TransformPaintPropertyNode::create(TransformationMatrix(0, 1, 2, 3, 4, 5), FloatPoint3D(9, 8, 7));
chunker.updateCurrentPaintChunkProperties(simpleTransform);
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
+ chunker.incrementDisplayItemIndex();
PaintChunkProperties anotherTransform;
anotherTransform.transform = TransformPaintPropertyNode::create(TransformationMatrix(0, 1, 2, 3, 4, 5), FloatPoint3D(9, 8, 7));
chunker.updateCurrentPaintChunkProperties(anotherTransform);
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
+ chunker.incrementDisplayItemIndex();
Vector<PaintChunk> chunks = chunker.releasePaintChunks();
@@ -107,32 +107,32 @@ TEST_F(PaintChunkerTest, BuildMultipleChunksWithDifferentPropertyChanges)
{
PaintChunker chunker;
chunker.updateCurrentPaintChunkProperties(rootPaintChunkProperties());
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
+ chunker.incrementDisplayItemIndex();
PaintChunkProperties simpleTransform;
simpleTransform.transform = TransformPaintPropertyNode::create(TransformationMatrix(0, 0, 0, 0, 0, 0), FloatPoint3D(9, 8, 7));
chunker.updateCurrentPaintChunkProperties(simpleTransform);
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
+ chunker.incrementDisplayItemIndex();
+ chunker.incrementDisplayItemIndex();
PaintChunkProperties simpleTransformAndEffect;
simpleTransformAndEffect.transform = simpleTransform.transform;
simpleTransformAndEffect.effect = EffectPaintPropertyNode::create(0.5f);
chunker.updateCurrentPaintChunkProperties(simpleTransformAndEffect);
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
+ chunker.incrementDisplayItemIndex();
+ chunker.incrementDisplayItemIndex();
PaintChunkProperties simpleTransformAndEffectWithUpdatedTransform;
simpleTransformAndEffectWithUpdatedTransform.transform = TransformPaintPropertyNode::create(TransformationMatrix(1, 1, 0, 0, 0, 0), FloatPoint3D(9, 8, 7));
simpleTransformAndEffectWithUpdatedTransform.effect = EffectPaintPropertyNode::create(simpleTransformAndEffect.effect->opacity());
chunker.updateCurrentPaintChunkProperties(simpleTransformAndEffectWithUpdatedTransform);
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
+ chunker.incrementDisplayItemIndex();
+ chunker.incrementDisplayItemIndex();
// Test that going back to a previous chunk property still creates a new chunk.
chunker.updateCurrentPaintChunkProperties(simpleTransformAndEffect);
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
+ chunker.incrementDisplayItemIndex();
+ chunker.incrementDisplayItemIndex();
Vector<PaintChunk> chunks = chunker.releasePaintChunks();
@@ -151,16 +151,16 @@ TEST_F(PaintChunkerTest, BuildChunksFromNestedTransforms)
// <root xform>, <paint>, <a xform>, <paint>, <paint>, </a xform>, <paint>, </root xform>
PaintChunker chunker;
chunker.updateCurrentPaintChunkProperties(rootPaintChunkProperties());
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
+ chunker.incrementDisplayItemIndex();
PaintChunkProperties simpleTransform;
simpleTransform.transform = TransformPaintPropertyNode::create(TransformationMatrix(0, 1, 2, 3, 4, 5), FloatPoint3D(9, 8, 7));
chunker.updateCurrentPaintChunkProperties(simpleTransform);
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
+ chunker.incrementDisplayItemIndex();
+ chunker.incrementDisplayItemIndex();
chunker.updateCurrentPaintChunkProperties(rootPaintChunkProperties());
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
+ chunker.incrementDisplayItemIndex();
Vector<PaintChunk> chunks = chunker.releasePaintChunks();
@@ -175,7 +175,7 @@ TEST_F(PaintChunkerTest, ChangingPropertiesWithoutItems)
// Test that properties can change without display items being generated.
PaintChunker chunker;
chunker.updateCurrentPaintChunkProperties(rootPaintChunkProperties());
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
+ chunker.incrementDisplayItemIndex();
PaintChunkProperties firstTransform;
firstTransform.transform = TransformPaintPropertyNode::create(TransformationMatrix(0, 1, 2, 3, 4, 5), FloatPoint3D(9, 8, 7));
@@ -185,7 +185,7 @@ TEST_F(PaintChunkerTest, ChangingPropertiesWithoutItems)
secondTransform.transform = TransformPaintPropertyNode::create(TransformationMatrix(9, 8, 7, 6, 5, 4), FloatPoint3D(3, 2, 1));
chunker.updateCurrentPaintChunkProperties(secondTransform);
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
+ chunker.incrementDisplayItemIndex();
Vector<PaintChunk> chunks = chunker.releasePaintChunks();
EXPECT_THAT(chunks, ElementsAre(
@@ -193,35 +193,5 @@ TEST_F(PaintChunkerTest, ChangingPropertiesWithoutItems)
PaintChunk(1, 2, secondTransform)));
}
-TEST_F(PaintChunkerTest, CreatesSeparateChunksWhenRequested)
-{
- // Tests that the chunker creates a separate chunks for display items which
- // require it.
- PaintChunker chunker;
- chunker.updateCurrentPaintChunkProperties(rootPaintChunkProperties());
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
- chunker.incrementDisplayItemIndex(PaintChunker::RequiresSeparateChunk);
- chunker.incrementDisplayItemIndex(PaintChunker::RequiresSeparateChunk);
- chunker.incrementDisplayItemIndex(PaintChunker::RequiresSeparateChunk);
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
- chunker.incrementDisplayItemIndex(PaintChunker::RequiresSeparateChunk);
- chunker.incrementDisplayItemIndex(PaintChunker::RequiresSeparateChunk);
- chunker.decrementDisplayItemIndex();
- chunker.decrementDisplayItemIndex();
- chunker.decrementDisplayItemIndex();
- chunker.incrementDisplayItemIndex(PaintChunker::DefaultBehavior);
- chunker.incrementDisplayItemIndex(PaintChunker::RequiresSeparateChunk);
-
- Vector<PaintChunk> chunks = chunker.releasePaintChunks();
- EXPECT_THAT(chunks, ElementsAre(
- PaintChunk(0, 1, rootPaintChunkProperties()),
- PaintChunk(1, 2, rootPaintChunkProperties()),
- PaintChunk(2, 3, rootPaintChunkProperties()),
- PaintChunk(3, 4, rootPaintChunkProperties()),
- PaintChunk(4, 6, rootPaintChunkProperties()),
- PaintChunk(6, 7, rootPaintChunkProperties())));
-}
-
} // namespace
} // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp
index b3aa411..0ef0044 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp
@@ -17,13 +17,6 @@
namespace blink {
-static PaintChunker::ItemBehavior behaviorOfItemType(DisplayItem::Type type)
-{
- if (DisplayItem::isForeignLayerType(type))
- return PaintChunker::RequiresSeparateChunk;
- return PaintChunker::DefaultBehavior;
-}
-
const PaintArtifact& PaintController::paintArtifact() const
{
ASSERT(m_newDisplayItemList.isEmpty());
@@ -97,7 +90,7 @@ void PaintController::processNewItem(DisplayItem& displayItem)
displayItem.setSkippedCache();
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled())
- m_newPaintChunks.incrementDisplayItemIndex(behaviorOfItemType(displayItem.getType()));
+ m_newPaintChunks.incrementDisplayItemIndex();
}
void PaintController::updateCurrentPaintChunkProperties(const PaintChunkProperties& newProperties)
diff --git a/third_party/WebKit/Source/platform/graphics/paint/README.md b/third_party/WebKit/Source/platform/graphics/paint/README.md
index 5e5fb62..4b29640 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/README.md
+++ b/third_party/WebKit/Source/platform/graphics/paint/README.md
@@ -147,13 +147,6 @@ See [Display item caching](../../../core/paint/README.md#paint-result-caching).
Holds an `SkPicture` which contains the Skia commands required to draw some atom
of content.
-#### [ForeignLayerDisplayItem](ForeignLayerDisplayItem.h)
-
-Draws an atom of content, but using a `cc::Layer` produced by some agent outside
-of the normal Blink paint system (for example, a plugin). Since they always map
-to a `cc::Layer`, they are always the only display item in their paint chunk,
-and are ineligible for squashing with other layers.
-
### Paired begin/end display items
*** aside
diff --git a/third_party/WebKit/Source/platform/testing/DEPS b/third_party/WebKit/Source/platform/testing/DEPS
index fd466b7..378d13a 100644
--- a/third_party/WebKit/Source/platform/testing/DEPS
+++ b/third_party/WebKit/Source/platform/testing/DEPS
@@ -5,8 +5,6 @@ include_rules = [
"+base/path_service.h",
"+base/message_loop",
"+base/test/test_io_thread.h",
- "+cc",
- "-cc/blink",
"+mojo/edk/embedder",
"+mojo/edk/test",
]
diff --git a/third_party/WebKit/Source/platform/testing/TestPaintArtifact.cpp b/third_party/WebKit/Source/platform/testing/TestPaintArtifact.cpp
index f15badd..ea199b5 100644
--- a/third_party/WebKit/Source/platform/testing/TestPaintArtifact.cpp
+++ b/third_party/WebKit/Source/platform/testing/TestPaintArtifact.cpp
@@ -4,10 +4,8 @@
#include "platform/testing/TestPaintArtifact.h"
-#include "cc/layers/layer.h"
#include "platform/graphics/paint/DisplayItemClient.h"
#include "platform/graphics/paint/DrawingDisplayItem.h"
-#include "platform/graphics/paint/ForeignLayerDisplayItem.h"
#include "platform/graphics/paint/PaintArtifact.h"
#include "third_party/skia/include/core/SkPaint.h"
#include "third_party/skia/include/core/SkPicture.h"
@@ -79,16 +77,6 @@ TestPaintArtifact& TestPaintArtifact::rectDrawing(const FloatRect& bounds, Color
return *this;
}
-TestPaintArtifact& TestPaintArtifact::foreignLayer(const FloatPoint& location, const IntSize& size, scoped_refptr<cc::Layer> layer)
-{
- FloatRect floatBounds(location, FloatSize(size));
- OwnPtr<DummyRectClient> client = adoptPtr(new DummyRectClient(floatBounds, Color::transparent));
- m_displayItemList.allocateAndConstruct<ForeignLayerDisplayItem>(
- *client, DisplayItem::ForeignLayerFirst, std::move(layer), location, size);
- m_dummyClients.append(client.release());
- return *this;
-}
-
const PaintArtifact& TestPaintArtifact::build()
{
if (m_built)
diff --git a/third_party/WebKit/Source/platform/testing/TestPaintArtifact.h b/third_party/WebKit/Source/platform/testing/TestPaintArtifact.h
index e621e9d..1ecff36 100644
--- a/third_party/WebKit/Source/platform/testing/TestPaintArtifact.h
+++ b/third_party/WebKit/Source/platform/testing/TestPaintArtifact.h
@@ -5,7 +5,6 @@
#ifndef TestPaintArtifact_h
#define TestPaintArtifact_h
-#include "base/memory/ref_counted.h"
#include "platform/graphics/Color.h"
#include "platform/graphics/paint/DisplayItemList.h"
#include "platform/graphics/paint/PaintArtifact.h"
@@ -14,10 +13,6 @@
#include "wtf/PassRefPtr.h"
#include "wtf/Vector.h"
-namespace cc {
-class Layer;
-}
-
namespace blink {
class ClipPaintPropertyNode;
@@ -48,7 +43,6 @@ public:
TestPaintArtifact& chunk(PassRefPtr<TransformPaintPropertyNode>, PassRefPtr<ClipPaintPropertyNode>, PassRefPtr<EffectPaintPropertyNode>);
TestPaintArtifact& chunk(const PaintChunkProperties&);
TestPaintArtifact& rectDrawing(const FloatRect& bounds, Color);
- TestPaintArtifact& foreignLayer(const FloatPoint&, const IntSize&, scoped_refptr<cc::Layer>);
// Can't add more things once this is called.
const PaintArtifact& build();
diff --git a/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp b/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp
index 94cb44c..55f508c 100644
--- a/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp
+++ b/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp
@@ -67,14 +67,12 @@
#include "platform/HostWindow.h"
#include "platform/KeyboardCodes.h"
#include "platform/PlatformGestureEvent.h"
-#include "platform/RuntimeEnabledFeatures.h"
#include "platform/UserGestureIndicator.h"
#include "platform/exported/WrappedResourceResponse.h"
#include "platform/geometry/LayoutRect.h"
#include "platform/graphics/GraphicsContext.h"
#include "platform/graphics/GraphicsLayer.h"
#include "platform/graphics/paint/CullRect.h"
-#include "platform/graphics/paint/ForeignLayerDisplayItem.h"
#include "platform/scroll/ScrollAnimatorBase.h"
#include "platform/scroll/ScrollbarTheme.h"
#include "public/platform/Platform.h"
@@ -124,15 +122,6 @@ void WebPluginContainerImpl::paint(GraphicsContext& context, const CullRect& cul
if (!cullRect.intersectsCullRect(frameRect()))
return;
- if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && m_webLayer) {
- // With Slimming Paint v2, composited plugins should have their layers
- // inserted rather than invoking WebPlugin::paint.
- recordForeignLayer(
- context, *m_element->layoutObject(), DisplayItem::ForeignLayerPlugin,
- m_webLayer, location(), size());
- return;
- }
-
if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(context, *m_element->layoutObject(), DisplayItem::Type::WebPlugin, LayoutPoint()))
return;
diff --git a/third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp b/third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp
index e2dc25c..9cfc1b2 100644
--- a/third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp
@@ -32,19 +32,12 @@
#include "core/dom/Element.h"
#include "core/events/KeyboardEvent.h"
-#include "core/layout/LayoutObject.h"
#include "platform/PlatformEvent.h"
#include "platform/PlatformKeyboardEvent.h"
-#include "platform/graphics/GraphicsContext.h"
-#include "platform/graphics/paint/CullRect.h"
-#include "platform/graphics/paint/ForeignLayerDisplayItem.h"
-#include "platform/graphics/paint/PaintController.h"
#include "platform/testing/URLTestHelpers.h"
#include "platform/testing/UnitTestHelpers.h"
#include "public/platform/Platform.h"
#include "public/platform/WebClipboard.h"
-#include "public/platform/WebCompositorSupport.h"
-#include "public/platform/WebLayer.h"
#include "public/platform/WebThread.h"
#include "public/platform/WebUnitTestSupport.h"
#include "public/web/WebDocument.h"
@@ -88,17 +81,6 @@ protected:
std::string m_baseURL;
};
-namespace {
-
-template <typename T>
-class CustomPluginWebFrameClient : public FrameTestHelpers::TestWebFrameClient {
-public:
- WebPlugin* createPlugin(WebLocalFrame* frame, const WebPluginParams& params) override
- {
- return new T(frame, params);
- }
-};
-
class TestPluginWebFrameClient;
// Subclass of FakeWebPlugin that has a selection of 'x' as plain text and 'y' as markup text.
@@ -149,8 +131,6 @@ WebPluginContainer* getWebPluginContainer(WebView* webView, const WebString& id)
return element.pluginContainer();
}
-} // namespace
-
TEST_F(WebPluginContainerTest, WindowToLocalPointTest)
{
URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8("plugin_container.html"));
@@ -368,12 +348,21 @@ private:
WebInputEvent::Type m_lastEventType;
};
+class EventTestPluginWebFrameClient : public FrameTestHelpers::TestWebFrameClient {
+ WebPlugin* createPlugin(WebLocalFrame* frame, const WebPluginParams& params) override
+ {
+ if (params.mimeType == WebString::fromUTF8("application/x-webkit-test-webplugin"))
+ return new EventTestPlugin(frame, params);
+ return WebFrameClient::createPlugin(frame, params);
+ }
+};
+
TEST_F(WebPluginContainerTest, GestureLongPressReachesPlugin)
{
URLTestHelpers::registerMockedURLFromBaseURL(
WebString::fromUTF8(m_baseURL.c_str()),
WebString::fromUTF8("plugin_container.html"));
- CustomPluginWebFrameClient<EventTestPlugin> pluginWebFrameClient; // Must outlive webViewHelper.
+ EventTestPluginWebFrameClient pluginWebFrameClient; // Must outlive webViewHelper.
FrameTestHelpers::WebViewHelper webViewHelper;
WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "plugin_container.html", true, &pluginWebFrameClient);
ASSERT(webView);
@@ -532,8 +521,15 @@ TEST_F(WebPluginContainerTest, TopmostAfterDetachTest)
}
};
+ class TopmostPluginWebFrameClient : public FrameTestHelpers::TestWebFrameClient {
+ WebPlugin* createPlugin(WebLocalFrame* frame, const WebPluginParams& params) override
+ {
+ return new TopmostPlugin(frame, params);
+ }
+ };
+
URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8("plugin_container.html"));
- CustomPluginWebFrameClient<TopmostPlugin> pluginWebFrameClient; // Must outlive webViewHelper.
+ TopmostPluginWebFrameClient pluginWebFrameClient; // Must outlive webViewHelper.
FrameTestHelpers::WebViewHelper webViewHelper;
WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "plugin_container.html", true, &pluginWebFrameClient);
ASSERT(webView);
@@ -557,77 +553,4 @@ TEST_F(WebPluginContainerTest, TopmostAfterDetachTest)
EXPECT_FALSE(pluginContainerImpl->isRectTopmost(topmostRect));
}
-namespace {
-
-class CompositedPlugin : public FakeWebPlugin {
-public:
- CompositedPlugin(WebLocalFrame* frame, const WebPluginParams& params)
- : FakeWebPlugin(frame, params)
- , m_layer(adoptPtr(Platform::current()->compositorSupport()->createLayer()))
- {
- }
-
- WebLayer* webLayer() const { return m_layer.get(); }
-
- // WebPlugin
-
- bool initialize(WebPluginContainer* container) override
- {
- if (!FakeWebPlugin::initialize(container))
- return false;
- container->setWebLayer(m_layer.get());
- return true;
- }
-
- void destroy() override
- {
- container()->setWebLayer(nullptr);
- FakeWebPlugin::destroy();
- }
-
-private:
- OwnPtr<WebLayer> m_layer;
-};
-
-class ScopedSPv2 {
-public:
- ScopedSPv2() { RuntimeEnabledFeatures::setSlimmingPaintV2Enabled(true); }
- ~ScopedSPv2() { m_featuresBackup.restore(); }
-private:
- RuntimeEnabledFeatures::Backup m_featuresBackup;
-};
-
-} // namespace
-
-TEST_F(WebPluginContainerTest, CompositedPluginSPv2)
-{
- ScopedSPv2 enableSPv2;
- URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8("plugin.html"));
- CustomPluginWebFrameClient<CompositedPlugin> webFrameClient;
- FrameTestHelpers::WebViewHelper webViewHelper;
- WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "plugin.html", true, &webFrameClient);
- ASSERT_TRUE(webView);
- webView->settings()->setPluginsEnabled(true);
- webView->resize(WebSize(800, 600));
- webView->updateAllLifecyclePhases();
- runPendingTasks();
-
- WebPluginContainerImpl* container = static_cast<WebPluginContainerImpl*>(getWebPluginContainer(webView, WebString::fromUTF8("plugin")));
- ASSERT_TRUE(container);
- RefPtrWillBeRawPtr<Element> element = static_cast<PassRefPtrWillBeRawPtr<Element>>(container->element());
- const auto* plugin = static_cast<const CompositedPlugin*>(container->plugin());
-
- OwnPtr<PaintController> paintController = PaintController::create();
- GraphicsContext graphicsContext(*paintController);
- container->paint(graphicsContext, CullRect(IntRect(10, 10, 400, 300)));
- paintController->commitNewDisplayItems();
-
- const auto& displayItems = paintController->paintArtifact().displayItemList();
- ASSERT_EQ(1u, displayItems.size());
- EXPECT_EQ(element->layoutObject(), &displayItems[0].client());
- ASSERT_EQ(DisplayItem::ForeignLayerPlugin, displayItems[0].getType());
- const auto& foreignLayerDisplayItem = static_cast<const ForeignLayerDisplayItem&>(displayItems[0]);
- EXPECT_EQ(plugin->webLayer()->ccLayer(), foreignLayerDisplayItem.layer());
-}
-
} // namespace blink
diff --git a/third_party/WebKit/Source/web/tests/data/plugin.html b/third_party/WebKit/Source/web/tests/data/plugin.html
deleted file mode 100644
index 6ca41b6..0000000
--- a/third_party/WebKit/Source/web/tests/data/plugin.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<!DOCTYPE html>
-<style>
-html, body { margin: 10px; padding: 0; }
-</style>
-<object id="plugin" type="application/x-webkit-test-webplugin"
- width="400" height="300">
-</object>
diff --git a/third_party/WebKit/public/platform/WebLayer.h b/third_party/WebKit/public/platform/WebLayer.h
index f38144e..51c8619 100644
--- a/third_party/WebKit/public/platform/WebLayer.h
+++ b/third_party/WebKit/public/platform/WebLayer.h
@@ -240,7 +240,6 @@ public:
// Gets the underlying cc layer.
virtual const cc::Layer* ccLayer() const = 0;
- virtual cc::Layer* ccLayer() = 0;
virtual void setElementId(uint64_t) = 0;
virtual uint64_t elementId() const = 0;