OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 #include "GrBicubicEffect.h" | 8 #include "GrBicubicEffect.h" |
9 #include "GrInvariantOutput.h" | 9 #include "GrInvariantOutput.h" |
10 #include "glsl/GrGLSLFragmentShaderBuilder.h" | 10 #include "glsl/GrGLSLFragmentShaderBuilder.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 : INHERITED(texture, matrix, | 145 : INHERITED(texture, matrix, |
146 GrTextureParams(SkShader::kClamp_TileMode, GrTextureParams::kNone_
FilterMode)) | 146 GrTextureParams(SkShader::kClamp_TileMode, GrTextureParams::kNone_
FilterMode)) |
147 , fDomain(domain, GrTextureDomain::kClamp_Mode) { | 147 , fDomain(domain, GrTextureDomain::kClamp_Mode) { |
148 this->initClassID<GrBicubicEffect>(); | 148 this->initClassID<GrBicubicEffect>(); |
149 convert_row_major_scalar_coeffs_to_column_major_floats(fCoefficients, coeffi
cients); | 149 convert_row_major_scalar_coeffs_to_column_major_floats(fCoefficients, coeffi
cients); |
150 } | 150 } |
151 | 151 |
152 GrBicubicEffect::~GrBicubicEffect() { | 152 GrBicubicEffect::~GrBicubicEffect() { |
153 } | 153 } |
154 | 154 |
155 void GrBicubicEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, | 155 void GrBicubicEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps, |
156 GrProcessorKeyBuilder* b) const { | 156 GrProcessorKeyBuilder* b) const { |
157 GrGLBicubicEffect::GenKey(*this, caps, b); | 157 GrGLBicubicEffect::GenKey(*this, caps, b); |
158 } | 158 } |
159 | 159 |
160 GrGLSLFragmentProcessor* GrBicubicEffect::onCreateGLInstance() const { | 160 GrGLSLFragmentProcessor* GrBicubicEffect::onCreateGLSLInstance() const { |
161 return new GrGLBicubicEffect(*this); | 161 return new GrGLBicubicEffect(*this); |
162 } | 162 } |
163 | 163 |
164 bool GrBicubicEffect::onIsEqual(const GrFragmentProcessor& sBase) const { | 164 bool GrBicubicEffect::onIsEqual(const GrFragmentProcessor& sBase) const { |
165 const GrBicubicEffect& s = sBase.cast<GrBicubicEffect>(); | 165 const GrBicubicEffect& s = sBase.cast<GrBicubicEffect>(); |
166 return !memcmp(fCoefficients, s.coefficients(), 16) && | 166 return !memcmp(fCoefficients, s.coefficients(), 16) && |
167 fDomain == s.fDomain; | 167 fDomain == s.fDomain; |
168 } | 168 } |
169 | 169 |
170 void GrBicubicEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const { | 170 void GrBicubicEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 // Use bilerp to handle rotation or fractional translation. | 209 // Use bilerp to handle rotation or fractional translation. |
210 *filterMode = GrTextureParams::kBilerp_FilterMode; | 210 *filterMode = GrTextureParams::kBilerp_FilterMode; |
211 } | 211 } |
212 return false; | 212 return false; |
213 } | 213 } |
214 // When we use the bicubic filtering effect each sample is read from the tex
ture using | 214 // When we use the bicubic filtering effect each sample is read from the tex
ture using |
215 // nearest neighbor sampling. | 215 // nearest neighbor sampling. |
216 *filterMode = GrTextureParams::kNone_FilterMode; | 216 *filterMode = GrTextureParams::kNone_FilterMode; |
217 return true; | 217 return true; |
218 } | 218 } |
OLD | NEW |