| OLD | NEW |
| 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 21 matching lines...) Expand all Loading... |
| 32 location. | 32 location. |
| 33 */ | 33 */ |
| 34 virtual void nextSpan(int u, int v, int ucount, SkPath* dst) const; | 34 virtual void nextSpan(int u, int v, int ucount, SkPath* dst) const; |
| 35 | 35 |
| 36 const SkMatrix& getMatrix() const { return fMatrix; } | 36 const SkMatrix& getMatrix() const { return fMatrix; } |
| 37 | 37 |
| 38 // protected so that subclasses can call this during unflattening | 38 // protected so that subclasses can call this during unflattening |
| 39 explicit Sk2DPathEffect(const SkMatrix& mat); | 39 explicit Sk2DPathEffect(const SkMatrix& mat); |
| 40 void flatten(SkWriteBuffer&) const SK_OVERRIDE; | 40 void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
| 41 | 41 |
| 42 SK_TO_STRING_OVERRIDE() |
| 43 |
| 42 private: | 44 private: |
| 43 SkMatrix fMatrix, fInverse; | 45 SkMatrix fMatrix, fInverse; |
| 44 bool fMatrixIsInvertible; | 46 bool fMatrixIsInvertible; |
| 45 | 47 |
| 46 // illegal | 48 // illegal |
| 47 Sk2DPathEffect(const Sk2DPathEffect&); | 49 Sk2DPathEffect(const Sk2DPathEffect&); |
| 48 Sk2DPathEffect& operator=(const Sk2DPathEffect&); | 50 Sk2DPathEffect& operator=(const Sk2DPathEffect&); |
| 49 | 51 |
| 50 friend class Sk2DPathEffectBlitter; | 52 friend class Sk2DPathEffectBlitter; |
| 51 typedef SkPathEffect INHERITED; | 53 typedef SkPathEffect INHERITED; |
| 52 }; | 54 }; |
| 53 | 55 |
| 54 class SK_API SkLine2DPathEffect : public Sk2DPathEffect { | 56 class SK_API SkLine2DPathEffect : public Sk2DPathEffect { |
| 55 public: | 57 public: |
| 56 static SkLine2DPathEffect* Create(SkScalar width, const SkMatrix& matrix) { | 58 static SkLine2DPathEffect* Create(SkScalar width, const SkMatrix& matrix) { |
| 57 return SkNEW_ARGS(SkLine2DPathEffect, (width, matrix)); | 59 return SkNEW_ARGS(SkLine2DPathEffect, (width, matrix)); |
| 58 } | 60 } |
| 59 | 61 |
| 60 virtual bool filterPath(SkPath* dst, const SkPath& src, | 62 virtual bool filterPath(SkPath* dst, const SkPath& src, |
| 61 SkStrokeRec*, const SkRect*) const SK_OVERRIDE; | 63 SkStrokeRec*, const SkRect*) const SK_OVERRIDE; |
| 62 | 64 |
| 65 SK_TO_STRING_OVERRIDE() |
| 63 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLine2DPathEffect) | 66 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLine2DPathEffect) |
| 64 | 67 |
| 65 protected: | 68 protected: |
| 66 SkLine2DPathEffect(SkScalar width, const SkMatrix& matrix) | 69 SkLine2DPathEffect(SkScalar width, const SkMatrix& matrix) |
| 67 : Sk2DPathEffect(matrix), fWidth(width) {} | 70 : Sk2DPathEffect(matrix), fWidth(width) {} |
| 68 void flatten(SkWriteBuffer&) const SK_OVERRIDE; | 71 void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
| 69 | 72 |
| 70 void nextSpan(int u, int v, int ucount, SkPath*) const SK_OVERRIDE; | 73 void nextSpan(int u, int v, int ucount, SkPath*) const SK_OVERRIDE; |
| 71 | 74 |
| 72 private: | 75 private: |
| 73 SkScalar fWidth; | 76 SkScalar fWidth; |
| 74 | 77 |
| 75 typedef Sk2DPathEffect INHERITED; | 78 typedef Sk2DPathEffect INHERITED; |
| 76 }; | 79 }; |
| 77 | 80 |
| 78 class SK_API SkPath2DPathEffect : public Sk2DPathEffect { | 81 class SK_API SkPath2DPathEffect : public Sk2DPathEffect { |
| 79 public: | 82 public: |
| 80 /** | 83 /** |
| 81 * Stamp the specified path to fill the shape, using the matrix to define | 84 * Stamp the specified path to fill the shape, using the matrix to define |
| 82 * the latice. | 85 * the latice. |
| 83 */ | 86 */ |
| 84 static SkPath2DPathEffect* Create(const SkMatrix& matrix, const SkPath& path
) { | 87 static SkPath2DPathEffect* Create(const SkMatrix& matrix, const SkPath& path
) { |
| 85 return SkNEW_ARGS(SkPath2DPathEffect, (matrix, path)); | 88 return SkNEW_ARGS(SkPath2DPathEffect, (matrix, path)); |
| 86 } | 89 } |
| 87 | 90 |
| 91 SK_TO_STRING_OVERRIDE() |
| 88 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPath2DPathEffect) | 92 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPath2DPathEffect) |
| 89 | 93 |
| 90 protected: | 94 protected: |
| 91 SkPath2DPathEffect(const SkMatrix&, const SkPath&); | 95 SkPath2DPathEffect(const SkMatrix&, const SkPath&); |
| 92 void flatten(SkWriteBuffer&) const SK_OVERRIDE; | 96 void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
| 93 | 97 |
| 94 void next(const SkPoint&, int u, int v, SkPath*) const SK_OVERRIDE; | 98 void next(const SkPoint&, int u, int v, SkPath*) const SK_OVERRIDE; |
| 95 | 99 |
| 96 private: | 100 private: |
| 97 SkPath fPath; | 101 SkPath fPath; |
| 98 | 102 |
| 99 typedef Sk2DPathEffect INHERITED; | 103 typedef Sk2DPathEffect INHERITED; |
| 100 }; | 104 }; |
| 101 | 105 |
| 102 #endif | 106 #endif |
| OLD | NEW |