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

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

Issue 10221028: Move DIP translation from ui/aura to ui/compositor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove dip from gyp Created 8 years, 7 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
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/path.h" 5 #include "ui/gfx/path.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace gfx { 9 namespace gfx {
10 10
11 Path::Path() 11 Path::Path()
12 : SkPath() { 12 : SkPath() {
13 } 13 }
14 14
15 Path::Path(const Point* points, size_t count) { 15 Path::Path(const Point* points, size_t count) {
16 DCHECK(count > 1); 16 DCHECK(count > 1);
17 moveTo(SkIntToScalar(points[0].x), SkIntToScalar(points[0].y)); 17 moveTo(SkIntToScalar(points[0].x), SkIntToScalar(points[0].y));
18 for (size_t i = 1; i < count; ++i) 18 for (size_t i = 1; i < count; ++i)
19 lineTo(SkIntToScalar(points[i].x), SkIntToScalar(points[i].y)); 19 lineTo(SkIntToScalar(points[i].x), SkIntToScalar(points[i].y));
20 } 20 }
21 21
22 #if defined(ENABLE_DIP)
23 Path::Path(const PointF* points, size_t count) { 22 Path::Path(const PointF* points, size_t count) {
24 DCHECK(count > 1); 23 DCHECK(count > 1);
25 moveTo(SkFloatToScalar(points[0].x), SkFloatToScalar(points[0].y)); 24 moveTo(SkFloatToScalar(points[0].x), SkFloatToScalar(points[0].y));
26 for (size_t i = 1; i < count; ++i) 25 for (size_t i = 1; i < count; ++i)
27 lineTo(SkFloatToScalar(points[i].x), SkFloatToScalar(points[i].y)); 26 lineTo(SkFloatToScalar(points[i].x), SkFloatToScalar(points[i].y));
28 } 27 }
29 #endif
30 28
31 Path::~Path() { 29 Path::~Path() {
32 } 30 }
33 31
34 } // namespace gfx 32 } // namespace gfx
OLDNEW
« ui/gfx/compositor/layer.cc ('K') | « ui/gfx/path.h ('k') | ui/gfx/point_f.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698