| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 "GrAlphaThresholdFragmentProcessor.h" | 8 #include "GrAlphaThresholdFragmentProcessor.h" |
| 9 | 9 |
| 10 #if SK_SUPPORT_GPU | 10 #if SK_SUPPORT_GPU |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 GrAlphaThresholdFragmentProcessor::GrAlphaThresholdFragmentProcessor(GrTexture*
texture, | 37 GrAlphaThresholdFragmentProcessor::GrAlphaThresholdFragmentProcessor(GrTexture*
texture, |
| 38 GrTexture*
maskTexture, | 38 GrTexture*
maskTexture, |
| 39 float inner
Threshold, | 39 float inner
Threshold, |
| 40 float outer
Threshold, | 40 float outer
Threshold, |
| 41 const SkIRe
ct& bounds) | 41 const SkIRe
ct& bounds) |
| 42 : fInnerThreshold(innerThreshold) | 42 : fInnerThreshold(innerThreshold) |
| 43 , fOuterThreshold(outerThreshold) | 43 , fOuterThreshold(outerThreshold) |
| 44 , fImageCoordTransform(kLocal_GrCoordSet, | 44 , fImageCoordTransform(kLocal_GrCoordSet, |
| 45 GrCoordTransform::MakeDivByTextureWHMatrix(texture),
texture, | 45 GrCoordTransform::MakeDivByTextureWHMatrix(texture),
texture, |
| 46 GrTextureParams::kNone_FilterMode) | 46 GrTextureParams::kNone_FilterMode) |
| 47 , fImageTextureAccess(texture) | 47 , fImageTextureAccess(texture, nullptr) |
| 48 , fMaskCoordTransform(kLocal_GrCoordSet, | 48 , fMaskCoordTransform(kLocal_GrCoordSet, |
| 49 make_div_and_translate_matrix(maskTexture, -bounds.x()
, -bounds.y()), | 49 make_div_and_translate_matrix(maskTexture, -bounds.x()
, -bounds.y()), |
| 50 maskTexture, | 50 maskTexture, |
| 51 GrTextureParams::kNone_FilterMode) | 51 GrTextureParams::kNone_FilterMode) |
| 52 , fMaskTextureAccess(maskTexture) { | 52 , fMaskTextureAccess(maskTexture, nullptr) { |
| 53 this->initClassID<GrAlphaThresholdFragmentProcessor>(); | 53 this->initClassID<GrAlphaThresholdFragmentProcessor>(); |
| 54 this->addCoordTransform(&fImageCoordTransform); | 54 this->addCoordTransform(&fImageCoordTransform); |
| 55 this->addTextureAccess(&fImageTextureAccess); | 55 this->addTextureAccess(&fImageTextureAccess); |
| 56 this->addCoordTransform(&fMaskCoordTransform); | 56 this->addCoordTransform(&fMaskCoordTransform); |
| 57 this->addTextureAccess(&fMaskTextureAccess); | 57 this->addTextureAccess(&fMaskTextureAccess); |
| 58 } | 58 } |
| 59 | 59 |
| 60 bool GrAlphaThresholdFragmentProcessor::onIsEqual(const GrFragmentProcessor& sBa
se) const { | 60 bool GrAlphaThresholdFragmentProcessor::onIsEqual(const GrFragmentProcessor& sBa
se) const { |
| 61 const GrAlphaThresholdFragmentProcessor& s = sBase.cast<GrAlphaThresholdFrag
mentProcessor>(); | 61 const GrAlphaThresholdFragmentProcessor& s = sBase.cast<GrAlphaThresholdFrag
mentProcessor>(); |
| 62 return (this->fInnerThreshold == s.fInnerThreshold && | 62 return (this->fInnerThreshold == s.fInnerThreshold && |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 void GrAlphaThresholdFragmentProcessor::onGetGLSLProcessorKey(const GrGLSLCaps&
caps, | 167 void GrAlphaThresholdFragmentProcessor::onGetGLSLProcessorKey(const GrGLSLCaps&
caps, |
| 168 GrProcessorKeyBuil
der* b) const { | 168 GrProcessorKeyBuil
der* b) const { |
| 169 GrGLAlphaThresholdFragmentProcessor::GenKey(*this, caps, b); | 169 GrGLAlphaThresholdFragmentProcessor::GenKey(*this, caps, b); |
| 170 } | 170 } |
| 171 | 171 |
| 172 GrGLSLFragmentProcessor* GrAlphaThresholdFragmentProcessor::onCreateGLSLInstance
() const { | 172 GrGLSLFragmentProcessor* GrAlphaThresholdFragmentProcessor::onCreateGLSLInstance
() const { |
| 173 return new GrGLAlphaThresholdFragmentProcessor; | 173 return new GrGLAlphaThresholdFragmentProcessor; |
| 174 } | 174 } |
| 175 | 175 |
| 176 #endif | 176 #endif |
| OLD | NEW |