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 | 7 |
8 #ifndef GrSimpleTextureEffect_DEFINED | 8 #ifndef GrSimpleTextureEffect_DEFINED |
9 #define GrSimpleTextureEffect_DEFINED | 9 #define GrSimpleTextureEffect_DEFINED |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 } | 38 } |
39 | 39 |
40 static sk_sp<GrFragmentProcessor> Make(GrTexture* tex, | 40 static sk_sp<GrFragmentProcessor> Make(GrTexture* tex, |
41 sk_sp<GrColorSpaceXform> colorSpaceXf
orm, | 41 sk_sp<GrColorSpaceXform> colorSpaceXf
orm, |
42 const SkMatrix& matrix, | 42 const SkMatrix& matrix, |
43 const GrTextureParams& p) { | 43 const GrTextureParams& p) { |
44 return sk_sp<GrFragmentProcessor>(new GrSimpleTextureEffect(tex, std::mo
ve(colorSpaceXform), | 44 return sk_sp<GrFragmentProcessor>(new GrSimpleTextureEffect(tex, std::mo
ve(colorSpaceXform), |
45 matrix, p)); | 45 matrix, p)); |
46 } | 46 } |
47 | 47 |
| 48 /* unfiltered, clamp mode */ |
| 49 static sk_sp<GrFragmentProcessor> Make(GrTextureProxy* tex, |
| 50 sk_sp<GrColorSpaceXform> colorSpaceXf
orm, |
| 51 const SkMatrix& matrix) { |
| 52 return sk_sp<GrFragmentProcessor>( |
| 53 new GrSimpleTextureEffect(tex, std::move(colorSpaceXform), matrix, |
| 54 GrTextureParams::kNone_FilterMode)); |
| 55 } |
| 56 |
| 57 /* clamp mode */ |
| 58 static sk_sp<GrFragmentProcessor> Make(GrTextureProxy* tex, |
| 59 sk_sp<GrColorSpaceXform> colorSpaceXf
orm, |
| 60 const SkMatrix& matrix, |
| 61 GrTextureParams::FilterMode filterMo
de) { |
| 62 return sk_sp<GrFragmentProcessor>( |
| 63 new GrSimpleTextureEffect(tex, std::move(colorSpaceXform), matrix, f
ilterMode)); |
| 64 } |
| 65 |
| 66 static sk_sp<GrFragmentProcessor> Make(GrTextureProxy* tex, |
| 67 sk_sp<GrColorSpaceXform> colorSpaceXf
orm, |
| 68 const SkMatrix& matrix, |
| 69 const GrTextureParams& p) { |
| 70 return sk_sp<GrFragmentProcessor>(new GrSimpleTextureEffect(tex, std::mo
ve(colorSpaceXform), |
| 71 matrix, p)); |
| 72 } |
| 73 |
48 virtual ~GrSimpleTextureEffect() {} | 74 virtual ~GrSimpleTextureEffect() {} |
49 | 75 |
50 const char* name() const override { return "SimpleTexture"; } | 76 const char* name() const override { return "SimpleTexture"; } |
51 | 77 |
52 private: | 78 private: |
53 GrSimpleTextureEffect(GrTexture* texture, | 79 GrSimpleTextureEffect(GrTexture* texture, |
54 sk_sp<GrColorSpaceXform> colorSpaceXform, | 80 sk_sp<GrColorSpaceXform> colorSpaceXform, |
55 const SkMatrix& matrix, | 81 const SkMatrix& matrix, |
56 GrTextureParams::FilterMode filterMode) | 82 GrTextureParams::FilterMode filterMode) |
57 : GrSingleTextureEffect(texture, std::move(colorSpaceXform), matrix, fil
terMode) { | 83 : GrSingleTextureEffect(texture, std::move(colorSpaceXform), matrix, fil
terMode) { |
58 this->initClassID<GrSimpleTextureEffect>(); | 84 this->initClassID<GrSimpleTextureEffect>(); |
59 } | 85 } |
60 | 86 |
61 GrSimpleTextureEffect(GrTexture* texture, | 87 GrSimpleTextureEffect(GrTexture* texture, |
62 sk_sp<GrColorSpaceXform> colorSpaceXform, | 88 sk_sp<GrColorSpaceXform> colorSpaceXform, |
63 const SkMatrix& matrix, | 89 const SkMatrix& matrix, |
64 const GrTextureParams& params) | 90 const GrTextureParams& params) |
65 : GrSingleTextureEffect(texture, std::move(colorSpaceXform), matrix, par
ams) { | 91 : GrSingleTextureEffect(texture, std::move(colorSpaceXform), matrix, par
ams) { |
66 this->initClassID<GrSimpleTextureEffect>(); | 92 this->initClassID<GrSimpleTextureEffect>(); |
67 } | 93 } |
68 | 94 |
| 95 GrSimpleTextureEffect(GrTextureProxy* texture, |
| 96 sk_sp<GrColorSpaceXform> colorSpaceXform, |
| 97 const SkMatrix& matrix, |
| 98 GrTextureParams::FilterMode filterMode) |
| 99 : GrSingleTextureEffect(texture, std::move(colorSpaceXform), matrix, fil
terMode) { |
| 100 this->initClassID<GrSimpleTextureEffect>(); |
| 101 } |
| 102 |
| 103 GrSimpleTextureEffect(GrTextureProxy* texture, |
| 104 sk_sp<GrColorSpaceXform> colorSpaceXform, |
| 105 const SkMatrix& matrix, |
| 106 const GrTextureParams& params) |
| 107 : GrSingleTextureEffect(texture, std::move(colorSpaceXform), matrix, par
ams) { |
| 108 this->initClassID<GrSimpleTextureEffect>(); |
| 109 } |
| 110 |
69 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; | 111 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; |
70 | 112 |
71 void onGetGLSLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const
override; | 113 void onGetGLSLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const
override; |
72 | 114 |
73 bool onIsEqual(const GrFragmentProcessor& other) const override { return tru
e; } | 115 bool onIsEqual(const GrFragmentProcessor& other) const override { return tru
e; } |
74 | 116 |
75 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; | 117 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; |
76 | 118 |
77 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 119 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
78 | 120 |
79 typedef GrSingleTextureEffect INHERITED; | 121 typedef GrSingleTextureEffect INHERITED; |
80 }; | 122 }; |
81 | 123 |
82 #endif | 124 #endif |
OLD | NEW |