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

Unified Diff: gfx/canvas_direct2d_unittest.cc

Issue 3025010: Fix transforms to be preconcat like skia so multiple transforms are accumulat... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 5 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 | « gfx/canvas_direct2d.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gfx/canvas_direct2d_unittest.cc
===================================================================
--- gfx/canvas_direct2d_unittest.cc (revision 53218)
+++ gfx/canvas_direct2d_unittest.cc (working copy)
@@ -181,3 +181,24 @@
canvas.FillRectInt(SK_ColorRED, 0, 0, 500, 500);
canvas.Restore();
}
+
+TEST(CanvasDirect2D, ClipRectWithScale) {
+ TestWindow window;
+ gfx::CanvasDirect2D canvas(window.rt());
+
+ // Repeat the same rendering as in ClipRect...
+ canvas.Save();
+ canvas.FillRectInt(SK_ColorGREEN, 0, 0, 500, 500);
+ canvas.ClipRectInt(20, 20, 120, 120);
+ canvas.FillRectInt(SK_ColorBLUE, 0, 0, 500, 500);
+ canvas.Restore();
+
+ // ... then translate and scale, clip and fill again relative to the new
+ // origin.
+ canvas.Save();
+ canvas.TranslateInt(150, 150);
+ canvas.ScaleInt(2, 2);
+ canvas.ClipRectInt(10, 10, 110, 110);
+ canvas.FillRectInt(SK_ColorRED, 0, 0, 500, 500);
+ canvas.Restore();
+}
« no previous file with comments | « gfx/canvas_direct2d.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698