OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
7 #include "ui/gfx/canvas.h" | 7 #include "ui/gfx/canvas.h" |
8 #include "ui/gfx/canvas_skia_paint.h" | 8 #include "ui/gfx/canvas_skia_paint.h" |
9 #include "ui/gfx/rect.h" | 9 #include "ui/gfx/geometry/rect.h" |
10 | 10 |
11 namespace gfx { | 11 namespace gfx { |
12 | 12 |
13 CanvasSkiaPaint::CanvasSkiaPaint(HWND hwnd, HDC dc, const PAINTSTRUCT& ps) | 13 CanvasSkiaPaint::CanvasSkiaPaint(HWND hwnd, HDC dc, const PAINTSTRUCT& ps) |
14 : hwnd_(hwnd), | 14 : hwnd_(hwnd), |
15 paint_dc_(dc) { | 15 paint_dc_(dc) { |
16 memset(&ps_, 0, sizeof(ps_)); | 16 memset(&ps_, 0, sizeof(ps_)); |
17 ps_.rcPaint.left = ps.rcPaint.left; | 17 ps_.rcPaint.left = ps.rcPaint.left; |
18 ps_.rcPaint.right = ps.rcPaint.right; | 18 ps_.rcPaint.right = ps.rcPaint.right; |
19 ps_.rcPaint.top = ps.rcPaint.top; | 19 ps_.rcPaint.top = ps.rcPaint.top; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 canvas->clear(SkColorSetARGB(0, 0, 0, 0)); | 61 canvas->clear(SkColorSetARGB(0, 0, 0, 0)); |
62 | 62 |
63 // This will bring the canvas into the screen coordinate system for the | 63 // This will bring the canvas into the screen coordinate system for the |
64 // dirty rect | 64 // dirty rect |
65 canvas->translate( | 65 canvas->translate( |
66 -ps_.rcPaint.left / gfx::GetDPIScale(), | 66 -ps_.rcPaint.left / gfx::GetDPIScale(), |
67 -ps_.rcPaint.top / gfx::GetDPIScale()); | 67 -ps_.rcPaint.top / gfx::GetDPIScale()); |
68 } | 68 } |
69 | 69 |
70 } // namespace gfx | 70 } // namespace gfx |
OLD | NEW |