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 #ifndef skiagm_DEFINED | 8 #ifndef skiagm_DEFINED |
9 #define skiagm_DEFINED | 9 #define skiagm_DEFINED |
10 | 10 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 void setCanvasIsDeferred(bool isDeferred) { | 86 void setCanvasIsDeferred(bool isDeferred) { |
87 fCanvasIsDeferred = isDeferred; | 87 fCanvasIsDeferred = isDeferred; |
88 } | 88 } |
89 | 89 |
90 const SkMatrix& getStarterMatrix() { return fStarterMatrix; } | 90 const SkMatrix& getStarterMatrix() { return fStarterMatrix; } |
91 void setStarterMatrix(const SkMatrix& matrix) { | 91 void setStarterMatrix(const SkMatrix& matrix) { |
92 fStarterMatrix = matrix; | 92 fStarterMatrix = matrix; |
93 } | 93 } |
94 | 94 |
95 protected: | 95 protected: |
| 96 /** draws a standard message that the GM is only intended to be used wit
h the GPU.*/ |
| 97 void drawGpuOnlyMessage(SkCanvas* |
| 98 ); |
96 virtual void onOnceBeforeDraw() {} | 99 virtual void onOnceBeforeDraw() {} |
97 virtual void onDraw(SkCanvas*) = 0; | 100 virtual void onDraw(SkCanvas*) = 0; |
98 virtual void onDrawBackground(SkCanvas*); | 101 virtual void onDrawBackground(SkCanvas*); |
99 virtual SkISize onISize() = 0; | 102 virtual SkISize onISize() = 0; |
100 virtual SkString onShortName() = 0; | 103 virtual SkString onShortName() = 0; |
101 | 104 |
102 virtual SkMatrix onGetInitialTransform() const { return SkMatrix::I(); } | 105 virtual SkMatrix onGetInitialTransform() const { return SkMatrix::I(); } |
103 | 106 |
104 private: | 107 private: |
105 Mode fMode; | 108 Mode fMode; |
(...skipping 17 matching lines...) Expand all Loading... |
123 SkISize onISize() SK_OVERRIDE; | 126 SkISize onISize() SK_OVERRIDE; |
124 SkString onShortName() SK_OVERRIDE; | 127 SkString onShortName() SK_OVERRIDE; |
125 private: | 128 private: |
126 SkString fName; | 129 SkString fName; |
127 void (*fDrawProc)(SkCanvas*); | 130 void (*fDrawProc)(SkCanvas*); |
128 SkISize fSize; | 131 SkISize fSize; |
129 }; | 132 }; |
130 } | 133 } |
131 | 134 |
132 #endif | 135 #endif |
OLD | NEW |