| 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 | 7 |
| 8 #ifndef GrTextureDomainEffect_DEFINED | 8 #ifndef GrTextureDomainEffect_DEFINED |
| 9 #define GrTextureDomainEffect_DEFINED | 9 #define GrTextureDomainEffect_DEFINED |
| 10 | 10 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 SkDEBUGCODE(fMode = (Mode) -1;) | 101 SkDEBUGCODE(fMode = (Mode) -1;) |
| 102 } | 102 } |
| 103 | 103 |
| 104 /** | 104 /** |
| 105 * Call this from GrGLProcessor::emitCode() to sample the texture W.R.T.
the domain and | 105 * Call this from GrGLProcessor::emitCode() to sample the texture W.R.T.
the domain and |
| 106 * mode. | 106 * mode. |
| 107 * | 107 * |
| 108 * @param outcolor name of vec4 variable to hold the sampled color. | 108 * @param outcolor name of vec4 variable to hold the sampled color. |
| 109 * @param inCoords name of vec2 variable containing the coords to be us
ed with the domain. | 109 * @param inCoords name of vec2 variable containing the coords to be us
ed with the domain. |
| 110 * It is assumed that this is a variable and not an exp
ression. | 110 * It is assumed that this is a variable and not an exp
ression. |
| 111 * @param inModulateColor if non-NULL the sampled color will be modula
ted with this | 111 * @param inModulateColor if non-nullptr the sampled color will be mod
ulated with this |
| 112 * expression before being written to outColor. | 112 * expression before being written to outColor. |
| 113 */ | 113 */ |
| 114 void sampleTexture(GrGLShaderBuilder* builder, | 114 void sampleTexture(GrGLShaderBuilder* builder, |
| 115 const GrTextureDomain& textureDomain, | 115 const GrTextureDomain& textureDomain, |
| 116 const char* outColor, | 116 const char* outColor, |
| 117 const SkString& inCoords, | 117 const SkString& inCoords, |
| 118 const GrGLProcessor::TextureSampler sampler, | 118 const GrGLProcessor::TextureSampler sampler, |
| 119 const char* inModulateColor = NULL); | 119 const char* inModulateColor = nullptr); |
| 120 | 120 |
| 121 /** | 121 /** |
| 122 * Call this from GrGLProcessor::setData() to upload uniforms necessary
for the texture | 122 * Call this from GrGLProcessor::setData() to upload uniforms necessary
for the texture |
| 123 * domain. The rectangle is automatically adjusted to account for the te
xture's origin. | 123 * domain. The rectangle is automatically adjusted to account for the te
xture's origin. |
| 124 */ | 124 */ |
| 125 void setData(const GrGLProgramDataManager& pdman, const GrTextureDomain&
textureDomain, | 125 void setData(const GrGLProgramDataManager& pdman, const GrTextureDomain&
textureDomain, |
| 126 GrSurfaceOrigin textureOrigin); | 126 GrSurfaceOrigin textureOrigin); |
| 127 | 127 |
| 128 enum { | 128 enum { |
| 129 kDomainKeyBits = 2, // See DomainKey(). | 129 kDomainKeyBits = 2, // See DomainKey(). |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 bool onIsEqual(const GrFragmentProcessor&) const override; | 193 bool onIsEqual(const GrFragmentProcessor&) const override; |
| 194 | 194 |
| 195 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; | 195 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; |
| 196 | 196 |
| 197 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 197 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
| 198 | 198 |
| 199 typedef GrSingleTextureEffect INHERITED; | 199 typedef GrSingleTextureEffect INHERITED; |
| 200 }; | 200 }; |
| 201 | 201 |
| 202 #endif | 202 #endif |
| OLD | NEW |