| 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 { | 24 uint32_t onGetFlags() const SK_OVERRIDE { |
| 25 return kSkipTiled_Flag | kSkipGPU_Flag; | 25 return kSkipTiled_Flag; |
| 26 } | 26 } |
| 27 | 27 |
| 28 SkString onShortName() { | 28 SkString onShortName() { |
| 29 SkString str; | 29 SkString str; |
| 30 str.printf("complexclip3_%s", fDoSimpleClipFirst ? "simple" : "complex")
; | 30 str.printf("complexclip3_%s", fDoSimpleClipFirst ? "simple" : "complex")
; |
| 31 return str; | 31 return str; |
| 32 } | 32 } |
| 33 | 33 |
| 34 SkISize onISize() { return SkISize::Make(1000, 950); } | 34 SkISize onISize() { return SkISize::Make(1000, 950); } |
| 35 | 35 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 typedef GM INHERITED; | 127 typedef GM INHERITED; |
| 128 }; | 128 }; |
| 129 | 129 |
| 130 ////////////////////////////////////////////////////////////////////////////// | 130 ////////////////////////////////////////////////////////////////////////////// |
| 131 | 131 |
| 132 // Simple clip first | 132 // Simple clip first |
| 133 DEF_GM( return new ComplexClip3GM(true); ) | 133 DEF_GM( return new ComplexClip3GM(true); ) |
| 134 // Complex clip first | 134 // Complex clip first |
| 135 DEF_GM( return new ComplexClip3GM(false); ) | 135 DEF_GM( return new ComplexClip3GM(false); ) |
| 136 } | 136 } |
| OLD | NEW |