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

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

Issue 2428513004: [SPv2] Create effect nodes for CSS filter (Closed)
Patch Set: remove DCHECK(layer) 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
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/paint/PaintChunkerTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/paint/PaintChunkerTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698