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

Side by Side Diff: ui/gfx/path_win.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 | « ui/gfx/path_gtk.cc ('k') | ui/gfx/path_x11.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) 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 "ui/gfx/path_win.h" 5 #include "ui/gfx/path_win.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/win/scoped_gdi_object.h" 8 #include "base/win/scoped_gdi_object.h"
9 #include "third_party/skia/include/core/SkRegion.h" 9 #include "third_party/skia/include/core/SkRegion.h"
10 #include "ui/gfx/path.h" 10 #include "ui/gfx/path.h"
(...skipping 12 matching lines...) Expand all
23 23
24 return result.release(); 24 return result.release();
25 } 25 }
26 26
27 HRGN CreateHRGNFromSkPath(const SkPath& path) { 27 HRGN CreateHRGNFromSkPath(const SkPath& path) {
28 int point_count = path.getPoints(NULL, 0); 28 int point_count = path.getPoints(NULL, 0);
29 scoped_ptr<SkPoint[]> points(new SkPoint[point_count]); 29 scoped_ptr<SkPoint[]> points(new SkPoint[point_count]);
30 path.getPoints(points.get(), point_count); 30 path.getPoints(points.get(), point_count);
31 scoped_ptr<POINT[]> windows_points(new POINT[point_count]); 31 scoped_ptr<POINT[]> windows_points(new POINT[point_count]);
32 for (int i = 0; i < point_count; ++i) { 32 for (int i = 0; i < point_count; ++i) {
33 windows_points[i].x = SkScalarRound(points[i].fX); 33 windows_points[i].x = SkScalarRoundToInt(points[i].fX);
34 windows_points[i].y = SkScalarRound(points[i].fY); 34 windows_points[i].y = SkScalarRoundToInt(points[i].fY);
35 } 35 }
36 36
37 return ::CreatePolygonRgn(windows_points.get(), point_count, ALTERNATE); 37 return ::CreatePolygonRgn(windows_points.get(), point_count, ALTERNATE);
38 } 38 }
39 39
40 // See path_aura.cc for Aura definition of these methods: 40 // See path_aura.cc for Aura definition of these methods:
41 #if !defined(USE_AURA) 41 #if !defined(USE_AURA)
42 42
43 NativeRegion Path::CreateNativeRegion() const { 43 NativeRegion Path::CreateNativeRegion() const {
44 return CreateHRGNFromSkPath(*this); 44 return CreateHRGNFromSkPath(*this);
(...skipping 16 matching lines...) Expand all
61 // static 61 // static
62 NativeRegion Path::SubtractRegion(NativeRegion r1, NativeRegion r2) { 62 NativeRegion Path::SubtractRegion(NativeRegion r1, NativeRegion r2) {
63 HRGN dest = CreateRectRgn(0, 0, 1, 1); 63 HRGN dest = CreateRectRgn(0, 0, 1, 1);
64 CombineRgn(dest, r1, r2, RGN_DIFF); 64 CombineRgn(dest, r1, r2, RGN_DIFF);
65 return dest; 65 return dest;
66 } 66 }
67 67
68 #endif 68 #endif
69 69
70 } // namespace gfx 70 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/path_gtk.cc ('k') | ui/gfx/path_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698