| 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 "gl/builders/GrGLProgramBuilder.h" | 10 #include "gl/builders/GrGLProgramBuilder.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 | 152 |
| 153 GrBicubicEffect::~GrBicubicEffect() { | 153 GrBicubicEffect::~GrBicubicEffect() { |
| 154 } | 154 } |
| 155 | 155 |
| 156 void GrBicubicEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, | 156 void GrBicubicEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, |
| 157 GrProcessorKeyBuilder* b) const { | 157 GrProcessorKeyBuilder* b) const { |
| 158 GrGLBicubicEffect::GenKey(*this, caps, b); | 158 GrGLBicubicEffect::GenKey(*this, caps, b); |
| 159 } | 159 } |
| 160 | 160 |
| 161 GrGLFragmentProcessor* GrBicubicEffect::onCreateGLInstance() const { | 161 GrGLFragmentProcessor* GrBicubicEffect::onCreateGLInstance() const { |
| 162 return SkNEW_ARGS(GrGLBicubicEffect, (*this)); | 162 return new GrGLBicubicEffect(*this); |
| 163 } | 163 } |
| 164 | 164 |
| 165 bool GrBicubicEffect::onIsEqual(const GrFragmentProcessor& sBase) const { | 165 bool GrBicubicEffect::onIsEqual(const GrFragmentProcessor& sBase) const { |
| 166 const GrBicubicEffect& s = sBase.cast<GrBicubicEffect>(); | 166 const GrBicubicEffect& s = sBase.cast<GrBicubicEffect>(); |
| 167 return !memcmp(fCoefficients, s.coefficients(), 16) && | 167 return !memcmp(fCoefficients, s.coefficients(), 16) && |
| 168 fDomain == s.fDomain; | 168 fDomain == s.fDomain; |
| 169 } | 169 } |
| 170 | 170 |
| 171 void GrBicubicEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const { | 171 void GrBicubicEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const { |
| 172 // FIXME: Perhaps we can do better. | 172 // FIXME: Perhaps we can do better. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 // Use bilerp to handle rotation or fractional translation. | 210 // Use bilerp to handle rotation or fractional translation. |
| 211 *filterMode = GrTextureParams::kBilerp_FilterMode; | 211 *filterMode = GrTextureParams::kBilerp_FilterMode; |
| 212 } | 212 } |
| 213 return false; | 213 return false; |
| 214 } | 214 } |
| 215 // When we use the bicubic filtering effect each sample is read from the tex
ture using | 215 // When we use the bicubic filtering effect each sample is read from the tex
ture using |
| 216 // nearest neighbor sampling. | 216 // nearest neighbor sampling. |
| 217 *filterMode = GrTextureParams::kNone_FilterMode; | 217 *filterMode = GrTextureParams::kNone_FilterMode; |
| 218 return true; | 218 return true; |
| 219 } | 219 } |
| OLD | NEW |