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(); |
+} |