| 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 | 8 |
| 9 | 9 |
| 10 | 10 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 public: | 189 public: |
| 190 Strokes3GM() {} | 190 Strokes3GM() {} |
| 191 | 191 |
| 192 protected: | 192 protected: |
| 193 | 193 |
| 194 SkString onShortName() SK_OVERRIDE { | 194 SkString onShortName() SK_OVERRIDE { |
| 195 return SkString("strokes3"); | 195 return SkString("strokes3"); |
| 196 } | 196 } |
| 197 | 197 |
| 198 SkISize onISize() SK_OVERRIDE { | 198 SkISize onISize() SK_OVERRIDE { |
| 199 return SkISize::Make(W, H*2); | 199 return SkISize::Make(1500, 1500); |
| 200 } | 200 } |
| 201 | 201 |
| 202 void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 202 void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
| 203 SkPaint origPaint; | 203 SkPaint origPaint; |
| 204 origPaint.setAntiAlias(true); | 204 origPaint.setAntiAlias(true); |
| 205 origPaint.setStyle(SkPaint::kStroke_Style); | 205 origPaint.setStyle(SkPaint::kStroke_Style); |
| 206 SkPaint fillPaint(origPaint); | 206 SkPaint fillPaint(origPaint); |
| 207 fillPaint.setColor(SK_ColorRED); | 207 fillPaint.setColor(SK_ColorRED); |
| 208 SkPaint strokePaint(origPaint); | 208 SkPaint strokePaint(origPaint); |
| 209 strokePaint.setColor(0xFF4444FF); | 209 strokePaint.setColor(0xFF4444FF); |
| 210 | 210 |
| 211 void (*procs[])(SkPath*, const SkRect&, SkString*) = { | 211 void (*procs[])(SkPath*, const SkRect&, SkString*) = { |
| 212 make0, make1, make2, make3, make4, make5 | 212 make0, make1, make2, make3, make4, make5 |
| 213 }; | 213 }; |
| 214 | 214 |
| 215 canvas->translate(SkIntToScalar(20), SkIntToScalar(20)); | 215 canvas->translate(SkIntToScalar(20), SkIntToScalar(80)); |
| 216 | 216 |
| 217 SkRect bounds = SkRect::MakeWH(SkIntToScalar(50), SkIntToScalar(50)); | 217 SkRect bounds = SkRect::MakeWH(SkIntToScalar(50), SkIntToScalar(50)); |
| 218 SkScalar dx = bounds.width() * 4/3; | 218 SkScalar dx = bounds.width() * 4/3; |
| 219 SkScalar dy = bounds.height() * 5; | 219 SkScalar dy = bounds.height() * 5; |
| 220 | 220 |
| 221 for (size_t i = 0; i < SK_ARRAY_COUNT(procs); ++i) { | 221 for (size_t i = 0; i < SK_ARRAY_COUNT(procs); ++i) { |
| 222 SkPath orig; | 222 SkPath orig; |
| 223 SkString str; | 223 SkString str; |
| 224 procs[i](&orig, bounds, &str); | 224 procs[i](&orig, bounds, &str); |
| 225 | 225 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 244 | 244 |
| 245 ////////////////////////////////////////////////////////////////////////////// | 245 ////////////////////////////////////////////////////////////////////////////// |
| 246 | 246 |
| 247 static skiagm::GM* F0(void*) { return new StrokesGM; } | 247 static skiagm::GM* F0(void*) { return new StrokesGM; } |
| 248 static skiagm::GM* F1(void*) { return new Strokes2GM; } | 248 static skiagm::GM* F1(void*) { return new Strokes2GM; } |
| 249 static skiagm::GM* F2(void*) { return new Strokes3GM; } | 249 static skiagm::GM* F2(void*) { return new Strokes3GM; } |
| 250 | 250 |
| 251 static skiagm::GMRegistry R0(F0); | 251 static skiagm::GMRegistry R0(F0); |
| 252 static skiagm::GMRegistry R1(F1); | 252 static skiagm::GMRegistry R1(F1); |
| 253 static skiagm::GMRegistry R2(F2); | 253 static skiagm::GMRegistry R2(F2); |
| OLD | NEW |