Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Side by Side Diff: samplecode/SampleAtlas.cpp

Issue 2056343004: Add samples to Viewer. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add samples.gypi Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « samplecode/SampleApp.cpp ('k') | samplecode/SampleClock.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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);
236 } 235 }
237 236
237 bool onAnimate(const SkAnimTimer&) override {
238 return true;
239 }
238 #if 0 240 #if 0
239 // TODO: switch over to use this for our animation 241 // TODO: switch over to use this for our animation
240 bool onAnimate(const SkAnimTimer& timer) override { 242 bool onAnimate(const SkAnimTimer& timer) override {
241 SkScalar angle = SkDoubleToScalar(fmod(timer.secs() * 360 / 24, 360)); 243 SkScalar angle = SkDoubleToScalar(fmod(timer.secs() * 360 / 24, 360));
242 fAnimatingDrawable->setSweep(angle); 244 fAnimatingDrawable->setSweep(angle);
243 return true; 245 return true;
244 } 246 }
245 #endif 247 #endif
246 248
247 private: 249 private:
248 typedef SampleView INHERITED; 250 typedef SampleView INHERITED;
249 }; 251 };
250 252
251 ////////////////////////////////////////////////////////////////////////////// 253 //////////////////////////////////////////////////////////////////////////////
252 254
253 DEF_SAMPLE( return new DrawAtlasView("DrawAtlas", draw_atlas); ) 255 DEF_SAMPLE( return new DrawAtlasView("DrawAtlas", draw_atlas); )
254 DEF_SAMPLE( return new DrawAtlasView("DrawAtlasSim", draw_atlas_sim); ) 256 DEF_SAMPLE( return new DrawAtlasView("DrawAtlasSim", draw_atlas_sim); )
OLDNEW
« no previous file with comments | « samplecode/SampleApp.cpp ('k') | samplecode/SampleClock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698