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

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

Issue 674763002: remove ui::gfx::GetDeviceScaleFactor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dpi-cleanup-3
Patch Set: rebase-4 Created 6 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
« no previous file with comments | « ui/base/layout.cc ('k') | ui/gfx/screen_win.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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 } 48 }
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), gfx::GetDPIScale(), opaque);
59 gfx::win::GetDeviceScaleFactor(),
60 opaque);
61 skia::PlatformCanvas* canvas = platform_canvas(); 59 skia::PlatformCanvas* canvas = platform_canvas();
62 60
63 canvas->clear(SkColorSetARGB(0, 0, 0, 0)); 61 canvas->clear(SkColorSetARGB(0, 0, 0, 0));
64 62
65 // 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
66 // dirty rect 64 // dirty rect
67 canvas->translate( 65 canvas->translate(
68 -ps_.rcPaint.left / gfx::win::GetDeviceScaleFactor(), 66 -ps_.rcPaint.left / gfx::GetDPIScale(),
69 -ps_.rcPaint.top / gfx::win::GetDeviceScaleFactor()); 67 -ps_.rcPaint.top / gfx::GetDPIScale());
70 } 68 }
71 69
72 } // namespace gfx 70 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/base/layout.cc ('k') | ui/gfx/screen_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698