mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Remove some dead filters related code.
R=abarth@chromium.org Review URL: https://codereview.chromium.org/943333005
This commit is contained in:
parent
5a5460c54e
commit
82ab56a89b
@ -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<RenderLayer*>(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
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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<Order>(inherited_flags.m_rtlOrdering); }
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -64,7 +64,6 @@ public:
|
||||
|
||||
bool canInterpolateWith(const FilterOperations&) const;
|
||||
|
||||
bool hasOutsets() const;
|
||||
FilterOutsets outsets() const;
|
||||
|
||||
bool hasFilterThatMovesPixels() const;
|
||||
|
||||
@ -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 <gtest/gtest.h>
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user