OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkAnimTimer.h" | 9 #include "SkAnimTimer.h" |
10 #include "SkView.h" | 10 #include "SkView.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 MyDrawable* fAnimatingDrawable; | 85 MyDrawable* fAnimatingDrawable; |
86 SkDrawable* fRootDrawable; | 86 SkDrawable* fRootDrawable; |
87 | 87 |
88 ArcsView() { | 88 ArcsView() { |
89 testparse(); | 89 testparse(); |
90 fSweep = SkIntToScalar(100); | 90 fSweep = SkIntToScalar(100); |
91 this->setBGColor(0xFFDDDDDD); | 91 this->setBGColor(0xFFDDDDDD); |
92 | 92 |
93 fRect.set(0, 0, SkIntToScalar(200), SkIntToScalar(200)); | 93 fRect.set(0, 0, SkIntToScalar(200), SkIntToScalar(200)); |
94 fRect.offset(SkIntToScalar(20), SkIntToScalar(20)); | 94 fRect.offset(SkIntToScalar(20), SkIntToScalar(20)); |
95 fAnimatingDrawable = SkNEW_ARGS(MyDrawable, (fRect)); | 95 fAnimatingDrawable = new MyDrawable(fRect); |
96 | 96 |
97 SkPictureRecorder recorder; | 97 SkPictureRecorder recorder; |
98 this->drawRoot(recorder.beginRecording(SkRect::MakeWH(800, 500))); | 98 this->drawRoot(recorder.beginRecording(SkRect::MakeWH(800, 500))); |
99 fRootDrawable = recorder.endRecordingAsDrawable(); | 99 fRootDrawable = recorder.endRecordingAsDrawable(); |
100 } | 100 } |
101 | 101 |
102 ~ArcsView() override { | 102 ~ArcsView() override { |
103 fAnimatingDrawable->unref(); | 103 fAnimatingDrawable->unref(); |
104 fRootDrawable->unref(); | 104 fRootDrawable->unref(); |
105 } | 105 } |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 private: | 211 private: |
212 SkScalar fSweep; | 212 SkScalar fSweep; |
213 | 213 |
214 typedef SampleView INHERITED; | 214 typedef SampleView INHERITED; |
215 }; | 215 }; |
216 | 216 |
217 ////////////////////////////////////////////////////////////////////////////// | 217 ////////////////////////////////////////////////////////////////////////////// |
218 | 218 |
219 static SkView* MyFactory() { return new ArcsView; } | 219 static SkView* MyFactory() { return new ArcsView; } |
220 static SkViewRegister reg(MyFactory); | 220 static SkViewRegister reg(MyFactory); |
OLD | NEW |