Index: third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp |
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp |
index 334d67b0ec18c6497f44a2c0e25d80cd7a6f612b..5fa6b16bb62bd61708bfa341615e5e8958406028 100644 |
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp |
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp |
@@ -22,6 +22,31 @@ using testing::UnorderedElementsAre; |
namespace blink { |
+namespace { |
+TransformPaintPropertyNode* dummyRootTransform() { |
+ DEFINE_STATIC_REF(TransformPaintPropertyNode, rootTransform, |
+ (TransformPaintPropertyNode::create( |
+ nullptr, TransformationMatrix(), FloatPoint3D()))); |
+ return rootTransform; |
+} |
+ |
+ClipPaintPropertyNode* dummyRootClip() { |
+ DEFINE_STATIC_REF(ClipPaintPropertyNode, rootClip, |
+ (ClipPaintPropertyNode::create( |
+ nullptr, dummyRootTransform(), |
+ FloatRoundedRect(LayoutRect::infiniteIntRect())))); |
+ return rootClip; |
+} |
+ |
+EffectPaintPropertyNode* dummyRootEffect() { |
+ DEFINE_STATIC_REF(EffectPaintPropertyNode, rootEffect, |
+ (EffectPaintPropertyNode::create( |
+ nullptr, dummyRootTransform(), dummyRootClip(), |
+ CompositorFilterOperations(), 1.0))); |
+ return rootEffect; |
+} |
+} // namespace |
+ |
class PaintControllerTestBase : public testing::Test { |
public: |
PaintControllerTestBase() : m_paintController(PaintController::create()) {} |
@@ -1019,8 +1044,9 @@ TEST_P(PaintControllerTest, CachedSubsequenceSwapOrder) { |
{ |
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
PaintChunk::Id id(container1, backgroundDrawingType); |
- container1Properties.effect = |
- EffectPaintPropertyNode::create(nullptr, 0.5); |
+ container1Properties.effect = EffectPaintPropertyNode::create( |
+ dummyRootEffect(), dummyRootTransform(), dummyRootClip(), |
+ CompositorFilterOperations(), 0.5); |
getPaintController().updateCurrentPaintChunkProperties( |
&id, container1Properties); |
} |
@@ -1037,8 +1063,9 @@ TEST_P(PaintControllerTest, CachedSubsequenceSwapOrder) { |
{ |
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
PaintChunk::Id id(container2, backgroundDrawingType); |
- container2Properties.effect = |
- EffectPaintPropertyNode::create(nullptr, 0.5); |
+ container2Properties.effect = EffectPaintPropertyNode::create( |
+ dummyRootEffect(), dummyRootTransform(), dummyRootClip(), |
+ CompositorFilterOperations(), 0.5); |
getPaintController().updateCurrentPaintChunkProperties( |
&id, container2Properties); |
} |
@@ -1189,8 +1216,9 @@ TEST_P(PaintControllerTest, UpdateSwapOrderCrossingChunks) { |
{ |
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
PaintChunk::Id id(container1, backgroundDrawingType); |
- container1Properties.effect = |
- EffectPaintPropertyNode::create(nullptr, 0.5); |
+ container1Properties.effect = EffectPaintPropertyNode::create( |
+ dummyRootEffect(), dummyRootTransform(), dummyRootClip(), |
+ CompositorFilterOperations(), 0.5); |
getPaintController().updateCurrentPaintChunkProperties( |
&id, container1Properties); |
} |
@@ -1202,8 +1230,9 @@ TEST_P(PaintControllerTest, UpdateSwapOrderCrossingChunks) { |
{ |
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
PaintChunk::Id id(container2, backgroundDrawingType); |
- container2Properties.effect = |
- EffectPaintPropertyNode::create(nullptr, 0.5); |
+ container2Properties.effect = EffectPaintPropertyNode::create( |
+ dummyRootEffect(), dummyRootTransform(), dummyRootClip(), |
+ CompositorFilterOperations(), 0.5); |
getPaintController().updateCurrentPaintChunkProperties( |
&id, container2Properties); |
} |
@@ -1326,8 +1355,9 @@ TEST_P(PaintControllerTest, CachedNestedSubsequenceUpdate) { |
{ |
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
PaintChunk::Id id(container1, backgroundDrawingType); |
- container1BackgroundProperties.effect = |
- EffectPaintPropertyNode::create(nullptr, 0.5); |
+ container1BackgroundProperties.effect = EffectPaintPropertyNode::create( |
+ dummyRootEffect(), dummyRootTransform(), dummyRootClip(), |
+ CompositorFilterOperations(), 0.5); |
getPaintController().updateCurrentPaintChunkProperties( |
&id, container1BackgroundProperties); |
} |
@@ -1337,8 +1367,9 @@ TEST_P(PaintControllerTest, CachedNestedSubsequenceUpdate) { |
{ |
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
PaintChunk::Id id(content1, backgroundDrawingType); |
- content1Properties.effect = |
- EffectPaintPropertyNode::create(nullptr, 0.6); |
+ content1Properties.effect = EffectPaintPropertyNode::create( |
+ dummyRootEffect(), dummyRootTransform(), dummyRootClip(), |
+ CompositorFilterOperations(), 0.6); |
getPaintController().updateCurrentPaintChunkProperties( |
&id, content1Properties); |
} |
@@ -1350,8 +1381,9 @@ TEST_P(PaintControllerTest, CachedNestedSubsequenceUpdate) { |
} |
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
PaintChunk::Id id(container1, foregroundDrawingType); |
- container1ForegroundProperties.effect = |
- EffectPaintPropertyNode::create(nullptr, 0.5); |
+ container1ForegroundProperties.effect = EffectPaintPropertyNode::create( |
+ dummyRootEffect(), dummyRootTransform(), dummyRootClip(), |
+ CompositorFilterOperations(), 0.5); |
getPaintController().updateCurrentPaintChunkProperties( |
&id, container1ForegroundProperties); |
} |
@@ -1361,8 +1393,9 @@ TEST_P(PaintControllerTest, CachedNestedSubsequenceUpdate) { |
{ |
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
PaintChunk::Id id(container2, backgroundDrawingType); |
- container2BackgroundProperties.effect = |
- EffectPaintPropertyNode::create(nullptr, 0.7); |
+ container2BackgroundProperties.effect = EffectPaintPropertyNode::create( |
+ dummyRootEffect(), dummyRootTransform(), dummyRootClip(), |
+ CompositorFilterOperations(), 0.7); |
getPaintController().updateCurrentPaintChunkProperties( |
&id, container2BackgroundProperties); |
} |
@@ -1372,8 +1405,9 @@ TEST_P(PaintControllerTest, CachedNestedSubsequenceUpdate) { |
{ |
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
PaintChunk::Id id(content2, backgroundDrawingType); |
- content2Properties.effect = |
- EffectPaintPropertyNode::create(nullptr, 0.8); |
+ content2Properties.effect = EffectPaintPropertyNode::create( |
+ dummyRootEffect(), dummyRootTransform(), dummyRootClip(), |
+ CompositorFilterOperations(), 0.8); |
getPaintController().updateCurrentPaintChunkProperties( |
&id, content2Properties); |
} |