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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 } | 197 } |
198 | 198 |
199 bool onAnimate(const SkAnimTimer& timer) override { | 199 bool onAnimate(const SkAnimTimer& timer) override { |
200 SkScalar angle = SkDoubleToScalar(fmod(timer.secs() * 360 / 24, 360)); | 200 SkScalar angle = SkDoubleToScalar(fmod(timer.secs() * 360 / 24, 360)); |
201 fAnimatingDrawable->setSweep(angle); | 201 fAnimatingDrawable->setSweep(angle); |
202 return true; | 202 return true; |
203 } | 203 } |
204 | 204 |
205 SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned modi) ove
rride { | 205 SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned modi) ove
rride { |
206 // fSweep += SK_Scalar1; | 206 // fSweep += SK_Scalar1; |
207 this->inval(NULL); | 207 this->inval(nullptr); |
208 return this->INHERITED::onFindClickHandler(x, y, modi); | 208 return this->INHERITED::onFindClickHandler(x, y, modi); |
209 } | 209 } |
210 | 210 |
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 |