OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 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 "SkPath.h" | 10 #include "SkPath.h" |
11 | 11 |
12 namespace skiagm { | 12 namespace skiagm { |
13 | 13 |
14 static const SkColor gPathColor = SK_ColorYELLOW; | 14 static const SkColor gPathColor = SK_ColorYELLOW; |
15 | 15 |
16 class ComplexClip3GM : public GM { | 16 class ComplexClip3GM : public GM { |
17 public: | 17 public: |
18 ComplexClip3GM(bool doSimpleClipFirst) | 18 ComplexClip3GM(bool doSimpleClipFirst) |
19 : fDoSimpleClipFirst(doSimpleClipFirst) { | 19 : fDoSimpleClipFirst(doSimpleClipFirst) { |
20 this->setBGColor(0xFFDDDDDD); | 20 this->setBGColor(0xFFDDDDDD); |
21 } | 21 } |
22 | 22 |
23 protected: | 23 protected: |
24 uint32_t onGetFlags() const SK_OVERRIDE { | |
25 return kSkipTiled_Flag; | |
26 } | |
27 | 24 |
28 SkString onShortName() { | 25 SkString onShortName() { |
29 SkString str; | 26 SkString str; |
30 str.printf("complexclip3_%s", fDoSimpleClipFirst ? "simple" : "complex")
; | 27 str.printf("complexclip3_%s", fDoSimpleClipFirst ? "simple" : "complex")
; |
31 return str; | 28 return str; |
32 } | 29 } |
33 | 30 |
34 SkISize onISize() { return SkISize::Make(1000, 950); } | 31 SkISize onISize() { return SkISize::Make(1000, 950); } |
35 | 32 |
36 virtual void onDraw(SkCanvas* canvas) { | 33 virtual void onDraw(SkCanvas* canvas) { |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 typedef GM INHERITED; | 124 typedef GM INHERITED; |
128 }; | 125 }; |
129 | 126 |
130 ////////////////////////////////////////////////////////////////////////////// | 127 ////////////////////////////////////////////////////////////////////////////// |
131 | 128 |
132 // Simple clip first | 129 // Simple clip first |
133 DEF_GM( return new ComplexClip3GM(true); ) | 130 DEF_GM( return new ComplexClip3GM(true); ) |
134 // Complex clip first | 131 // Complex clip first |
135 DEF_GM( return new ComplexClip3GM(false); ) | 132 DEF_GM( return new ComplexClip3GM(false); ) |
136 } | 133 } |
OLD | NEW |