OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "gm.h" | 8 #include "gm.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkGraphics.h" | 10 #include "SkGraphics.h" |
11 #include "SkRandom.h" | 11 #include "SkRandom.h" |
12 #include "SkLayerDrawLooper.h" | 12 #include "SkLayerDrawLooper.h" |
13 #include "SkBlurMaskFilter.h" | 13 #include "SkBlurMaskFilter.h" |
14 | 14 |
15 static SkRect inset(const SkRect& r) { | 15 static SkRect inset(const SkRect& r) { |
16 SkRect rect = r; | 16 SkRect rect = r; |
17 rect.inset(r.width() / 8, r.height() / 8); | 17 rect.inset(r.width() / 8, r.height() / 8); |
18 return rect; | 18 return rect; |
19 } | 19 } |
20 | 20 |
21 class PathInteriorGM : public skiagm::GM { | 21 class PathInteriorGM : public skiagm::GM { |
22 public: | 22 public: |
23 PathInteriorGM() { | 23 PathInteriorGM() { |
24 this->setBGColor(0xFFDDDDDD); | 24 this->setBGColor(0xFFDDDDDD); |
25 } | 25 } |
26 | 26 |
27 protected: | 27 protected: |
| 28 virtual uint32_t onGetFlags() const SK_OVERRIDE { |
| 29 return kSkipTiled_Flag; |
| 30 } |
| 31 |
28 virtual SkISize onISize() { | 32 virtual SkISize onISize() { |
29 return SkISize::Make(770, 770); | 33 return SkISize::Make(770, 770); |
30 } | 34 } |
31 | 35 |
32 virtual SkString onShortName() SK_OVERRIDE { | 36 virtual SkString onShortName() SK_OVERRIDE { |
33 return SkString("pathinterior"); | 37 return SkString("pathinterior"); |
34 } | 38 } |
35 | 39 |
36 void show(SkCanvas* canvas, const SkPath& path) { | 40 void show(SkCanvas* canvas, const SkPath& path) { |
37 SkPaint paint; | 41 SkPaint paint; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 108 |
105 private: | 109 private: |
106 | 110 |
107 typedef GM INHERITED; | 111 typedef GM INHERITED; |
108 }; | 112 }; |
109 | 113 |
110 ////////////////////////////////////////////////////////////////////////////// | 114 ////////////////////////////////////////////////////////////////////////////// |
111 | 115 |
112 static skiagm::GM* MyFactory(void*) { return new PathInteriorGM; } | 116 static skiagm::GM* MyFactory(void*) { return new PathInteriorGM; } |
113 static skiagm::GMRegistry reg(MyFactory); | 117 static skiagm::GMRegistry reg(MyFactory); |
OLD | NEW |