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

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

Issue 134163010: Refactor read and write buffers. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: original write flags were fine Created 6 years, 10 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 Sk2DPathEffect_DEFINED 8 #ifndef Sk2DPathEffect_DEFINED
9 #define Sk2DPathEffect_DEFINED 9 #define Sk2DPathEffect_DEFINED
10 10
(...skipping 23 matching lines...) Expand all
34 34
35 /** Low-level virtual called per span of locations in the u-direction. 35 /** Low-level virtual called per span of locations in the u-direction.
36 The default implementation calls next() repeatedly with each 36 The default implementation calls next() repeatedly with each
37 location. 37 location.
38 */ 38 */
39 virtual void nextSpan(int u, int v, int ucount, SkPath* dst) const; 39 virtual void nextSpan(int u, int v, int ucount, SkPath* dst) const;
40 40
41 const SkMatrix& getMatrix() const { return fMatrix; } 41 const SkMatrix& getMatrix() const { return fMatrix; }
42 42
43 // protected so that subclasses can call this during unflattening 43 // protected so that subclasses can call this during unflattening
44 Sk2DPathEffect(SkFlattenableReadBuffer&); 44 Sk2DPathEffect(SkReadBuffer&);
45 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; 45 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
46 46
47 private: 47 private:
48 SkMatrix fMatrix, fInverse; 48 SkMatrix fMatrix, fInverse;
49 bool fMatrixIsInvertible; 49 bool fMatrixIsInvertible;
50 50
51 // illegal 51 // illegal
52 Sk2DPathEffect(const Sk2DPathEffect&); 52 Sk2DPathEffect(const Sk2DPathEffect&);
53 Sk2DPathEffect& operator=(const Sk2DPathEffect&); 53 Sk2DPathEffect& operator=(const Sk2DPathEffect&);
54 54
55 friend class Sk2DPathEffectBlitter; 55 friend class Sk2DPathEffectBlitter;
56 typedef SkPathEffect INHERITED; 56 typedef SkPathEffect INHERITED;
57 }; 57 };
58 58
59 class SK_API SkLine2DPathEffect : public Sk2DPathEffect { 59 class SK_API SkLine2DPathEffect : public Sk2DPathEffect {
60 public: 60 public:
61 SkLine2DPathEffect(SkScalar width, const SkMatrix& matrix) 61 SkLine2DPathEffect(SkScalar width, const SkMatrix& matrix)
62 : Sk2DPathEffect(matrix), fWidth(width) {} 62 : Sk2DPathEffect(matrix), fWidth(width) {}
63 63
64 virtual bool filterPath(SkPath* dst, const SkPath& src, 64 virtual bool filterPath(SkPath* dst, const SkPath& src,
65 SkStrokeRec*, const SkRect*) const SK_OVERRIDE; 65 SkStrokeRec*, const SkRect*) const SK_OVERRIDE;
66 66
67 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLine2DPathEffect) 67 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLine2DPathEffect)
68 68
69 protected: 69 protected:
70 virtual void nextSpan(int u, int v, int ucount, SkPath*) const SK_OVERRIDE; 70 virtual void nextSpan(int u, int v, int ucount, SkPath*) const SK_OVERRIDE;
71 71
72 SkLine2DPathEffect(SkFlattenableReadBuffer&); 72 SkLine2DPathEffect(SkReadBuffer&);
73 73
74 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; 74 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
75 75
76 private: 76 private:
77 SkScalar fWidth; 77 SkScalar fWidth;
78 78
79 typedef Sk2DPathEffect INHERITED; 79 typedef Sk2DPathEffect INHERITED;
80 }; 80 };
81 81
82 class SK_API SkPath2DPathEffect : public Sk2DPathEffect { 82 class SK_API SkPath2DPathEffect : public Sk2DPathEffect {
83 public: 83 public:
84 /** 84 /**
85 * Stamp the specified path to fill the shape, using the matrix to define 85 * Stamp the specified path to fill the shape, using the matrix to define
86 * the latice. 86 * the latice.
87 */ 87 */
88 SkPath2DPathEffect(const SkMatrix&, const SkPath&); 88 SkPath2DPathEffect(const SkMatrix&, const SkPath&);
89 89
90 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPath2DPathEffect) 90 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPath2DPathEffect)
91 91
92 protected: 92 protected:
93 SkPath2DPathEffect(SkFlattenableReadBuffer& buffer); 93 SkPath2DPathEffect(SkReadBuffer& buffer);
94 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; 94 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
95 95
96 virtual void next(const SkPoint&, int u, int v, SkPath*) const SK_OVERRIDE; 96 virtual void next(const SkPoint&, int u, int v, SkPath*) const SK_OVERRIDE;
97 97
98 private: 98 private:
99 SkPath fPath; 99 SkPath fPath;
100 100
101 typedef Sk2DPathEffect INHERITED; 101 typedef Sk2DPathEffect INHERITED;
102 }; 102 };
103 103
104 #endif 104 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698