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 "SkPath.h" | 10 #include "SkPath.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 131 |
132 public: | 132 public: |
133 GammaShaderTextGM() { | 133 GammaShaderTextGM() { |
134 const SkColor colors[] = { SK_ColorBLACK, SK_ColorRED, SK_ColorBLUE }; | 134 const SkColor colors[] = { SK_ColorBLACK, SK_ColorRED, SK_ColorBLUE }; |
135 for (size_t i = 0; i < SK_ARRAY_COUNT(fShaders); ++i) { | 135 for (size_t i = 0; i < SK_ARRAY_COUNT(fShaders); ++i) { |
136 fShaders[i] = NULL; | 136 fShaders[i] = NULL; |
137 fColors[i] = colors[i]; | 137 fColors[i] = colors[i]; |
138 } | 138 } |
139 } | 139 } |
140 | 140 |
141 virtual ~GammaShaderTextGM() SK_OVERRIDE { | 141 ~GammaShaderTextGM() SK_OVERRIDE { |
142 for (size_t i = 0; i < SK_ARRAY_COUNT(fShaders); ++i) { | 142 for (size_t i = 0; i < SK_ARRAY_COUNT(fShaders); ++i) { |
143 SkSafeUnref(fShaders[i]); | 143 SkSafeUnref(fShaders[i]); |
144 } | 144 } |
145 } | 145 } |
146 | 146 |
147 protected: | 147 protected: |
148 SkString onShortName() SK_OVERRIDE { | 148 SkString onShortName() SK_OVERRIDE { |
149 return SkString("gammagradienttext"); | 149 return SkString("gammagradienttext"); |
150 } | 150 } |
151 | 151 |
(...skipping 20 matching lines...) Expand all Loading... |
172 canvas->translate(0, 80); | 172 canvas->translate(0, 80); |
173 } | 173 } |
174 } | 174 } |
175 | 175 |
176 private: | 176 private: |
177 typedef skiagm::GM INHERITED; | 177 typedef skiagm::GM INHERITED; |
178 }; | 178 }; |
179 | 179 |
180 DEF_GM( return new GammaShaderTextGM; ) | 180 DEF_GM( return new GammaShaderTextGM; ) |
181 | 181 |
OLD | NEW |