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 | 7 |
8 #include "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkColor.h" | 9 #include "SkColor.h" |
10 #include "SkGradientShader.h" | 10 #include "SkGradientShader.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 namespace skiagm { | 114 namespace skiagm { |
115 | 115 |
116 class GradientMatrixGM : public GM { | 116 class GradientMatrixGM : public GM { |
117 public: | 117 public: |
118 GradientMatrixGM() { | 118 GradientMatrixGM() { |
119 this->setBGColor(0xFFDDDDDD); | 119 this->setBGColor(0xFFDDDDDD); |
120 } | 120 } |
121 | 121 |
122 protected: | 122 protected: |
123 uint32_t onGetFlags() const SK_OVERRIDE { | |
124 return kSkipTiled_Flag; | |
125 } | |
126 | 123 |
127 SkString onShortName() SK_OVERRIDE { | 124 SkString onShortName() SK_OVERRIDE { |
128 return SkString("gradient_matrix"); | 125 return SkString("gradient_matrix"); |
129 } | 126 } |
130 | 127 |
131 SkISize onISize() SK_OVERRIDE { | 128 SkISize onISize() SK_OVERRIDE { |
132 return SkISize::Make(800, 800); | 129 return SkISize::Make(800, 800); |
133 } | 130 } |
134 | 131 |
135 void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 132 void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
136 draw_gradients(canvas, &make_linear_gradient, | 133 draw_gradients(canvas, &make_linear_gradient, |
137 linearPts, SK_ARRAY_COUNT(linearPts)); | 134 linearPts, SK_ARRAY_COUNT(linearPts)); |
138 | 135 |
139 canvas->translate(0, TESTGRID_Y); | 136 canvas->translate(0, TESTGRID_Y); |
140 | 137 |
141 draw_gradients(canvas, &make_radial_gradient, | 138 draw_gradients(canvas, &make_radial_gradient, |
142 radialPts, SK_ARRAY_COUNT(radialPts)); | 139 radialPts, SK_ARRAY_COUNT(radialPts)); |
143 } | 140 } |
144 | 141 |
145 private: | 142 private: |
146 typedef GM INHERITED; | 143 typedef GM INHERITED; |
147 }; | 144 }; |
148 | 145 |
149 DEF_GM( return new GradientMatrixGM; ) | 146 DEF_GM( return new GradientMatrixGM; ) |
150 } | 147 } |
OLD | NEW |