Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(642)

Side by Side Diff: include/effects/SkDashPathEffect.h

Issue 212103010: Add asADash entry point into SkPathEffect to allow extracting Dash info from PathEffects (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Constructor Fix Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkDashPathEffect_DEFINED 8 #ifndef SkDashPathEffect_DEFINED
9 #define SkDashPathEffect_DEFINED 9 #define SkDashPathEffect_DEFINED
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 } 42 }
43 virtual ~SkDashPathEffect(); 43 virtual ~SkDashPathEffect();
44 44
45 virtual bool filterPath(SkPath* dst, const SkPath& src, 45 virtual bool filterPath(SkPath* dst, const SkPath& src,
46 SkStrokeRec*, const SkRect*) const SK_OVERRIDE; 46 SkStrokeRec*, const SkRect*) const SK_OVERRIDE;
47 47
48 virtual bool asPoints(PointData* results, const SkPath& src, 48 virtual bool asPoints(PointData* results, const SkPath& src,
49 const SkStrokeRec&, const SkMatrix&, 49 const SkStrokeRec&, const SkMatrix&,
50 const SkRect*) const SK_OVERRIDE; 50 const SkRect*) const SK_OVERRIDE;
51 51
52 virtual DashType asADash(DashInfo* info) const SK_OVERRIDE;
53
52 virtual Factory getFactory() const SK_OVERRIDE; 54 virtual Factory getFactory() const SK_OVERRIDE;
53 55
54 static SkFlattenable* CreateProc(SkReadBuffer&); 56 static SkFlattenable* CreateProc(SkReadBuffer&);
55 57
56 protected: 58 protected:
57 SkDashPathEffect(SkReadBuffer&); 59 SkDashPathEffect(SkReadBuffer&);
58 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; 60 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
59 61
60 #ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS 62 #ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS
61 public: 63 public:
62 #endif 64 #endif
63 SkDashPathEffect(const SkScalar intervals[], int count, SkScalar phase); 65 SkDashPathEffect(const SkScalar intervals[], int count, SkScalar phase);
64 66
65 private: 67 private:
68 void setInternalMembers(SkScalar phase);
69
66 SkScalar* fIntervals; 70 SkScalar* fIntervals;
67 int32_t fCount; 71 int32_t fCount;
72 SkScalar fPhase;
68 // computed from phase 73 // computed from phase
69 SkScalar fInitialDashLength; 74 SkScalar fInitialDashLength;
70 int32_t fInitialDashIndex; 75 int32_t fInitialDashIndex;
71 SkScalar fIntervalLength; 76 SkScalar fIntervalLength;
72 77
73 typedef SkPathEffect INHERITED; 78 typedef SkPathEffect INHERITED;
74 }; 79 };
75 80
76 #endif 81 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698