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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 protected: | 125 protected: |
126 // overrides from SkEventSink | 126 // overrides from SkEventSink |
127 virtual bool onQuery(SkEvent* evt) { | 127 virtual bool onQuery(SkEvent* evt) { |
128 if (SampleCode::TitleQ(*evt)) { | 128 if (SampleCode::TitleQ(*evt)) { |
129 SampleCode::TitleR(evt, "StrokePath"); | 129 SampleCode::TitleR(evt, "StrokePath"); |
130 return true; | 130 return true; |
131 } | 131 } |
132 return this->INHERITED::onQuery(evt); | 132 return this->INHERITED::onQuery(evt); |
133 } | 133 } |
134 | 134 |
135 SkMWCRandom rand; | 135 SkRandom rand; |
136 | 136 |
137 void drawSet(SkCanvas* canvas, SkPaint* paint) { | 137 void drawSet(SkCanvas* canvas, SkPaint* paint) { |
138 SkAutoCanvasRestore acr(canvas, true); | 138 SkAutoCanvasRestore acr(canvas, true); |
139 | 139 |
140 for (size_t i = 0; i < SK_ARRAY_COUNT(gRec); i++) { | 140 for (size_t i = 0; i < SK_ARRAY_COUNT(gRec); i++) { |
141 paint->setStyle(gRec[i].fStyle); | 141 paint->setStyle(gRec[i].fStyle); |
142 paint->setStrokeJoin(gRec[i].fJoin); | 142 paint->setStrokeJoin(gRec[i].fJoin); |
143 paint->setStrokeWidth(SkIntToScalar(gRec[i].fStrokeWidth)); | 143 paint->setStrokeWidth(SkIntToScalar(gRec[i].fStrokeWidth)); |
144 canvas->drawPath(fPath, *paint); | 144 canvas->drawPath(fPath, *paint); |
145 canvas->translate(fWidth * 5 / 4, 0); | 145 canvas->translate(fWidth * 5 / 4, 0); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 return this->INHERITED::onFindClickHandler(x, y, modi); | 215 return this->INHERITED::onFindClickHandler(x, y, modi); |
216 } | 216 } |
217 private: | 217 private: |
218 typedef SampleView INHERITED; | 218 typedef SampleView INHERITED; |
219 }; | 219 }; |
220 | 220 |
221 ////////////////////////////////////////////////////////////////////////////// | 221 ////////////////////////////////////////////////////////////////////////////// |
222 | 222 |
223 static SkView* MyFactory() { return new StrokePathView; } | 223 static SkView* MyFactory() { return new StrokePathView; } |
224 static SkViewRegister reg(MyFactory); | 224 static SkViewRegister reg(MyFactory); |
OLD | NEW |