OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #ifndef skiagm_DEFINED | 8 #ifndef skiagm_DEFINED |
9 #define skiagm_DEFINED | 9 #define skiagm_DEFINED |
10 | 10 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 | 92 |
93 static SkString& GetResourcePath() { | 93 static SkString& GetResourcePath() { |
94 return gResourcePath; | 94 return gResourcePath; |
95 } | 95 } |
96 | 96 |
97 bool isCanvasDeferred() const { return fCanvasIsDeferred; } | 97 bool isCanvasDeferred() const { return fCanvasIsDeferred; } |
98 void setCanvasIsDeferred(bool isDeferred) { | 98 void setCanvasIsDeferred(bool isDeferred) { |
99 fCanvasIsDeferred = isDeferred; | 99 fCanvasIsDeferred = isDeferred; |
100 } | 100 } |
101 | 101 |
102 #if SK_SUPPORT_GPU | |
103 static GrContext* GetGr(/*very nearly const*/ SkCanvas*); | |
104 #endif | |
105 | |
106 const SkMatrix& getStarterMatrix() { return fStarterMatrix; } | 102 const SkMatrix& getStarterMatrix() { return fStarterMatrix; } |
107 void setStarterMatrix(const SkMatrix& matrix) { | 103 void setStarterMatrix(const SkMatrix& matrix) { |
108 fStarterMatrix = matrix; | 104 fStarterMatrix = matrix; |
109 } | 105 } |
110 | 106 |
111 protected: | 107 protected: |
112 static SkString gResourcePath; | 108 static SkString gResourcePath; |
113 | 109 |
114 virtual void onOnceBeforeDraw() {} | 110 virtual void onOnceBeforeDraw() {} |
115 virtual void onDraw(SkCanvas*) = 0; | 111 virtual void onDraw(SkCanvas*) = 0; |
116 virtual void onDrawBackground(SkCanvas*); | 112 virtual void onDrawBackground(SkCanvas*); |
117 virtual SkISize onISize() = 0; | 113 virtual SkISize onISize() = 0; |
118 virtual SkString onShortName() = 0; | 114 virtual SkString onShortName() = 0; |
119 virtual uint32_t onGetFlags() const { return 0; } | 115 virtual uint32_t onGetFlags() const { return 0; } |
120 virtual SkMatrix onGetInitialTransform() const { return SkMatrix::I(); } | 116 virtual SkMatrix onGetInitialTransform() const { return SkMatrix::I(); } |
121 | 117 |
122 private: | 118 private: |
123 SkString fShortName; | 119 SkString fShortName; |
124 SkColor fBGColor; | 120 SkColor fBGColor; |
125 bool fCanvasIsDeferred; // work-around problem in srcmode.cpp | 121 bool fCanvasIsDeferred; // work-around problem in srcmode.cpp |
126 bool fHaveCalledOnceBeforeDraw; | 122 bool fHaveCalledOnceBeforeDraw; |
127 SkMatrix fStarterMatrix; | 123 SkMatrix fStarterMatrix; |
128 }; | 124 }; |
129 | 125 |
130 typedef SkTRegistry<GM*(*)(void*)> GMRegistry; | 126 typedef SkTRegistry<GM*(*)(void*)> GMRegistry; |
131 } | 127 } |
132 | 128 |
133 #endif | 129 #endif |
OLD | NEW |