blob: 2b7dc94952989d95248b2c09346e2d181b4e02b3 [file] [log] [blame]
Florin Malita047ae272017-12-27 11:13:13 -05001/*
2 * Copyright 2017 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#include "SkSGPath.h"
9
10#include "SkCanvas.h"
11#include "SkPaint.h"
12
13namespace sksg {
14
15Path::Path(const SkPath& path) : fPath(path) {}
16
17void Path::onDraw(SkCanvas* canvas, const SkPaint& paint) const {
18 canvas->drawPath(fPath, paint);
19}
20
Florin Malitac14f1442018-01-05 11:32:31 -050021SkRect Path::onRevalidate(InvalidationController*, const SkMatrix&) {
22 SkASSERT(this->hasInval());
Florin Malitac75e2402018-01-03 16:17:29 -050023
Florin Malitac14f1442018-01-05 11:32:31 -050024 return fPath.computeTightBounds();
Florin Malita047ae272017-12-27 11:13:13 -050025}
26
Florin Malitae6345d92018-01-03 23:37:54 -050027SkPath Path::onAsPath() const {
28 return fPath;
29}
30
Florin Malita047ae272017-12-27 11:13:13 -050031} // namespace sksg