Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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)
void drawPath(const SkPath &path, const SkPaint &paint)
SkPathFillType getFillType() const
Definition SkPath.h:230
SkRect computeTightBounds() const
Definition SkPath.cpp:3378
bool contains(SkScalar x, SkScalar y) const
Definition SkPath.cpp:3054
static SkRect MakeLargeS32()
Definition SkRectPriv.h:33
const Paint & paint
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