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

Side by Side Diff: ui/gfx/canvas_direct2d_unittest.cc

Issue 8363036: ui/gfx: Change Canvas::ScaleInt() to just Canvas::Scale(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address Peter's review Created 9 years, 1 month 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 | « ui/gfx/canvas_direct2d.cc ('k') | ui/gfx/canvas_skia.h » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 canvas.Save(); 255 canvas.Save();
256 canvas.FillRectInt(SK_ColorGREEN, 0, 0, 500, 500); 256 canvas.FillRectInt(SK_ColorGREEN, 0, 0, 500, 500);
257 canvas.ClipRect(gfx::Rect(20, 20, 120, 120)); 257 canvas.ClipRect(gfx::Rect(20, 20, 120, 120));
258 canvas.FillRectInt(SK_ColorBLUE, 0, 0, 500, 500); 258 canvas.FillRectInt(SK_ColorBLUE, 0, 0, 500, 500);
259 canvas.Restore(); 259 canvas.Restore();
260 260
261 // ... then translate and scale, clip and fill again relative to the new 261 // ... then translate and scale, clip and fill again relative to the new
262 // origin. 262 // origin.
263 canvas.Save(); 263 canvas.Save();
264 canvas.Translate(gfx::Point(150, 150)); 264 canvas.Translate(gfx::Point(150, 150));
265 canvas.ScaleInt(2, 2); 265 canvas.Scale(2, 2);
266 canvas.ClipRect(gfx::Rect(10, 10, 110, 110)); 266 canvas.ClipRect(gfx::Rect(10, 10, 110, 110));
267 canvas.FillRectInt(SK_ColorRED, 0, 0, 500, 500); 267 canvas.FillRectInt(SK_ColorRED, 0, 0, 500, 500);
268 canvas.Restore(); 268 canvas.Restore();
269 } 269 }
270 270
271 TEST(CanvasDirect2D, DrawRectInt) { 271 TEST(CanvasDirect2D, DrawRectInt) {
272 if (!CheckForD2DCompatibility()) 272 if (!CheckForD2DCompatibility())
273 return; 273 return;
274 TestWindow window; 274 TestWindow window;
275 gfx::CanvasDirect2D canvas(window.rt()); 275 gfx::CanvasDirect2D canvas(window.rt());
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 return; 323 return;
324 TestWindow window; 324 TestWindow window;
325 gfx::CanvasDirect2D canvas(window.rt()); 325 gfx::CanvasDirect2D canvas(window.rt());
326 326
327 SkBitmap bitmap = LoadBitmapFromResources(IDR_BITMAP_BRUSH_IMAGE); 327 SkBitmap bitmap = LoadBitmapFromResources(IDR_BITMAP_BRUSH_IMAGE);
328 328
329 canvas.Save(); 329 canvas.Save();
330 canvas.TileImageInt(bitmap, 10, 10, 300, 300); 330 canvas.TileImageInt(bitmap, 10, 10, 300, 300);
331 canvas.Restore(); 331 canvas.Restore();
332 } 332 }
OLDNEW
« no previous file with comments | « ui/gfx/canvas_direct2d.cc ('k') | ui/gfx/canvas_skia.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698