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

Side by Side Diff: gm/gm.h

Issue 2316593003: Add GM/slide to simulate Android-style reveal clip (Closed)
Patch Set: address code review comments Created 4 years, 3 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 | « no previous file | gm/reveal.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 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 #ifndef skiagm_DEFINED 8 #ifndef skiagm_DEFINED
9 #define skiagm_DEFINED 9 #define skiagm_DEFINED
10 10
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 void setCanvasIsDeferred(bool isDeferred) { 93 void setCanvasIsDeferred(bool isDeferred) {
94 fCanvasIsDeferred = isDeferred; 94 fCanvasIsDeferred = isDeferred;
95 } 95 }
96 96
97 const SkMatrix& getStarterMatrix() { return fStarterMatrix; } 97 const SkMatrix& getStarterMatrix() { return fStarterMatrix; }
98 void setStarterMatrix(const SkMatrix& matrix) { 98 void setStarterMatrix(const SkMatrix& matrix) {
99 fStarterMatrix = matrix; 99 fStarterMatrix = matrix;
100 } 100 }
101 101
102 bool animate(const SkAnimTimer&); 102 bool animate(const SkAnimTimer&);
103 bool handleKey(SkUnichar uni) {
104 return this->onHandleKey(uni);
105 }
103 106
104 virtual void modifyGrContextOptions(GrContextOptions* options) {} 107 virtual void modifyGrContextOptions(GrContextOptions* options) {}
105 108
106 /** draws a standard message that the GM is only intended to be used wit h the GPU.*/ 109 /** draws a standard message that the GM is only intended to be used wit h the GPU.*/
107 static void DrawGpuOnlyMessage(SkCanvas*); 110 static void DrawGpuOnlyMessage(SkCanvas*);
108 111
109 protected: 112 protected:
110 virtual void onOnceBeforeDraw() {} 113 virtual void onOnceBeforeDraw() {}
111 virtual void onDraw(SkCanvas*) = 0; 114 virtual void onDraw(SkCanvas*) = 0;
112 virtual void onDrawBackground(SkCanvas*); 115 virtual void onDrawBackground(SkCanvas*);
113 virtual SkISize onISize() = 0; 116 virtual SkISize onISize() = 0;
114 virtual SkString onShortName() = 0; 117 virtual SkString onShortName() = 0;
115 118
116 virtual bool onAnimate(const SkAnimTimer&) { return false; } 119 virtual bool onAnimate(const SkAnimTimer&) { return false; }
120 virtual bool onHandleKey(SkUnichar uni) { return false; }
117 virtual SkMatrix onGetInitialTransform() const { return SkMatrix::I(); } 121 virtual SkMatrix onGetInitialTransform() const { return SkMatrix::I(); }
118 122
119 private: 123 private:
120 Mode fMode; 124 Mode fMode;
121 SkString fShortName; 125 SkString fShortName;
122 SkColor fBGColor; 126 SkColor fBGColor;
123 bool fCanvasIsDeferred; // work-around problem in srcmode.cpp 127 bool fCanvasIsDeferred; // work-around problem in srcmode.cpp
124 bool fHaveCalledOnceBeforeDraw; 128 bool fHaveCalledOnceBeforeDraw;
125 SkMatrix fStarterMatrix; 129 SkMatrix fStarterMatrix;
126 }; 130 };
(...skipping 16 matching lines...) Expand all
143 SkISize onISize() override; 147 SkISize onISize() override;
144 SkString onShortName() override; 148 SkString onShortName() override;
145 private: 149 private:
146 SkString fName; 150 SkString fName;
147 void (*fDrawProc)(SkCanvas*); 151 void (*fDrawProc)(SkCanvas*);
148 SkISize fSize; 152 SkISize fSize;
149 }; 153 };
150 } 154 }
151 155
152 #endif 156 #endif
OLDNEW
« no previous file with comments | « no previous file | gm/reveal.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698