OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 static const GradMaker gGradMakers[] = { | 60 static const GradMaker gGradMakers[] = { |
61 MakeLinear, MakeRadial, MakeSweep, | 61 MakeLinear, MakeRadial, MakeSweep, |
62 }; | 62 }; |
63 | 63 |
64 /////////////////////////////////////////////////////////////////////////////// | 64 /////////////////////////////////////////////////////////////////////////////// |
65 | 65 |
66 class GradientsGM : public GM { | 66 class GradientsGM : public GM { |
67 public: | 67 public: |
68 GradientsGM() { | 68 GradientsGM() { |
69 this->setBGColor(0xFFDDDDDD); | 69 this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD)); |
70 } | 70 } |
71 | 71 |
72 protected: | 72 protected: |
73 SkString onShortName() override { return SkString("gradient_dirty_laundry");
} | 73 SkString onShortName() override { return SkString("gradient_dirty_laundry");
} |
74 SkISize onISize() override { return SkISize::Make(640, 615); } | 74 SkISize onISize() override { return SkISize::Make(640, 615); } |
75 | 75 |
76 void onDraw(SkCanvas* canvas) override { | 76 void onDraw(SkCanvas* canvas) override { |
77 SkPoint pts[2] = { { 0, 0 }, | 77 SkPoint pts[2] = { { 0, 0 }, |
78 { SkIntToScalar(100), SkIntToScalar(100) } | 78 { SkIntToScalar(100), SkIntToScalar(100) } |
79 }; | 79 }; |
(...skipping 17 matching lines...) Expand all Loading... |
97 } | 97 } |
98 | 98 |
99 private: | 99 private: |
100 typedef GM INHERITED; | 100 typedef GM INHERITED; |
101 }; | 101 }; |
102 | 102 |
103 /////////////////////////////////////////////////////////////////////////////// | 103 /////////////////////////////////////////////////////////////////////////////// |
104 | 104 |
105 static GM* MyFactory(void*) { return new GradientsGM; } | 105 static GM* MyFactory(void*) { return new GradientsGM; } |
106 static GMRegistry reg(MyFactory); | 106 static GMRegistry reg(MyFactory); |
OLD | NEW |