| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 class ClampedGradientsGM : public GM { | 289 class ClampedGradientsGM : public GM { |
| 290 public: | 290 public: |
| 291 ClampedGradientsGM() {} | 291 ClampedGradientsGM() {} |
| 292 | 292 |
| 293 protected: | 293 protected: |
| 294 SkString onShortName() { return SkString("clamped_gradients"); } | 294 SkString onShortName() { return SkString("clamped_gradients"); } |
| 295 | 295 |
| 296 virtual SkISize onISize() { return SkISize::Make(640, 510); } | 296 virtual SkISize onISize() { return SkISize::Make(640, 510); } |
| 297 | 297 |
| 298 void drawBG(SkCanvas* canvas) { | 298 void drawBG(SkCanvas* canvas) { |
| 299 canvas->drawColor(0xFFDDDDDD); | 299 canvas->drawColor(sk_tool_utils::color_to_565(0xFFDDDDDD)); |
| 300 } | 300 } |
| 301 | 301 |
| 302 virtual void onDraw(SkCanvas* canvas) { | 302 virtual void onDraw(SkCanvas* canvas) { |
| 303 this->drawBG(canvas); | 303 this->drawBG(canvas); |
| 304 | 304 |
| 305 SkRect r = { 0, 0, SkIntToScalar(100), SkIntToScalar(300) }; | 305 SkRect r = { 0, 0, SkIntToScalar(100), SkIntToScalar(300) }; |
| 306 SkPaint paint; | 306 SkPaint paint; |
| 307 paint.setAntiAlias(true); | 307 paint.setAntiAlias(true); |
| 308 | 308 |
| 309 SkPoint center; | 309 SkPoint center; |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 paint.setShader(fShader); | 454 paint.setShader(fShader); |
| 455 canvas->drawRect(SkRect::MakeWH(500, 500), paint); | 455 canvas->drawRect(SkRect::MakeWH(500, 500), paint); |
| 456 } | 456 } |
| 457 | 457 |
| 458 private: | 458 private: |
| 459 typedef GM INHERITED; | 459 typedef GM INHERITED; |
| 460 }; | 460 }; |
| 461 DEF_GM( return new RadialGradient3GM; ) | 461 DEF_GM( return new RadialGradient3GM; ) |
| 462 | 462 |
| 463 } | 463 } |
| OLD | NEW |