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

Unified Diff: third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp

Issue 1805823002: [SPv2] Fix PaintArtifactCompositor clip layer origin undo order (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/compositing/PaintArtifactCompositor.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/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 999cac3373e060be24ab82f621d838a668f77e91..30050b7a3ba2e398252645f7e439b6c885c8d2a7 100644
--- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp
@@ -144,6 +144,34 @@ TEST_F(PaintArtifactCompositorTest, TransformCombining)
}
}
+TEST_F(PaintArtifactCompositorTest, LayerOriginCancellation)
+{
+ RefPtr<ClipPaintPropertyNode> clip = ClipPaintPropertyNode::create(
+ nullptr, FloatRoundedRect(100, 100, 100, 100));
+ RefPtr<TransformPaintPropertyNode> transform = TransformPaintPropertyNode::create(
+ TransformationMatrix().scale(2), FloatPoint3D());
+
+ TestPaintArtifact artifact;
+ artifact.chunk(transform, clip, nullptr)
+ .rectDrawing(FloatRect(12, 34, 56, 78), Color::white);
+ update(artifact.build());
+
+ ASSERT_EQ(1u, rootLayer()->children().size());
+ cc::Layer* clipLayer = rootLayer()->child_at(0);
+ EXPECT_EQ(gfx::Size(100, 100), clipLayer->bounds());
+ EXPECT_EQ(translation(100, 100), clipLayer->transform());
+ EXPECT_TRUE(clipLayer->masks_to_bounds());
+
+ ASSERT_EQ(1u, clipLayer->children().size());
+ cc::Layer* layer = clipLayer->child_at(0);
+ EXPECT_EQ(gfx::Size(56, 78), layer->bounds());
+ gfx::Transform expectedTransform;
+ expectedTransform.Translate(-100, -100);
+ expectedTransform.Scale(2, 2);
+ expectedTransform.Translate(12, 34);
+ EXPECT_EQ(expectedTransform, layer->transform());
+}
+
TEST_F(PaintArtifactCompositorTest, OneClip)
{
RefPtr<ClipPaintPropertyNode> clip = ClipPaintPropertyNode::create(
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698