Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / ui / gfx / path.cc
blob70ed739ab8dc5ae80d4338125c5f06fbc88ca31e
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
3 // found in the LICENSE file.
5 #include "ui/gfx/path.h"
7 #include "base/logging.h"
9 namespace gfx {
11 Path::Path()
12 : SkPath() {
15 Path::Path(const Point* points, size_t count) {
16 DCHECK(count > 1);
17 moveTo(SkIntToScalar(points[0].x), SkIntToScalar(points[0].y));
18 for (size_t i = 1; i < count; ++i)
19 lineTo(SkIntToScalar(points[i].x), SkIntToScalar(points[i].y));
22 Path::Path(const PointF* points, size_t count) {
23 DCHECK(count > 1);
24 moveTo(SkFloatToScalar(points[0].x), SkFloatToScalar(points[0].y));
25 for (size_t i = 1; i < count; ++i)
26 lineTo(SkFloatToScalar(points[i].x), SkFloatToScalar(points[i].y));
29 Path::~Path() {
32 } // namespace gfx