Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SkDashImpl.h
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
8#ifndef SkDashImpl_DEFINED
9#define SkDashImpl_DEFINED
10
12
14public:
15 SkDashImpl(const SkScalar intervals[], int count, SkScalar phase);
16
17protected:
18 ~SkDashImpl() override;
19 void flatten(SkWriteBuffer&) const override;
20 bool onFilterPath(SkPath* dst, const SkPath& src, SkStrokeRec*, const SkRect*,
21 const SkMatrix&) const override;
22
23 bool onAsPoints(PointData* results, const SkPath& src, const SkStrokeRec&, const SkMatrix&,
24 const SkRect*) const override;
25
26 DashType onAsADash(DashInfo* info) const override;
27
28private:
30
31 bool computeFastBounds(SkRect* bounds) const override {
32 // Dashing a path returns a subset of the input path so just return true and leave
33 // bounds unmodified
34 return true;
35 }
36
37 SkScalar* fIntervals;
38 int32_t fCount;
39 SkScalar fPhase;
40 // computed from phase
41
42 SkScalar fInitialDashLength;
43 int32_t fInitialDashIndex;
44 SkScalar fIntervalLength;
45
46 using INHERITED = SkPathEffectBase;
47};
48
49#endif
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition DM.cpp:213
int count
#define SK_FLATTENABLE_HOOKS(type)
~SkDashImpl() override
void flatten(SkWriteBuffer &) const override
DashType onAsADash(DashInfo *info) const override
bool computeFastBounds(SkRect *bounds) const override
Definition SkDashImpl.h:31
bool onAsPoints(PointData *results, const SkPath &src, const SkStrokeRec &, const SkMatrix &, const SkRect *) const override
bool onFilterPath(SkPath *dst, const SkPath &src, SkStrokeRec *, const SkRect *, const SkMatrix &) const override
float SkScalar
Definition extension.cpp:12