| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |