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 #include "gm.h" | 8 #include "gm.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 //#include "SkParsePath.h" | 10 //#include "SkParsePath.h" |
11 #include "SkPath.h" | 11 #include "SkPath.h" |
12 //#include "SkRandom.h" | 12 //#include "SkRandom.h" |
13 | 13 |
14 namespace skiagm { | 14 namespace skiagm { |
15 | 15 |
16 static const SkColor gPathColor = SK_ColorBLACK; | 16 static const SkColor gPathColor = SK_ColorBLACK; |
17 static const SkColor gClipAColor = SK_ColorBLUE; | 17 static const SkColor gClipAColor = SK_ColorBLUE; |
18 static const SkColor gClipBColor = SK_ColorRED; | 18 static const SkColor gClipBColor = SK_ColorRED; |
19 | 19 |
20 class ComplexClipGM : public GM { | 20 class ComplexClipGM : public GM { |
21 public: | 21 public: |
22 ComplexClipGM(bool aaclip, bool saveLayer, bool invertDraw) | 22 ComplexClipGM(bool aaclip, bool saveLayer, bool invertDraw) |
23 : fDoAAClip(aaclip) | 23 : fDoAAClip(aaclip) |
24 , fDoSaveLayer(saveLayer) | 24 , fDoSaveLayer(saveLayer) |
25 , fInvertDraw(invertDraw) { | 25 , fInvertDraw(invertDraw) { |
26 this->setBGColor(0xFFDDDDDD); | 26 this->setBGColor(0xFFDDDDDD); |
27 } | 27 } |
28 | 28 |
29 protected: | 29 protected: |
30 virtual uint32_t onGetFlags() const SK_OVERRIDE { | 30 uint32_t onGetFlags() const SK_OVERRIDE { |
31 return kSkipTiled_Flag; | 31 return kSkipTiled_Flag; |
32 } | 32 } |
33 | 33 |
34 | 34 |
35 SkString onShortName() { | 35 SkString onShortName() { |
36 SkString str; | 36 SkString str; |
37 str.printf("complexclip_%s%s%s", | 37 str.printf("complexclip_%s%s%s", |
38 fDoAAClip ? "aa" : "bw", | 38 fDoAAClip ? "aa" : "bw", |
39 fDoSaveLayer ? "_layer" : "", | 39 fDoSaveLayer ? "_layer" : "", |
40 fInvertDraw ? "_invert" : ""); | 40 fInvertDraw ? "_invert" : ""); |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 DEF_GM( return SkNEW_ARGS(ComplexClipGM, (false, false, false)); ) | 206 DEF_GM( return SkNEW_ARGS(ComplexClipGM, (false, false, false)); ) |
207 DEF_GM( return SkNEW_ARGS(ComplexClipGM, (false, false, true)); ) | 207 DEF_GM( return SkNEW_ARGS(ComplexClipGM, (false, false, true)); ) |
208 DEF_GM( return SkNEW_ARGS(ComplexClipGM, (false, true, false)); ) | 208 DEF_GM( return SkNEW_ARGS(ComplexClipGM, (false, true, false)); ) |
209 DEF_GM( return SkNEW_ARGS(ComplexClipGM, (false, true, true)); ) | 209 DEF_GM( return SkNEW_ARGS(ComplexClipGM, (false, true, true)); ) |
210 DEF_GM( return SkNEW_ARGS(ComplexClipGM, (true, false, false)); ) | 210 DEF_GM( return SkNEW_ARGS(ComplexClipGM, (true, false, false)); ) |
211 DEF_GM( return SkNEW_ARGS(ComplexClipGM, (true, false, true)); ) | 211 DEF_GM( return SkNEW_ARGS(ComplexClipGM, (true, false, true)); ) |
212 DEF_GM( return SkNEW_ARGS(ComplexClipGM, (true, true, false)); ) | 212 DEF_GM( return SkNEW_ARGS(ComplexClipGM, (true, true, false)); ) |
213 DEF_GM( return SkNEW_ARGS(ComplexClipGM, (true, true, true)); ) | 213 DEF_GM( return SkNEW_ARGS(ComplexClipGM, (true, true, true)); ) |
214 | 214 |
215 } | 215 } |
OLD | NEW |