| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 #include "gm.h" | 7 #include "gm.h" |
| 8 #include "SkGradientShader.h" | 8 #include "SkGradientShader.h" |
| 9 | 9 |
| 10 using namespace skiagm; | 10 using namespace skiagm; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 static const GradMaker gGradMakers[] = { | 75 static const GradMaker gGradMakers[] = { |
| 76 MakeLinear, MakeRadial, MakeSweep, Make2Radial, Make2Conical, | 76 MakeLinear, MakeRadial, MakeSweep, Make2Radial, Make2Conical, |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 /////////////////////////////////////////////////////////////////////////////// | 79 /////////////////////////////////////////////////////////////////////////////// |
| 80 | 80 |
| 81 class GradientsNoTextureGM : public GM { | 81 class GradientsNoTextureGM : public GM { |
| 82 public: | 82 public: |
| 83 GradientsNoTextureGM() { | 83 GradientsNoTextureGM() { |
| 84 this->setBGColor(0xFFDDDDDD); | 84 this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD)); |
| 85 } | 85 } |
| 86 | 86 |
| 87 protected: | 87 protected: |
| 88 | 88 |
| 89 SkString onShortName() override { return SkString("gradients_no_texture"); } | 89 SkString onShortName() override { return SkString("gradients_no_texture"); } |
| 90 SkISize onISize() override { return SkISize::Make(640, 615); } | 90 SkISize onISize() override { return SkISize::Make(640, 615); } |
| 91 | 91 |
| 92 void onDraw(SkCanvas* canvas) override { | 92 void onDraw(SkCanvas* canvas) override { |
| 93 static const SkPoint kPts[2] = { { 0, 0 }, | 93 static const SkPoint kPts[2] = { { 0, 0 }, |
| 94 { SkIntToScalar(50), SkIntToScalar(50)
} }; | 94 { SkIntToScalar(50), SkIntToScalar(50)
} }; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 } | 243 } |
| 244 | 244 |
| 245 private: | 245 private: |
| 246 typedef GM INHERITED; | 246 typedef GM INHERITED; |
| 247 }; | 247 }; |
| 248 | 248 |
| 249 /////////////////////////////////////////////////////////////////////////////// | 249 /////////////////////////////////////////////////////////////////////////////// |
| 250 | 250 |
| 251 DEF_GM( return SkNEW(GradientsNoTextureGM)); | 251 DEF_GM( return SkNEW(GradientsNoTextureGM)); |
| 252 DEF_GM( return SkNEW(GradientsManyColorsGM)); | 252 DEF_GM( return SkNEW(GradientsManyColorsGM)); |
| OLD | NEW |