OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
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 #include "gm.h" | 7 #include "gm.h" |
8 #include "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkPaint.h" | 9 #include "SkPaint.h" |
10 #include "Sk1DPathEffect.h" | 10 #include "Sk1DPathEffect.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 paint->setPathEffect(SkPath1DPathEffect::Create(path, SkIntToScalar(21), 0, | 72 paint->setPathEffect(SkPath1DPathEffect::Create(path, SkIntToScalar(21), 0, |
73 SkPath1DPathEffect::kRotate_Style))->unref(); | 73 SkPath1DPathEffect::kRotate_Style))->unref(); |
74 compose_pe(paint); | 74 compose_pe(paint); |
75 } | 75 } |
76 | 76 |
77 typedef void (*PE_Proc)(SkPaint*); | 77 typedef void (*PE_Proc)(SkPaint*); |
78 static const PE_Proc gPE[] = { hair_pe, hair2_pe, stroke_pe, dash_pe, one_d_pe }
; | 78 static const PE_Proc gPE[] = { hair_pe, hair2_pe, stroke_pe, dash_pe, one_d_pe }
; |
79 | 79 |
80 static void fill_pe(SkPaint* paint) { | 80 static void fill_pe(SkPaint* paint) { |
81 paint->setStyle(SkPaint::kFill_Style); | 81 paint->setStyle(SkPaint::kFill_Style); |
82 paint->setPathEffect(NULL); | 82 paint->setPathEffect(nullptr); |
83 } | 83 } |
84 | 84 |
85 static void discrete_pe(SkPaint* paint) { | 85 static void discrete_pe(SkPaint* paint) { |
86 paint->setPathEffect(SkDiscretePathEffect::Create(10, 4))->unref(); | 86 paint->setPathEffect(SkDiscretePathEffect::Create(10, 4))->unref(); |
87 } | 87 } |
88 | 88 |
89 static SkPathEffect* MakeTileEffect() { | 89 static SkPathEffect* MakeTileEffect() { |
90 SkMatrix m; | 90 SkMatrix m; |
91 m.setScale(SkIntToScalar(12), SkIntToScalar(12)); | 91 m.setScale(SkIntToScalar(12), SkIntToScalar(12)); |
92 | 92 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 private: | 162 private: |
163 typedef GM INHERITED; | 163 typedef GM INHERITED; |
164 }; | 164 }; |
165 | 165 |
166 ////////////////////////////////////////////////////////////////////////////// | 166 ////////////////////////////////////////////////////////////////////////////// |
167 | 167 |
168 static GM* PathEffectFactory(void*) { return new PathEffectGM; } | 168 static GM* PathEffectFactory(void*) { return new PathEffectGM; } |
169 static GMRegistry regPathEffect(PathEffectFactory); | 169 static GMRegistry regPathEffect(PathEffectFactory); |
170 | 170 |
171 } | 171 } |
OLD | NEW |