OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkGradientShader.h" | 10 #include "SkGradientShader.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 typedef GM INHERITED; | 93 typedef GM INHERITED; |
94 }; | 94 }; |
95 | 95 |
96 | 96 |
97 | 97 |
98 class GradTextGM : public GM { | 98 class GradTextGM : public GM { |
99 public: | 99 public: |
100 GradTextGM () {} | 100 GradTextGM () {} |
101 | 101 |
102 protected: | 102 protected: |
103 virtual uint32_t onGetFlags() const SK_OVERRIDE { | |
104 return kSkipTiled_Flag; | |
105 } | |
106 | |
107 | |
108 virtual SkString onShortName() { | 103 virtual SkString onShortName() { |
109 return SkString("gradtext"); | 104 return SkString("gradtext"); |
110 } | 105 } |
111 | 106 |
112 virtual SkISize onISize() { return SkISize::Make(500, 480); } | 107 virtual SkISize onISize() { return SkISize::Make(500, 480); } |
113 | 108 |
114 static void draw_text(SkCanvas* canvas, const SkPaint& paint) { | 109 static void draw_text(SkCanvas* canvas, const SkPaint& paint) { |
115 const char* text = "When in the course of human events"; | 110 const char* text = "When in the course of human events"; |
116 size_t len = strlen(text); | 111 size_t len = strlen(text); |
117 canvas->drawText(text, len, 0, 0, paint); | 112 canvas->drawText(text, len, 0, 0, paint); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 ////////////////////////////////////////////////////////////////////////////// | 156 ////////////////////////////////////////////////////////////////////////////// |
162 | 157 |
163 static GM* MyFactory(void*) { return new GradTextGM; } | 158 static GM* MyFactory(void*) { return new GradTextGM; } |
164 static GM* CMyFactory(void*) { return new ChromeGradTextGM1; } | 159 static GM* CMyFactory(void*) { return new ChromeGradTextGM1; } |
165 static GM* CMyFactory2(void*) { return new ChromeGradTextGM2; } | 160 static GM* CMyFactory2(void*) { return new ChromeGradTextGM2; } |
166 | 161 |
167 static GMRegistry reg(MyFactory); | 162 static GMRegistry reg(MyFactory); |
168 static GMRegistry Creg(CMyFactory); | 163 static GMRegistry Creg(CMyFactory); |
169 static GMRegistry Creg2(CMyFactory2); | 164 static GMRegistry Creg2(CMyFactory2); |
170 } | 165 } |
OLD | NEW |