OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 switch (uni) { | 225 switch (uni) { |
226 case 'C': fDrawable->toggleUseColors(); this->inval(nullptr); re
turn true; | 226 case 'C': fDrawable->toggleUseColors(); this->inval(nullptr); re
turn true; |
227 default: break; | 227 default: break; |
228 } | 228 } |
229 } | 229 } |
230 return this->INHERITED::onQuery(evt); | 230 return this->INHERITED::onQuery(evt); |
231 } | 231 } |
232 | 232 |
233 void onDrawContent(SkCanvas* canvas) override { | 233 void onDrawContent(SkCanvas* canvas) override { |
234 canvas->drawDrawable(fDrawable); | 234 canvas->drawDrawable(fDrawable); |
| 235 this->inval(nullptr); |
235 } | 236 } |
236 | 237 |
237 bool onAnimate(const SkAnimTimer&) override { | |
238 return true; | |
239 } | |
240 #if 0 | 238 #if 0 |
241 // TODO: switch over to use this for our animation | 239 // TODO: switch over to use this for our animation |
242 bool onAnimate(const SkAnimTimer& timer) override { | 240 bool onAnimate(const SkAnimTimer& timer) override { |
243 SkScalar angle = SkDoubleToScalar(fmod(timer.secs() * 360 / 24, 360)); | 241 SkScalar angle = SkDoubleToScalar(fmod(timer.secs() * 360 / 24, 360)); |
244 fAnimatingDrawable->setSweep(angle); | 242 fAnimatingDrawable->setSweep(angle); |
245 return true; | 243 return true; |
246 } | 244 } |
247 #endif | 245 #endif |
248 | 246 |
249 private: | 247 private: |
250 typedef SampleView INHERITED; | 248 typedef SampleView INHERITED; |
251 }; | 249 }; |
252 | 250 |
253 ////////////////////////////////////////////////////////////////////////////// | 251 ////////////////////////////////////////////////////////////////////////////// |
254 | 252 |
255 DEF_SAMPLE( return new DrawAtlasView("DrawAtlas", draw_atlas); ) | 253 DEF_SAMPLE( return new DrawAtlasView("DrawAtlas", draw_atlas); ) |
256 DEF_SAMPLE( return new DrawAtlasView("DrawAtlasSim", draw_atlas_sim); ) | 254 DEF_SAMPLE( return new DrawAtlasView("DrawAtlasSim", draw_atlas_sim); ) |
OLD | NEW |