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 | 7 |
8 #include "SampleCode.h" | 8 #include "SampleCode.h" |
9 #include "SkView.h" | 9 #include "SkView.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 // overrides from SkEventSink | 31 // overrides from SkEventSink |
32 virtual bool onQuery(SkEvent* evt) { | 32 virtual bool onQuery(SkEvent* evt) { |
33 if (SampleCode::TitleQ(*evt)) { | 33 if (SampleCode::TitleQ(*evt)) { |
34 SampleCode::TitleR(evt, "RotateCircles"); | 34 SampleCode::TitleR(evt, "RotateCircles"); |
35 return true; | 35 return true; |
36 } | 36 } |
37 return this->INHERITED::onQuery(evt); | 37 return this->INHERITED::onQuery(evt); |
38 } | 38 } |
39 | 39 |
40 virtual void onDrawContent(SkCanvas* canvas) { | 40 virtual void onDrawContent(SkCanvas* canvas) { |
41 SkMWCRandom rand; | 41 SkRandom rand; |
42 SkPaint paint; | 42 SkPaint paint; |
43 paint.setAntiAlias(true); | 43 paint.setAntiAlias(true); |
44 paint.setStrokeWidth(20); | 44 paint.setStrokeWidth(20); |
45 | 45 |
46 SkScalar cx = 240; | 46 SkScalar cx = 240; |
47 SkScalar cy = 240; | 47 SkScalar cy = 240; |
48 SkScalar DX = 240 * 2; | 48 SkScalar DX = 240 * 2; |
49 SkColor color = 0; | 49 SkColor color = 0; |
50 | 50 |
51 float scale = 1; | 51 float scale = 1; |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 }; | 352 }; |
353 | 353 |
354 /////////////////////////////////////////////////////////////////////////////// | 354 /////////////////////////////////////////////////////////////////////////////// |
355 | 355 |
356 static SkView* F0() { return new RotateCirclesView; } | 356 static SkView* F0() { return new RotateCirclesView; } |
357 static SkViewRegister gR0(F0); | 357 static SkViewRegister gR0(F0); |
358 static SkView* F1() { return new TestCirclesView; } | 358 static SkView* F1() { return new TestCirclesView; } |
359 static SkViewRegister gR1(F1); | 359 static SkViewRegister gR1(F1); |
360 static SkView* F2() { return new TestStrokeView; } | 360 static SkView* F2() { return new TestStrokeView; } |
361 static SkViewRegister gR2(F2); | 361 static SkViewRegister gR2(F2); |
OLD | NEW |