| 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 "SkGradientShader.h" | 9 #include "SkGradientShader.h" |
| 10 | 10 |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 | 332 |
| 333 class ConicalGradientsGM : public GM { | 333 class ConicalGradientsGM : public GM { |
| 334 public: | 334 public: |
| 335 ConicalGradientsGM(GradCaseType gradCaseType) { | 335 ConicalGradientsGM(GradCaseType gradCaseType) { |
| 336 this->setBGColor(0xFFDDDDDD); | 336 this->setBGColor(0xFFDDDDDD); |
| 337 fName.printf("gradients_2pt_conical_%s", gGradCases[gradCaseType].fName)
; | 337 fName.printf("gradients_2pt_conical_%s", gGradCases[gradCaseType].fName)
; |
| 338 fGradCaseType = gradCaseType; | 338 fGradCaseType = gradCaseType; |
| 339 } | 339 } |
| 340 | 340 |
| 341 protected: | 341 protected: |
| 342 virtual uint32_t onGetFlags() const SK_OVERRIDE { |
| 343 if (fGradCaseType != kInside_GradCaseType) { |
| 344 return kSkipTiled_Flag; |
| 345 } |
| 346 return 0; |
| 347 } |
| 348 |
| 342 SkString onShortName() { | 349 SkString onShortName() { |
| 343 return fName; | 350 return fName; |
| 344 } | 351 } |
| 345 | 352 |
| 346 virtual SkISize onISize() { return SkISize::Make(840, 815); } | 353 virtual SkISize onISize() { return SkISize::Make(840, 815); } |
| 347 | 354 |
| 348 virtual void onDraw(SkCanvas* canvas) { | 355 virtual void onDraw(SkCanvas* canvas) { |
| 349 | 356 |
| 350 SkPoint pts[2] = { | 357 SkPoint pts[2] = { |
| 351 { 0, 0 }, | 358 { 0, 0 }, |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 | 399 |
| 393 static GM* MyFactory1(void*) { return new ConicalGradientsGM(kInside_GradCaseTyp
e); } | 400 static GM* MyFactory1(void*) { return new ConicalGradientsGM(kInside_GradCaseTyp
e); } |
| 394 static GMRegistry reg1(MyFactory1); | 401 static GMRegistry reg1(MyFactory1); |
| 395 | 402 |
| 396 static GM* MyFactory2(void*) { return new ConicalGradientsGM(kOutside_GradCaseTy
pe); } | 403 static GM* MyFactory2(void*) { return new ConicalGradientsGM(kOutside_GradCaseTy
pe); } |
| 397 static GMRegistry reg2(MyFactory2); | 404 static GMRegistry reg2(MyFactory2); |
| 398 | 405 |
| 399 static GM* MyFactory3(void*) { return new ConicalGradientsGM(kEdge_GradCaseType)
; } | 406 static GM* MyFactory3(void*) { return new ConicalGradientsGM(kEdge_GradCaseType)
; } |
| 400 static GMRegistry reg3(MyFactory3); | 407 static GMRegistry reg3(MyFactory3); |
| 401 } | 408 } |
| OLD | NEW |