| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 namespace skiagm { | 10 namespace skiagm { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 class ShaderBoundsGM : public GM { | 27 class ShaderBoundsGM : public GM { |
| 28 public: | 28 public: |
| 29 typedef SkShader* (*ShaderGenFunc)(SkScalar width, SkScalar height, | 29 typedef SkShader* (*ShaderGenFunc)(SkScalar width, SkScalar height, |
| 30 bool alternate, const SkMatrix& localMatr
ix); | 30 bool alternate, const SkMatrix& localMatr
ix); |
| 31 ShaderBoundsGM(ShaderGenFunc maker, const SkString& name) | 31 ShaderBoundsGM(ShaderGenFunc maker, const SkString& name) |
| 32 : fShaderMaker(maker), | 32 : fShaderMaker(maker), |
| 33 fName(name) { | 33 fName(name) { |
| 34 } | 34 } |
| 35 | 35 |
| 36 protected: | 36 protected: |
| 37 virtual uint32_t onGetFlags() const SK_OVERRIDE { |
| 38 return kSkipTiled_Flag; |
| 39 } |
| 40 |
| 37 SkString onShortName() { | 41 SkString onShortName() { |
| 38 return fName; | 42 return fName; |
| 39 } | 43 } |
| 40 | 44 |
| 41 virtual SkISize onISize() { return make_isize(320, 240); } | 45 virtual SkISize onISize() { return make_isize(320, 240); } |
| 42 | 46 |
| 43 virtual SkMatrix onGetInitialTransform() const SK_OVERRIDE { | 47 virtual SkMatrix onGetInitialTransform() const SK_OVERRIDE { |
| 44 SkMatrix result; | 48 SkMatrix result; |
| 45 SkScalar scale = 0.8f; | 49 SkScalar scale = 0.8f; |
| 46 result.setScale(scale, scale); | 50 result.setScale(scale, scale); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 }; | 101 }; |
| 98 | 102 |
| 99 /////////////////////////////////////////////////////////////////////////////// | 103 /////////////////////////////////////////////////////////////////////////////// |
| 100 | 104 |
| 101 static GM* MyFactory(void*) { | 105 static GM* MyFactory(void*) { |
| 102 return new ShaderBoundsGM(MakeLinear, SkString("shaderbounds_linear")); | 106 return new ShaderBoundsGM(MakeLinear, SkString("shaderbounds_linear")); |
| 103 } | 107 } |
| 104 static GMRegistry reg(MyFactory); | 108 static GMRegistry reg(MyFactory); |
| 105 | 109 |
| 106 } | 110 } |
| OLD | NEW |