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 uint32_t onGetFlags() const SK_OVERRIDE { | |
38 return kSkipTiled_Flag; | |
39 } | |
40 | 37 |
41 SkString onShortName() SK_OVERRIDE { | 38 SkString onShortName() SK_OVERRIDE { |
42 return fName; | 39 return fName; |
43 } | 40 } |
44 | 41 |
45 SkISize onISize() SK_OVERRIDE { return SkISize::Make(320, 240); } | 42 SkISize onISize() SK_OVERRIDE { return SkISize::Make(320, 240); } |
46 | 43 |
47 SkMatrix onGetInitialTransform() const SK_OVERRIDE { | 44 SkMatrix onGetInitialTransform() const SK_OVERRIDE { |
48 SkMatrix result; | 45 SkMatrix result; |
49 SkScalar scale = 0.8f; | 46 SkScalar scale = 0.8f; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 }; | 98 }; |
102 | 99 |
103 /////////////////////////////////////////////////////////////////////////////// | 100 /////////////////////////////////////////////////////////////////////////////// |
104 | 101 |
105 static GM* MyFactory(void*) { | 102 static GM* MyFactory(void*) { |
106 return new ShaderBoundsGM(MakeLinear, SkString("shaderbounds_linear")); | 103 return new ShaderBoundsGM(MakeLinear, SkString("shaderbounds_linear")); |
107 } | 104 } |
108 static GMRegistry reg(MyFactory); | 105 static GMRegistry reg(MyFactory); |
109 | 106 |
110 } | 107 } |
OLD | NEW |