OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "SkGradientShader.h" | 9 #include "SkGradientShader.h" |
10 | 10 |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 kOutside_GradCaseType, | 299 kOutside_GradCaseType, |
300 kInside_GradCaseType, | 300 kInside_GradCaseType, |
301 kEdge_GradCaseType, | 301 kEdge_GradCaseType, |
302 }; | 302 }; |
303 | 303 |
304 /////////////////////////////////////////////////////////////////////////////// | 304 /////////////////////////////////////////////////////////////////////////////// |
305 | 305 |
306 class ConicalGradientsGM : public GM { | 306 class ConicalGradientsGM : public GM { |
307 public: | 307 public: |
308 ConicalGradientsGM(GradCaseType gradCaseType) { | 308 ConicalGradientsGM(GradCaseType gradCaseType) { |
309 this->setBGColor(0xFFDDDDDD); | 309 this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD)); |
310 fName.printf("gradients_2pt_conical_%s", gGradCases[gradCaseType].fName)
; | 310 fName.printf("gradients_2pt_conical_%s", gGradCases[gradCaseType].fName)
; |
311 fGradCaseType = gradCaseType; | 311 fGradCaseType = gradCaseType; |
312 } | 312 } |
313 | 313 |
314 protected: | 314 protected: |
315 SkString onShortName() { | 315 SkString onShortName() { |
316 return fName; | 316 return fName; |
317 } | 317 } |
318 | 318 |
319 virtual SkISize onISize() { return SkISize::Make(840, 815); } | 319 virtual SkISize onISize() { return SkISize::Make(840, 815); } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 | 365 |
366 static GM* MyFactory1(void*) { return new ConicalGradientsGM(kInside_GradCaseTyp
e); } | 366 static GM* MyFactory1(void*) { return new ConicalGradientsGM(kInside_GradCaseTyp
e); } |
367 static GMRegistry reg1(MyFactory1); | 367 static GMRegistry reg1(MyFactory1); |
368 | 368 |
369 static GM* MyFactory2(void*) { return new ConicalGradientsGM(kOutside_GradCaseTy
pe); } | 369 static GM* MyFactory2(void*) { return new ConicalGradientsGM(kOutside_GradCaseTy
pe); } |
370 static GMRegistry reg2(MyFactory2); | 370 static GMRegistry reg2(MyFactory2); |
371 | 371 |
372 static GM* MyFactory3(void*) { return new ConicalGradientsGM(kEdge_GradCaseType)
; } | 372 static GM* MyFactory3(void*) { return new ConicalGradientsGM(kEdge_GradCaseType)
; } |
373 static GMRegistry reg3(MyFactory3); | 373 static GMRegistry reg3(MyFactory3); |
374 } | 374 } |
OLD | NEW |