Flutter Engine
The Flutter Engine
SkSGPath.cpp
Go to the documentation of this file.
1/*
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
9
15#include "src/core/SkRectPriv.h"
16
17class SkMatrix;
18
19namespace sksg {
20
21Path::Path(const SkPath& path) : fPath(path) {}
22
23void Path::onClip(SkCanvas* canvas, bool antiAlias) const {
24 canvas->clipPath(fPath, SkClipOp::kIntersect, antiAlias);
25}
26
27void Path::onDraw(SkCanvas* canvas, const SkPaint& paint) const {
28 canvas->drawPath(fPath, paint);
29}
30
31bool Path::onContains(const SkPoint& p) const {
32 return fPath.contains(p.x(), p.y());
33}
34
35SkRect Path::onRevalidate(InvalidationController*, const SkMatrix&) {
36 SkASSERT(this->hasInval());
37
38 const auto ft = fPath.getFillType();
40 // "Containing" fills have finite bounds.
42 // Inverse fills are "infinite".
44}
45
46SkPath Path::onAsPath() const {
47 return fPath;
48}
49
50} // namespace sksg
SkPath fPath
#define SkASSERT(cond)
Definition: SkAssert.h:116
void clipPath(const SkPath &path, SkClipOp op, bool doAntiAlias)
Definition: SkCanvas.cpp:1456
void drawPath(const SkPath &path, const SkPaint &paint)
Definition: SkCanvas.cpp:1747
Definition: SkPath.h:59
SkPathFillType getFillType() const
Definition: SkPath.h:230
SkRect computeTightBounds() const
Definition: SkPath.cpp:3446
bool contains(SkScalar x, SkScalar y) const
Definition: SkPath.cpp:3118
static SkRect MakeLargeS32()
Definition: SkRectPriv.h:33
const Paint & paint
Definition: color_source.cc:38
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition: switches.h:57
Definition: Skottie.h:32