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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gfx/canvas_direct2d.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <windows.h> 5 #include <windows.h>
6 #include <uxtheme.h> 6 #include <uxtheme.h>
7 #include <vsstyle.h> 7 #include <vsstyle.h>
8 #include <vssym32.h> 8 #include <vssym32.h>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 canvas.FillRectInt(SK_ColorBLUE, 0, 0, 500, 500); 174 canvas.FillRectInt(SK_ColorBLUE, 0, 0, 500, 500);
175 canvas.Restore(); 175 canvas.Restore();
176 176
177 // ... then translate, clip and fill again relative to the new origin. 177 // ... then translate, clip and fill again relative to the new origin.
178 canvas.Save(); 178 canvas.Save();
179 canvas.TranslateInt(150, 150); 179 canvas.TranslateInt(150, 150);
180 canvas.ClipRectInt(10, 10, 110, 110); 180 canvas.ClipRectInt(10, 10, 110, 110);
181 canvas.FillRectInt(SK_ColorRED, 0, 0, 500, 500); 181 canvas.FillRectInt(SK_ColorRED, 0, 0, 500, 500);
182 canvas.Restore(); 182 canvas.Restore();
183 } 183 }
184
185 TEST(CanvasDirect2D, ClipRectWithScale) {
186 TestWindow window;
187 gfx::CanvasDirect2D canvas(window.rt());
188
189 // Repeat the same rendering as in ClipRect...
190 canvas.Save();
191 canvas.FillRectInt(SK_ColorGREEN, 0, 0, 500, 500);
192 canvas.ClipRectInt(20, 20, 120, 120);
193 canvas.FillRectInt(SK_ColorBLUE, 0, 0, 500, 500);
194 canvas.Restore();
195
196 // ... then translate and scale, clip and fill again relative to the new
197 // origin.
198 canvas.Save();
199 canvas.TranslateInt(150, 150);
200 canvas.ScaleInt(2, 2);
201 canvas.ClipRectInt(10, 10, 110, 110);
202 canvas.FillRectInt(SK_ColorRED, 0, 0, 500, 500);
203 canvas.Restore();
204 }
OLDNEW
« 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