diff --git a/engine/core/rendering/RenderLayer.cpp b/engine/core/rendering/RenderLayer.cpp index cfee2f11f7c1adeac177a11d5b5d311d0080c52f..cc978cac2fd94b4329b639b32f9d3d133da34f84 100644 --- a/engine/core/rendering/RenderLayer.cpp +++ b/engine/core/rendering/RenderLayer.cpp @@ -389,27 +389,6 @@ const RenderLayer* RenderLayer::compositingContainer() const return 0; } -RenderLayer* RenderLayer::enclosingFilterLayer(IncludeSelfOrNot includeSelf) const -{ - const RenderLayer* curr = (includeSelf == IncludeSelf) ? this : parent(); - for (; curr; curr = curr->parent()) { - if (curr->requiresFullLayerImageForFilters()) - return const_cast(curr); - } - - return 0; -} - -bool RenderLayer::hasAncestorWithFilterOutsets() const -{ - for (const RenderLayer* curr = this; curr; curr = curr->parent()) { - RenderBox* renderer = curr->renderer(); - if (renderer->style()->hasFilterOutsets()) - return true; - } - return false; -} - enum TransparencyClipBoxBehavior { PaintingTransparencyClipBox, HitTestingTransparencyClipBox diff --git a/engine/core/rendering/RenderLayer.h b/engine/core/rendering/RenderLayer.h index 5742a77673e8f1412b0eb1344fc818d1741c1727..061a0007ed9197431f2da64120a326d630476ca8 100644 --- a/engine/core/rendering/RenderLayer.h +++ b/engine/core/rendering/RenderLayer.h @@ -138,8 +138,6 @@ public: RenderLayer* enclosingOverflowClipLayer(IncludeSelfOrNot = IncludeSelf) const; const RenderLayer* compositingContainer() const; - RenderLayer* enclosingFilterLayer(IncludeSelfOrNot = IncludeSelf) const; - bool hasAncestorWithFilterOutsets() const; void convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutPoint&) const; void convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutRect&) const; diff --git a/engine/core/rendering/style/RenderStyle.h b/engine/core/rendering/style/RenderStyle.h index 438658d8885c81bf38b99c8b0fc40ff5b3f47803..2c6c3621dfa354f8a21521286a592a25ac415766 100644 --- a/engine/core/rendering/style/RenderStyle.h +++ b/engine/core/rendering/style/RenderStyle.h @@ -343,7 +343,6 @@ public: return imageOutsets(borderImage()); } - bool hasFilterOutsets() const { return hasFilter() && filter().hasOutsets(); } FilterOutsets filterOutsets() const { return hasFilter() ? filter().outsets() : FilterOutsets(); } Order rtlOrdering() const { return static_cast(inherited_flags.m_rtlOrdering); } diff --git a/engine/platform/BUILD.gn b/engine/platform/BUILD.gn index 1e26a8be84c201c9b37a9705411f28f91d1cdf63..13585a2e7c24b34b9ad7eb5bc35fb76515e3c856 100644 --- a/engine/platform/BUILD.gn +++ b/engine/platform/BUILD.gn @@ -675,7 +675,6 @@ test("platform_unittests") { "geometry/RoundedRectTest.cpp", "graphics/GraphicsContextTest.cpp", "graphics/ThreadSafeDataTransportTest.cpp", - "graphics/filters/FilterOperationsTest.cpp", "graphics/filters/ImageFilterBuilderTest.cpp", "graphics/gpu/DrawingBufferTest.cpp", "image-decoders/ImageDecoderTest.cpp", diff --git a/engine/platform/graphics/filters/FilterOperations.cpp b/engine/platform/graphics/filters/FilterOperations.cpp index e393c5bf0ebbaa6129d16b7e58d896df751ca754..4f6acb7c2dbdddeae15d5867004e369dcf1cd690 100644 --- a/engine/platform/graphics/filters/FilterOperations.cpp +++ b/engine/platform/graphics/filters/FilterOperations.cpp @@ -97,16 +97,6 @@ bool FilterOperations::hasReferenceFilter() const return false; } -bool FilterOperations::hasOutsets() const -{ - for (size_t i = 0; i < m_operations.size(); ++i) { - FilterOperation::OperationType operationType = m_operations.at(i)->type(); - if (operationType == FilterOperation::BLUR || operationType == FilterOperation::DROP_SHADOW || operationType == FilterOperation::REFERENCE) - return true; - } - return false; -} - FilterOutsets FilterOperations::outsets() const { FilterOutsets totalOutsets; diff --git a/engine/platform/graphics/filters/FilterOperations.h b/engine/platform/graphics/filters/FilterOperations.h index b216d60ace0c0725c2332b449f3c9b27c60b1b38..3caa4fd397dcde49fd08fefd3eb1aa0af40b1540 100644 --- a/engine/platform/graphics/filters/FilterOperations.h +++ b/engine/platform/graphics/filters/FilterOperations.h @@ -64,7 +64,6 @@ public: bool canInterpolateWith(const FilterOperations&) const; - bool hasOutsets() const; FilterOutsets outsets() const; bool hasFilterThatMovesPixels() const; diff --git a/engine/platform/graphics/filters/FilterOperationsTest.cpp b/engine/platform/graphics/filters/FilterOperationsTest.cpp deleted file mode 100644 index 58604f4a118a0ba7efe29cf988157f95d20c6a24..0000000000000000000000000000000000000000 --- a/engine/platform/graphics/filters/FilterOperationsTest.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2012 Google 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 AND ITS CONTRIBUTORS "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 OR ITS 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 "sky/engine/config.h" -#include "sky/engine/platform/graphics/filters/FilterOperations.h" - -#include - -using namespace blink; - -namespace { - -TEST(FilterOperationsTest, getOutsetsBlur) -{ - FilterOperations ops; - ops.operations().append(BlurFilterOperation::create(Length(20.0, Fixed))); - EXPECT_TRUE(ops.hasOutsets()); - FilterOutsets outsets = ops.outsets(); - EXPECT_EQ(57, outsets.top()); - EXPECT_EQ(57, outsets.right()); - EXPECT_EQ(57, outsets.bottom()); - EXPECT_EQ(57, outsets.left()); -} - -TEST(FilterOperationsTest, getOutsetsDropShadow) -{ - FilterOperations ops; - ops.operations().append(DropShadowFilterOperation::create(IntPoint(3, 8), 20, Color(1, 2, 3))); - EXPECT_TRUE(ops.hasOutsets()); - FilterOutsets outsets = ops.outsets(); - EXPECT_EQ(49, outsets.top()); - EXPECT_EQ(60, outsets.right()); - EXPECT_EQ(65, outsets.bottom()); - EXPECT_EQ(54, outsets.left()); -} - -} -