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

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

Issue 122443005: replace deprecated SkScalarRound/Floor/Ceil calls with more explicit variants (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | « skia/skia_common.gypi ('k') | ui/gfx/path_gtk.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 "ui/gfx/gdi_util.h" 5 #include "ui/gfx/gdi_util.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 9
10 namespace gfx { 10 namespace gfx {
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 } 78 }
79 } 79 }
80 80
81 HRGN ConvertPathToHRGN(const gfx::Path& path) { 81 HRGN ConvertPathToHRGN(const gfx::Path& path) {
82 #if defined(USE_AURA) 82 #if defined(USE_AURA)
83 int point_count = path.getPoints(NULL, 0); 83 int point_count = path.getPoints(NULL, 0);
84 scoped_ptr<SkPoint[]> points(new SkPoint[point_count]); 84 scoped_ptr<SkPoint[]> points(new SkPoint[point_count]);
85 path.getPoints(points.get(), point_count); 85 path.getPoints(points.get(), point_count);
86 scoped_ptr<POINT[]> windows_points(new POINT[point_count]); 86 scoped_ptr<POINT[]> windows_points(new POINT[point_count]);
87 for (int i = 0; i < point_count; ++i) { 87 for (int i = 0; i < point_count; ++i) {
88 windows_points[i].x = SkScalarRound(points[i].fX); 88 windows_points[i].x = SkScalarRoundToInt(points[i].fX);
89 windows_points[i].y = SkScalarRound(points[i].fY); 89 windows_points[i].y = SkScalarRoundToInt(points[i].fY);
90 } 90 }
91 91
92 return ::CreatePolygonRgn(windows_points.get(), point_count, ALTERNATE); 92 return ::CreatePolygonRgn(windows_points.get(), point_count, ALTERNATE);
93 #elif defined(OS_WIN) 93 #elif defined(OS_WIN)
94 return path.CreateNativeRegion(); 94 return path.CreateNativeRegion();
95 #endif 95 #endif
96 } 96 }
97 97
98 98
99 double CalculatePageScale(HDC dc, int page_width, int page_height) { 99 double CalculatePageScale(HDC dc, int page_width, int page_height) {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 } else { 136 } else {
137 rv = ::StretchDIBits(hdc, 137 rv = ::StretchDIBits(hdc,
138 dest_x, dest_y, dest_w, dest_h, 138 dest_x, dest_y, dest_w, dest_h,
139 src_x, bottom_up_src_y, src_w, src_h, 139 src_x, bottom_up_src_y, src_w, src_h,
140 pixels, bitmap_info, DIB_RGB_COLORS, SRCCOPY); 140 pixels, bitmap_info, DIB_RGB_COLORS, SRCCOPY);
141 } 141 }
142 DCHECK(rv != GDI_ERROR); 142 DCHECK(rv != GDI_ERROR);
143 } 143 }
144 144
145 } // namespace gfx 145 } // namespace gfx
OLDNEW
« no previous file with comments | « skia/skia_common.gypi ('k') | ui/gfx/path_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698