Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(282)

Side by Side Diff: samplecode/SampleMovie.cpp

Issue 96099: Whitespace fix: remove whitespace from the end of lines.
Patch Set: Created 16 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « samplecode/SampleMipMap.cpp ('k') | samplecode/SampleNinePatch.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 #include "SampleCode.h" 1 #include "SampleCode.h"
2 #include "SkView.h" 2 #include "SkView.h"
3 #include "SkCanvas.h" 3 #include "SkCanvas.h"
4 #include "SkMovie.h" 4 #include "SkMovie.h"
5 #include "SkTime.h" 5 #include "SkTime.h"
6 #include <new> 6 #include <new>
7 7
8 class AnimGifView : public SkView { 8 class AnimGifView : public SkView {
9 SkMovie* fMovie; 9 SkMovie* fMovie;
10 public: 10 public:
11 AnimGifView() { 11 AnimGifView() {
12 fMovie = SkMovie::DecodeFile("/skimages/dollarblk.gif"); 12 fMovie = SkMovie::DecodeFile("/skimages/dollarblk.gif");
13 } 13 }
14 14
15 virtual ~AnimGifView() { 15 virtual ~AnimGifView() {
16 fMovie->safeUnref(); 16 fMovie->safeUnref();
17 } 17 }
18 18
19 protected: 19 protected:
20 // overrides from SkEventSink 20 // overrides from SkEventSink
21 virtual bool onQuery(SkEvent* evt) { 21 virtual bool onQuery(SkEvent* evt) {
22 if (SampleCode::TitleQ(*evt)) { 22 if (SampleCode::TitleQ(*evt)) {
23 SampleCode::TitleR(evt, "Animated Gif"); 23 SampleCode::TitleR(evt, "Animated Gif");
24 return true; 24 return true;
25 } 25 }
26 return this->INHERITED::onQuery(evt); 26 return this->INHERITED::onQuery(evt);
27 } 27 }
28 28
29 void drawBG(SkCanvas* canvas) { 29 void drawBG(SkCanvas* canvas) {
30 canvas->drawColor(0xFFDDDDDD); 30 canvas->drawColor(0xFFDDDDDD);
31 } 31 }
32 32
33 virtual void onDraw(SkCanvas* canvas) { 33 virtual void onDraw(SkCanvas* canvas) {
34 this->drawBG(canvas); 34 this->drawBG(canvas);
35 35
36 if (fMovie) { 36 if (fMovie) {
37 if (fMovie->duration()) { 37 if (fMovie->duration()) {
38 fMovie->setTime(SkTime::GetMSecs() % fMovie->duration()); 38 fMovie->setTime(SkTime::GetMSecs() % fMovie->duration());
39 } else { 39 } else {
40 fMovie->setTime(0); 40 fMovie->setTime(0);
41 } 41 }
42 canvas->drawBitmap(fMovie->bitmap(), SkIntToScalar(20), 42 canvas->drawBitmap(fMovie->bitmap(), SkIntToScalar(20),
43 SkIntToScalar(20)); 43 SkIntToScalar(20));
44 this->inval(NULL); 44 this->inval(NULL);
45 } 45 }
46 } 46 }
47 47
48 private: 48 private:
49 SkRect fClip; 49 SkRect fClip;
50 SkIPoint* fPoints; 50 SkIPoint* fPoints;
51 SkPath fPath; 51 SkPath fPath;
52 int fPtCount; 52 int fPtCount;
53 53
54 typedef SkView INHERITED; 54 typedef SkView INHERITED;
55 }; 55 };
56 56
57 ////////////////////////////////////////////////////////////////////////////// 57 //////////////////////////////////////////////////////////////////////////////
58 58
59 static SkView* MyFactory() { return new AnimGifView; } 59 static SkView* MyFactory() { return new AnimGifView; }
60 static SkViewRegister reg(MyFactory); 60 static SkViewRegister reg(MyFactory);
61 61
OLDNEW
« no previous file with comments | « samplecode/SampleMipMap.cpp ('k') | samplecode/SampleNinePatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b