| 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 SkDiscretePathEffect_DEFINED | 8 #ifndef SkDiscretePathEffect_DEFINED |
| 9 #define SkDiscretePathEffect_DEFINED | 9 #define SkDiscretePathEffect_DEFINED |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 segments' endpoints. If not supplied it defaults to 0, | 25 segments' endpoints. If not supplied it defaults to 0, |
| 26 in which case filtering a path multiple times will | 26 in which case filtering a path multiple times will |
| 27 result in the same set of segments (this is useful for | 27 result in the same set of segments (this is useful for |
| 28 testing). If a caller does not want this behaviour | 28 testing). If a caller does not want this behaviour |
| 29 they can pass in a different seedAssist to get a | 29 they can pass in a different seedAssist to get a |
| 30 different set of path segments. | 30 different set of path segments. |
| 31 */ | 31 */ |
| 32 static SkDiscretePathEffect* Create(SkScalar segLength, | 32 static SkDiscretePathEffect* Create(SkScalar segLength, |
| 33 SkScalar deviation, | 33 SkScalar deviation, |
| 34 uint32_t seedAssist=0) { | 34 uint32_t seedAssist=0) { |
| 35 return SkNEW_ARGS(SkDiscretePathEffect, | 35 return new SkDiscretePathEffect(segLength, deviation, seedAssist); |
| 36 (segLength, deviation, seedAssist)); | |
| 37 } | 36 } |
| 38 | 37 |
| 39 virtual bool filterPath(SkPath* dst, const SkPath& src, | 38 virtual bool filterPath(SkPath* dst, const SkPath& src, |
| 40 SkStrokeRec*, const SkRect*) const override; | 39 SkStrokeRec*, const SkRect*) const override; |
| 41 | 40 |
| 42 SK_TO_STRING_OVERRIDE() | 41 SK_TO_STRING_OVERRIDE() |
| 43 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDiscretePathEffect) | 42 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDiscretePathEffect) |
| 44 | 43 |
| 45 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK | 44 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK |
| 46 bool exposedInAndroidJavaAPI() const override { return true; } | 45 bool exposedInAndroidJavaAPI() const override { return true; } |
| 47 #endif | 46 #endif |
| 48 | 47 |
| 49 protected: | 48 protected: |
| 50 SkDiscretePathEffect(SkScalar segLength, | 49 SkDiscretePathEffect(SkScalar segLength, |
| 51 SkScalar deviation, | 50 SkScalar deviation, |
| 52 uint32_t seedAssist); | 51 uint32_t seedAssist); |
| 53 void flatten(SkWriteBuffer&) const override; | 52 void flatten(SkWriteBuffer&) const override; |
| 54 | 53 |
| 55 private: | 54 private: |
| 56 SkScalar fSegLength, fPerterb; | 55 SkScalar fSegLength, fPerterb; |
| 57 | 56 |
| 58 /* Caller-supplied 32 bit seed assist */ | 57 /* Caller-supplied 32 bit seed assist */ |
| 59 uint32_t fSeedAssist; | 58 uint32_t fSeedAssist; |
| 60 | 59 |
| 61 typedef SkPathEffect INHERITED; | 60 typedef SkPathEffect INHERITED; |
| 62 }; | 61 }; |
| 63 | 62 |
| 64 #endif | 63 #endif |
| OLD | NEW |