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

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

Issue 2428513004: [SPv2] Create effect nodes for CSS filter (Closed)
Patch Set: address pdr's comment 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/PaintArtifactToSkCanvasTest.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintArtifactToSkCanvasTest.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintArtifactToSkCanvasTest.cpp
index d19462521bb2b0a334f19add0b30362d602b8536..3588b8e4093b3bee5316419ef1f25e0043d08a42 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintArtifactToSkCanvasTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintArtifactToSkCanvasTest.cpp
@@ -27,7 +27,30 @@ using testing::Property;
using testing::ResultOf;
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;
+}
static const int kCanvasWidth = 800;
static const int kCanvasHeight = 600;
@@ -148,9 +171,13 @@ TEST_F(PaintArtifactToSkCanvasTest, OpacityEffectsCombining) {
// Build an opacity effect tree.
RefPtr<EffectPaintPropertyNode> opacityEffect1 =
- EffectPaintPropertyNode::create(nullptr, 0.5);
+ EffectPaintPropertyNode::create(dummyRootEffect(), dummyRootTransform(),
+ dummyRootClip(),
+ CompositorFilterOperations(), 0.5);
RefPtr<EffectPaintPropertyNode> opacityEffect2 =
- EffectPaintPropertyNode::create(opacityEffect1, 0.25);
+ EffectPaintPropertyNode::create(opacityEffect1, dummyRootTransform(),
+ dummyRootClip(),
+ CompositorFilterOperations(), 0.25);
TestPaintArtifact artifact;
artifact.chunk(nullptr, nullptr, opacityEffect1.get())
@@ -187,13 +214,21 @@ TEST_F(PaintArtifactToSkCanvasTest, ChangingOpacityEffects) {
// | |
// 0.2 b d 0.4
RefPtr<EffectPaintPropertyNode> opacityEffectA =
- EffectPaintPropertyNode::create(nullptr, 0.1);
+ EffectPaintPropertyNode::create(dummyRootEffect(), dummyRootTransform(),
+ dummyRootClip(),
+ CompositorFilterOperations(), 0.1);
RefPtr<EffectPaintPropertyNode> opacityEffectB =
- EffectPaintPropertyNode::create(opacityEffectA, 0.2);
+ EffectPaintPropertyNode::create(opacityEffectA, dummyRootTransform(),
+ dummyRootClip(),
+ CompositorFilterOperations(), 0.2);
RefPtr<EffectPaintPropertyNode> opacityEffectC =
- EffectPaintPropertyNode::create(nullptr, 0.3);
+ EffectPaintPropertyNode::create(dummyRootEffect(), dummyRootTransform(),
+ dummyRootClip(),
+ CompositorFilterOperations(), 0.3);
RefPtr<EffectPaintPropertyNode> opacityEffectD =
- EffectPaintPropertyNode::create(opacityEffectC, 0.4);
+ EffectPaintPropertyNode::create(opacityEffectC, dummyRootTransform(),
+ dummyRootClip(),
+ CompositorFilterOperations(), 0.4);
// Build a two-chunk artifact directly.
// chunk1 references opacity node b, chunk2 references opacity node d.

Powered by Google App Engine
This is Rietveld 408576698