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

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

Issue 24175004: Remove dependency on ui::ScaleFactor from ui/gfx (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix new usage of scale in FastShowPickler Created 7 years, 2 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 | « ui/gfx/canvas_paint_mac.mm ('k') | ui/gfx/canvas_skia.cc » ('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) 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/rect.h"
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 void CanvasSkiaPaint::Init(bool opaque) { 50 void CanvasSkiaPaint::Init(bool opaque) {
51 // FIXME(brettw) for ClearType, we probably want to expand the bounds of 51 // FIXME(brettw) for ClearType, we probably want to expand the bounds of
52 // painting by one pixel so that the boundaries will be correct (ClearType 52 // painting by one pixel so that the boundaries will be correct (ClearType
53 // text can depend on the adjacent pixel). Then we would paint just the 53 // text can depend on the adjacent pixel). Then we would paint just the
54 // inset pixels to the screen. 54 // inset pixels to the screen.
55 const int width = ps_.rcPaint.right - ps_.rcPaint.left; 55 const int width = ps_.rcPaint.right - ps_.rcPaint.left;
56 const int height = ps_.rcPaint.bottom - ps_.rcPaint.top; 56 const int height = ps_.rcPaint.bottom - ps_.rcPaint.top;
57 57
58 RecreateBackingCanvas(gfx::Size(width, height), 58 RecreateBackingCanvas(gfx::Size(width, height),
59 ui::GetScaleFactorFromScale(gfx::win::GetDeviceScaleFactor()), 59 gfx::win::GetDeviceScaleFactor(),
60 opaque); 60 opaque);
61 skia::PlatformCanvas* canvas = platform_canvas(); 61 skia::PlatformCanvas* canvas = platform_canvas();
62 62
63 canvas->clear(SkColorSetARGB(0, 0, 0, 0)); 63 canvas->clear(SkColorSetARGB(0, 0, 0, 0));
64 64
65 // This will bring the canvas into the screen coordinate system for the 65 // This will bring the canvas into the screen coordinate system for the
66 // dirty rect 66 // dirty rect
67 canvas->translate( 67 canvas->translate(
68 -ps_.rcPaint.left / gfx::win::GetDeviceScaleFactor(), 68 -ps_.rcPaint.left / gfx::win::GetDeviceScaleFactor(),
69 -ps_.rcPaint.top / gfx::win::GetDeviceScaleFactor()); 69 -ps_.rcPaint.top / gfx::win::GetDeviceScaleFactor());
70 } 70 }
71 71
72 } // namespace gfx 72 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/canvas_paint_mac.mm ('k') | ui/gfx/canvas_skia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698