Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp

Issue 2428513004: [SPv2] Create effect nodes for CSS filter (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..2d8c30afcf30b587cad003966bfdd7593db6e46e 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
@@ -22,6 +22,29 @@ 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(), 1.0, CompositorFilterOperations())));
+ return rootEffect;
+}
+} // namespace
+
class PaintControllerTestBase : public testing::Test {
public:
PaintControllerTestBase() : m_paintController(PaintController::create()) {}
@@ -1020,7 +1043,7 @@ TEST_P(PaintControllerTest, CachedSubsequenceSwapOrder) {
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
PaintChunk::Id id(container1, backgroundDrawingType);
container1Properties.effect =
- EffectPaintPropertyNode::create(nullptr, 0.5);
+ EffectPaintPropertyNode::create(dummyRootEffect(), dummyRootTransform(), dummyRootClip(), 0.5, CompositorFilterOperations());
getPaintController().updateCurrentPaintChunkProperties(
&id, container1Properties);
}
@@ -1038,7 +1061,7 @@ TEST_P(PaintControllerTest, CachedSubsequenceSwapOrder) {
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
PaintChunk::Id id(container2, backgroundDrawingType);
container2Properties.effect =
- EffectPaintPropertyNode::create(nullptr, 0.5);
+ EffectPaintPropertyNode::create(dummyRootEffect(), dummyRootTransform(), dummyRootClip(), 0.5, CompositorFilterOperations());
getPaintController().updateCurrentPaintChunkProperties(
&id, container2Properties);
}
@@ -1190,7 +1213,7 @@ TEST_P(PaintControllerTest, UpdateSwapOrderCrossingChunks) {
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
PaintChunk::Id id(container1, backgroundDrawingType);
container1Properties.effect =
- EffectPaintPropertyNode::create(nullptr, 0.5);
+ EffectPaintPropertyNode::create(dummyRootEffect(), dummyRootTransform(), dummyRootClip(), 0.5, CompositorFilterOperations());
getPaintController().updateCurrentPaintChunkProperties(
&id, container1Properties);
}
@@ -1203,7 +1226,7 @@ TEST_P(PaintControllerTest, UpdateSwapOrderCrossingChunks) {
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
PaintChunk::Id id(container2, backgroundDrawingType);
container2Properties.effect =
- EffectPaintPropertyNode::create(nullptr, 0.5);
+ EffectPaintPropertyNode::create(dummyRootEffect(), dummyRootTransform(), dummyRootClip(), 0.5, CompositorFilterOperations());
getPaintController().updateCurrentPaintChunkProperties(
&id, container2Properties);
}
@@ -1327,7 +1350,7 @@ TEST_P(PaintControllerTest, CachedNestedSubsequenceUpdate) {
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
PaintChunk::Id id(container1, backgroundDrawingType);
container1BackgroundProperties.effect =
- EffectPaintPropertyNode::create(nullptr, 0.5);
+ EffectPaintPropertyNode::create(dummyRootEffect(), dummyRootTransform(), dummyRootClip(), 0.5, CompositorFilterOperations());
getPaintController().updateCurrentPaintChunkProperties(
&id, container1BackgroundProperties);
}
@@ -1338,7 +1361,7 @@ TEST_P(PaintControllerTest, CachedNestedSubsequenceUpdate) {
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
PaintChunk::Id id(content1, backgroundDrawingType);
content1Properties.effect =
- EffectPaintPropertyNode::create(nullptr, 0.6);
+ EffectPaintPropertyNode::create(dummyRootEffect(), dummyRootTransform(), dummyRootClip(), 0.6, CompositorFilterOperations());
getPaintController().updateCurrentPaintChunkProperties(
&id, content1Properties);
}
@@ -1351,7 +1374,7 @@ TEST_P(PaintControllerTest, CachedNestedSubsequenceUpdate) {
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
PaintChunk::Id id(container1, foregroundDrawingType);
container1ForegroundProperties.effect =
- EffectPaintPropertyNode::create(nullptr, 0.5);
+ EffectPaintPropertyNode::create(dummyRootEffect(), dummyRootTransform(), dummyRootClip(), 0.5, CompositorFilterOperations());
getPaintController().updateCurrentPaintChunkProperties(
&id, container1ForegroundProperties);
}
@@ -1362,7 +1385,7 @@ TEST_P(PaintControllerTest, CachedNestedSubsequenceUpdate) {
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
PaintChunk::Id id(container2, backgroundDrawingType);
container2BackgroundProperties.effect =
- EffectPaintPropertyNode::create(nullptr, 0.7);
+ EffectPaintPropertyNode::create(dummyRootEffect(), dummyRootTransform(), dummyRootClip(), 0.7, CompositorFilterOperations());
getPaintController().updateCurrentPaintChunkProperties(
&id, container2BackgroundProperties);
}
@@ -1373,7 +1396,7 @@ TEST_P(PaintControllerTest, CachedNestedSubsequenceUpdate) {
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
PaintChunk::Id id(content2, backgroundDrawingType);
content2Properties.effect =
- EffectPaintPropertyNode::create(nullptr, 0.8);
+ EffectPaintPropertyNode::create(dummyRootEffect(), dummyRootTransform(), dummyRootClip(), 0.8, CompositorFilterOperations());
getPaintController().updateCurrentPaintChunkProperties(
&id, content2Properties);
}

Powered by Google App Engine
This is Rietveld 408576698