| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 68 |
| 69 /////////////////////////////////////////////////////////////////////////////// | 69 /////////////////////////////////////////////////////////////////////////////// |
| 70 | 70 |
| 71 class GradientsGM : public GM { | 71 class GradientsGM : public GM { |
| 72 public: | 72 public: |
| 73 GradientsGM() { | 73 GradientsGM() { |
| 74 this->setBGColor(0xFFDDDDDD); | 74 this->setBGColor(0xFFDDDDDD); |
| 75 } | 75 } |
| 76 | 76 |
| 77 protected: | 77 protected: |
| 78 virtual uint32_t onGetFlags() const SK_OVERRIDE { |
| 79 return kSkipTiled_Flag; |
| 80 } |
| 81 |
| 78 SkString onShortName() SK_OVERRIDE { return SkString("gradient_dirty_laundry
"); } | 82 SkString onShortName() SK_OVERRIDE { return SkString("gradient_dirty_laundry
"); } |
| 79 virtual SkISize onISize() SK_OVERRIDE { return make_isize(640, 615); } | 83 virtual SkISize onISize() SK_OVERRIDE { return make_isize(640, 615); } |
| 80 | 84 |
| 81 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 85 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
| 82 SkPoint pts[2] = { { 0, 0 }, | 86 SkPoint pts[2] = { { 0, 0 }, |
| 83 { SkIntToScalar(100), SkIntToScalar(100) } | 87 { SkIntToScalar(100), SkIntToScalar(100) } |
| 84 }; | 88 }; |
| 85 SkShader::TileMode tm = SkShader::kClamp_TileMode; | 89 SkShader::TileMode tm = SkShader::kClamp_TileMode; |
| 86 SkRect r = { 0, 0, SkIntToScalar(100), SkIntToScalar(100) }; | 90 SkRect r = { 0, 0, SkIntToScalar(100), SkIntToScalar(100) }; |
| 87 SkPaint paint; | 91 SkPaint paint; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 102 } | 106 } |
| 103 | 107 |
| 104 private: | 108 private: |
| 105 typedef GM INHERITED; | 109 typedef GM INHERITED; |
| 106 }; | 110 }; |
| 107 | 111 |
| 108 /////////////////////////////////////////////////////////////////////////////// | 112 /////////////////////////////////////////////////////////////////////////////// |
| 109 | 113 |
| 110 static GM* MyFactory(void*) { return new GradientsGM; } | 114 static GM* MyFactory(void*) { return new GradientsGM; } |
| 111 static GMRegistry reg(MyFactory); | 115 static GMRegistry reg(MyFactory); |
| OLD | NEW |