Index: third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp |
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp |
index f51287bff20eaafbfe1ad90ff58ec56b9f6be4f3..4640c2775ee800661feec79171a07a6b2c3096f1 100644 |
--- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp |
+++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp |
@@ -9,11 +9,9 @@ |
#include "cc/layers/layer.h" |
#include "cc/test/fake_output_surface.h" |
#include "cc/trees/clip_node.h" |
-#include "cc/trees/effect_node.h" |
#include "cc/trees/layer_tree_host.h" |
#include "cc/trees/layer_tree_settings.h" |
#include "platform/RuntimeEnabledFeatures.h" |
-#include "platform/graphics/paint/EffectPaintPropertyNode.h" |
#include "platform/graphics/paint/PaintArtifact.h" |
#include "platform/testing/PictureMatchers.h" |
#include "platform/testing/TestPaintArtifact.h" |
@@ -35,12 +33,6 @@ |
return transform; |
} |
-EffectPaintPropertyNode* dummyRootEffect() |
-{ |
- DEFINE_STATIC_REF(EffectPaintPropertyNode, node, EffectPaintPropertyNode::create(1.0)); |
- return node; |
-} |
- |
class PaintArtifactCompositorTest : public ::testing::Test { |
protected: |
void SetUp() override |
@@ -105,11 +97,11 @@ |
TransformationMatrix().rotate(90), FloatPoint3D(100, 100, 0)); |
TestPaintArtifact artifact; |
- artifact.chunk(transform, nullptr, dummyRootEffect()) |
+ artifact.chunk(transform, nullptr, nullptr) |
.rectDrawing(FloatRect(0, 0, 100, 100), Color::white); |
- artifact.chunk(nullptr, nullptr, dummyRootEffect()) |
+ artifact.chunk(nullptr, nullptr, nullptr) |
.rectDrawing(FloatRect(0, 0, 100, 100), Color::gray); |
- artifact.chunk(transform, nullptr, dummyRootEffect()) |
+ artifact.chunk(transform, nullptr, nullptr) |
.rectDrawing(FloatRect(100, 100, 200, 100), Color::black); |
update(artifact.build()); |
@@ -147,9 +139,9 @@ |
TransformationMatrix().translate(5, 5), FloatPoint3D(), transform1); |
TestPaintArtifact artifact; |
- artifact.chunk(transform1, nullptr, dummyRootEffect()) |
+ artifact.chunk(transform1, nullptr, nullptr) |
.rectDrawing(FloatRect(0, 0, 300, 200), Color::white); |
- artifact.chunk(transform2, nullptr, dummyRootEffect()) |
+ artifact.chunk(transform2, nullptr, nullptr) |
.rectDrawing(FloatRect(0, 0, 300, 200), Color::black); |
update(artifact.build()); |
@@ -231,13 +223,13 @@ |
nullptr, FloatRoundedRect(200, 200, 700, 100), clip1); |
TestPaintArtifact artifact; |
- artifact.chunk(nullptr, clip1, dummyRootEffect()) |
+ artifact.chunk(nullptr, clip1, nullptr) |
.rectDrawing(FloatRect(300, 350, 100, 100), Color::white); |
- artifact.chunk(nullptr, clip2, dummyRootEffect()) |
+ artifact.chunk(nullptr, clip2, nullptr) |
.rectDrawing(FloatRect(300, 350, 100, 100), Color::lightGray); |
- artifact.chunk(nullptr, clip1, dummyRootEffect()) |
+ artifact.chunk(nullptr, clip1, nullptr) |
.rectDrawing(FloatRect(300, 350, 100, 100), Color::darkGray); |
- artifact.chunk(nullptr, clip2, dummyRootEffect()) |
+ artifact.chunk(nullptr, clip2, nullptr) |
.rectDrawing(FloatRect(300, 350, 100, 100), Color::black); |
update(artifact.build()); |
@@ -457,11 +449,11 @@ |
TransformationMatrix().rotate(90), FloatPoint3D(100, 100, 0)); |
TestPaintArtifact artifact; |
- artifact.chunk(transform, nullptr, dummyRootEffect()) |
+ artifact.chunk(transform, nullptr, nullptr) |
.rectDrawing(FloatRect(0, 0, 100, 100), Color::white); |
- artifact.chunk(nullptr, nullptr, dummyRootEffect()) |
+ artifact.chunk(nullptr, nullptr, nullptr) |
.rectDrawing(FloatRect(0, 0, 100, 100), Color::gray); |
- artifact.chunk(transform, nullptr, dummyRootEffect()) |
+ artifact.chunk(transform, nullptr, nullptr) |
.rectDrawing(FloatRect(100, 100, 200, 100), Color::black); |
update(artifact.build()); |
@@ -499,9 +491,9 @@ |
TransformationMatrix().translate(5, 5), FloatPoint3D(), transform1); |
TestPaintArtifact artifact; |
- artifact.chunk(transform1, nullptr, dummyRootEffect()) |
+ artifact.chunk(transform1, nullptr, nullptr) |
.rectDrawing(FloatRect(0, 0, 300, 200), Color::white); |
- artifact.chunk(transform2, nullptr, dummyRootEffect()) |
+ artifact.chunk(transform2, nullptr, nullptr) |
.rectDrawing(FloatRect(0, 0, 300, 200), Color::black); |
update(artifact.build()); |
@@ -557,13 +549,13 @@ |
nullptr, FloatRoundedRect(200, 200, 700, 100), clip1); |
TestPaintArtifact artifact; |
- artifact.chunk(nullptr, clip1, dummyRootEffect()) |
+ artifact.chunk(nullptr, clip1, nullptr) |
.rectDrawing(FloatRect(300, 350, 100, 100), Color::white); |
- artifact.chunk(nullptr, clip2, dummyRootEffect()) |
+ artifact.chunk(nullptr, clip2, nullptr) |
.rectDrawing(FloatRect(300, 350, 100, 100), Color::lightGray); |
- artifact.chunk(nullptr, clip1, dummyRootEffect()) |
+ artifact.chunk(nullptr, clip1, nullptr) |
.rectDrawing(FloatRect(300, 350, 100, 100), Color::darkGray); |
- artifact.chunk(nullptr, clip2, dummyRootEffect()) |
+ artifact.chunk(nullptr, clip2, nullptr) |
.rectDrawing(FloatRect(300, 350, 100, 100), Color::black); |
update(artifact.build()); |
@@ -613,7 +605,7 @@ |
} |
TestPaintArtifact artifact; |
- artifact.chunk(nullptr, clips.last(), dummyRootEffect()) |
+ artifact.chunk(nullptr, clips.last(), nullptr) |
.rectDrawing(FloatRect(0, 0, 200, 200), Color::white); |
update(artifact.build()); |
@@ -645,9 +637,9 @@ |
nullptr, FloatRoundedRect(400, 0, 400, 600), commonClip); |
TestPaintArtifact artifact; |
- artifact.chunk(nullptr, clip1, dummyRootEffect()) |
+ artifact.chunk(nullptr, clip1, nullptr) |
.rectDrawing(FloatRect(0, 0, 640, 480), Color::white); |
- artifact.chunk(nullptr, clip2, dummyRootEffect()) |
+ artifact.chunk(nullptr, clip2, nullptr) |
.rectDrawing(FloatRect(0, 0, 640, 480), Color::black); |
update(artifact.build()); |
@@ -693,47 +685,5 @@ |
EXPECT_EQ(translation(50, 100), layer->screen_space_transform()); |
} |
-TEST_F(PaintArtifactCompositorTestWithPropertyTrees, EffectTreeConversion) |
-{ |
- RefPtr<EffectPaintPropertyNode> effect1 = EffectPaintPropertyNode::create(0.5, dummyRootEffect()); |
- RefPtr<EffectPaintPropertyNode> effect2 = EffectPaintPropertyNode::create(0.3, effect1.get()); |
- RefPtr<EffectPaintPropertyNode> effect3 = EffectPaintPropertyNode::create(0.2, dummyRootEffect()); |
- |
- TestPaintArtifact artifact; |
- artifact.chunk(nullptr, nullptr, effect2.get()) |
- .rectDrawing(FloatRect(0, 0, 100, 100), Color::white); |
- artifact.chunk(nullptr, nullptr, effect1.get()) |
- .rectDrawing(FloatRect(0, 0, 100, 100), Color::white); |
- artifact.chunk(nullptr, nullptr, effect3.get()) |
- .rectDrawing(FloatRect(0, 0, 100, 100), Color::white); |
- update(artifact.build()); |
- |
- ASSERT_EQ(3u, contentLayerCount()); |
- |
- const cc::EffectTree& effectTree = propertyTrees().effect_tree; |
- // Node #0 reserved for null; #1 for root render surface; #2 for dummyRootEffect, |
- // plus 3 nodes for those created by this test. |
- ASSERT_EQ(6u, effectTree.size()); |
- |
- const cc::EffectNode& convertedDummyRootEffect = *effectTree.Node(2); |
- EXPECT_EQ(1, convertedDummyRootEffect.parent_id); |
- |
- const cc::EffectNode& convertedEffect1 = *effectTree.Node(3); |
- EXPECT_EQ(convertedDummyRootEffect.id, convertedEffect1.parent_id); |
- EXPECT_FLOAT_EQ(0.5, convertedEffect1.opacity); |
- |
- const cc::EffectNode& convertedEffect2 = *effectTree.Node(4); |
- EXPECT_EQ(convertedEffect1.id, convertedEffect2.parent_id); |
- EXPECT_FLOAT_EQ(0.3, convertedEffect2.opacity); |
- |
- const cc::EffectNode& convertedEffect3 = *effectTree.Node(5); |
- EXPECT_EQ(convertedDummyRootEffect.id, convertedEffect3.parent_id); |
- EXPECT_FLOAT_EQ(0.2, convertedEffect3.opacity); |
- |
- EXPECT_EQ(convertedEffect2.id, contentLayerAt(0)->effect_tree_index()); |
- EXPECT_EQ(convertedEffect1.id, contentLayerAt(1)->effect_tree_index()); |
- EXPECT_EQ(convertedEffect3.id, contentLayerAt(2)->effect_tree_index()); |
-} |
- |
} // namespace |
} // namespace blink |