blob: 70ed739ab8dc5ae80d4338125c5f06fbc88ca31e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/gfx/path.h"
#include "base/logging.h"
namespace gfx {
Path::Path()
: SkPath() {
}
Path::Path(const Point* points, size_t count) {
DCHECK(count > 1);
moveTo(SkIntToScalar(points[0].x), SkIntToScalar(points[0].y));
for (size_t i = 1; i < count; ++i)
lineTo(SkIntToScalar(points[i].x), SkIntToScalar(points[i].y));
}
Path::Path(const PointF* points, size_t count) {
DCHECK(count > 1);
moveTo(SkFloatToScalar(points[0].x), SkFloatToScalar(points[0].y));
for (size_t i = 1; i < count; ++i)
lineTo(SkFloatToScalar(points[i].x), SkFloatToScalar(points[i].y));
}
Path::~Path() {
}
} // namespace gfx
|