| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 GradientsNoTextureGM() { | 83 GradientsNoTextureGM() { |
| 84 this->setBGColor(0xFFDDDDDD); | 84 this->setBGColor(0xFFDDDDDD); |
| 85 } | 85 } |
| 86 | 86 |
| 87 protected: | 87 protected: |
| 88 virtual uint32_t onGetFlags() const SK_OVERRIDE { | 88 virtual uint32_t onGetFlags() const SK_OVERRIDE { |
| 89 return kSkipTiled_Flag; | 89 return kSkipTiled_Flag; |
| 90 } | 90 } |
| 91 | 91 |
| 92 SkString onShortName() SK_OVERRIDE { return SkString("gradients_no_texture")
; } | 92 SkString onShortName() SK_OVERRIDE { return SkString("gradients_no_texture")
; } |
| 93 virtual SkISize onISize() SK_OVERRIDE { return make_isize(640, 615); } | 93 virtual SkISize onISize() SK_OVERRIDE { return SkISize::Make(640, 615); } |
| 94 | 94 |
| 95 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 95 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
| 96 static const SkPoint kPts[2] = { { 0, 0 }, | 96 static const SkPoint kPts[2] = { { 0, 0 }, |
| 97 { SkIntToScalar(50), SkIntToScalar(50)
} }; | 97 { SkIntToScalar(50), SkIntToScalar(50)
} }; |
| 98 static const SkShader::TileMode kTM = SkShader::kClamp_TileMode; | 98 static const SkShader::TileMode kTM = SkShader::kClamp_TileMode; |
| 99 SkRect kRect = { 0, 0, SkIntToScalar(50), SkIntToScalar(50) }; | 99 SkRect kRect = { 0, 0, SkIntToScalar(50), SkIntToScalar(50) }; |
| 100 SkPaint paint; | 100 SkPaint paint; |
| 101 paint.setAntiAlias(true); | 101 paint.setAntiAlias(true); |
| 102 | 102 |
| 103 canvas->translate(SkIntToScalar(20), SkIntToScalar(20)); | 103 canvas->translate(SkIntToScalar(20), SkIntToScalar(20)); |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 } | 249 } |
| 250 | 250 |
| 251 private: | 251 private: |
| 252 typedef GM INHERITED; | 252 typedef GM INHERITED; |
| 253 }; | 253 }; |
| 254 | 254 |
| 255 /////////////////////////////////////////////////////////////////////////////// | 255 /////////////////////////////////////////////////////////////////////////////// |
| 256 | 256 |
| 257 DEF_GM( return SkNEW(GradientsNoTextureGM)); | 257 DEF_GM( return SkNEW(GradientsNoTextureGM)); |
| 258 DEF_GM( return SkNEW(GradientsManyColorsGM)); | 258 DEF_GM( return SkNEW(GradientsManyColorsGM)); |
| OLD | NEW |