OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 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 #include "gm.h" | 8 #include "gm.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkRandom.h" | 10 #include "SkRandom.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 p.setAntiAlias(true); | 157 p.setAntiAlias(true); |
158 p.setColor(color); | 158 p.setColor(color); |
159 p.setXfermodeMode(mode); | 159 p.setXfermodeMode(mode); |
160 canvas->save(); | 160 canvas->save(); |
161 canvas->translate(dx, dy); | 161 canvas->translate(dx, dy); |
162 canvas->scale(s, s); | 162 canvas->scale(s, s); |
163 this->drawShape(canvas, p, shapeType); | 163 this->drawShape(canvas, p, shapeType); |
164 canvas->restore(); | 164 canvas->restore(); |
165 } | 165 } |
166 | 166 |
167 virtual uint32_t onGetFlags() const { | |
168 // Skip PDF rasterization since rendering this PDF takes forever. | |
169 return kSkipPDFRasterization_Flag | kSkipTiled_Flag; | |
170 } | |
171 | |
172 private: | 167 private: |
173 enum { | 168 enum { |
174 kNumShapes = 100, | 169 kNumShapes = 100, |
175 }; | 170 }; |
176 SkAutoTUnref<SkShader> fBG; | 171 SkAutoTUnref<SkShader> fBG; |
177 SkPath fConcavePath; | 172 SkPath fConcavePath; |
178 SkPath fConvexPath; | 173 SkPath fConvexPath; |
179 typedef GM INHERITED; | 174 typedef GM INHERITED; |
180 }; | 175 }; |
181 | 176 |
182 ////////////////////////////////////////////////////////////////////////////// | 177 ////////////////////////////////////////////////////////////////////////////// |
183 | 178 |
184 static GM* MyFactory(void*) { return new MixedXfermodesGM; } | 179 static GM* MyFactory(void*) { return new MixedXfermodesGM; } |
185 static GMRegistry reg(MyFactory); | 180 static GMRegistry reg(MyFactory); |
186 | 181 |
187 } | 182 } |
OLD | NEW |