OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "SampleCode.h" | 8 #include "SampleCode.h" |
9 #include "SkBlurMask.h" | 9 #include "SkBlurMask.h" |
10 #include "SkBlurMaskFilter.h" | 10 #include "SkBlurMaskFilter.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 path->transform(m); | 73 path->transform(m); |
74 } | 74 } |
75 | 75 |
76 static void one_d_pe(SkPaint* paint) { | 76 static void one_d_pe(SkPaint* paint) { |
77 SkPath path; | 77 SkPath path; |
78 path.moveTo(SkIntToScalar(gXY[0]), SkIntToScalar(gXY[1])); | 78 path.moveTo(SkIntToScalar(gXY[0]), SkIntToScalar(gXY[1])); |
79 for (unsigned i = 2; i < SK_ARRAY_COUNT(gXY); i += 2) | 79 for (unsigned i = 2; i < SK_ARRAY_COUNT(gXY); i += 2) |
80 path.lineTo(SkIntToScalar(gXY[i]), SkIntToScalar(gXY[i+1])); | 80 path.lineTo(SkIntToScalar(gXY[i]), SkIntToScalar(gXY[i+1])); |
81 path.close(); | 81 path.close(); |
82 path.offset(SkIntToScalar(-6), 0); | 82 path.offset(SkIntToScalar(-6), 0); |
83 scale(&path, SkFloatToScalar(1.5f)); | 83 scale(&path, 1.5f); |
84 | 84 |
85 paint->setPathEffect(new SkPath1DPathEffect(path, SkIntToScalar(21), 0, | 85 paint->setPathEffect(new SkPath1DPathEffect(path, SkIntToScalar(21), 0, |
86 SkPath1DPathEffect::kRotate_Style))->unref(); | 86 SkPath1DPathEffect::kRotate_Style))->unref(); |
87 compose_pe(paint); | 87 compose_pe(paint); |
88 } | 88 } |
89 | 89 |
90 typedef void (*PE_Proc)(SkPaint*); | 90 typedef void (*PE_Proc)(SkPaint*); |
91 static const PE_Proc gPE[] = { hair_pe, hair2_pe, stroke_pe, dash_pe, one_d_pe }
; | 91 static const PE_Proc gPE[] = { hair_pe, hair2_pe, stroke_pe, dash_pe, one_d_pe }
; |
92 | 92 |
93 static void fill_pe(SkPaint* paint) { | 93 static void fill_pe(SkPaint* paint) { |
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 } | 725 } |
726 | 726 |
727 private: | 727 private: |
728 typedef SampleView INHERITED; | 728 typedef SampleView INHERITED; |
729 }; | 729 }; |
730 | 730 |
731 ////////////////////////////////////////////////////////////////////////////// | 731 ////////////////////////////////////////////////////////////////////////////// |
732 | 732 |
733 static SkView* MyFactory() { return new SlideView; } | 733 static SkView* MyFactory() { return new SlideView; } |
734 static SkViewRegister reg(MyFactory); | 734 static SkViewRegister reg(MyFactory); |
OLD | NEW |