| 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 #include "SkAlphaThresholdFilter.h" | 8 #include "SkAlphaThresholdFilter.h" |
| 9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
| 10 #include "SkReadBuffer.h" | 10 #include "SkReadBuffer.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 83 |
| 84 typedef GrGLAlphaThresholdEffect GLEffect; | 84 typedef GrGLAlphaThresholdEffect GLEffect; |
| 85 | 85 |
| 86 private: | 86 private: |
| 87 AlphaThresholdEffect(GrTexture* texture, | 87 AlphaThresholdEffect(GrTexture* texture, |
| 88 GrTexture* maskTexture, | 88 GrTexture* maskTexture, |
| 89 float innerThreshold, | 89 float innerThreshold, |
| 90 float outerThreshold) | 90 float outerThreshold) |
| 91 : fInnerThreshold(innerThreshold) | 91 : fInnerThreshold(innerThreshold) |
| 92 , fOuterThreshold(outerThreshold) | 92 , fOuterThreshold(outerThreshold) |
| 93 , fImageCoordTransform(kLocal_GrCoordSet, MakeDivByTextureWHMatrix(textu
re), texture) | 93 , fImageCoordTransform(kLocal_GrCoordSet, |
| 94 GrCoordTransform::MakeDivByTextureWHMatrix(textur
e), texture) |
| 94 , fImageTextureAccess(texture) | 95 , fImageTextureAccess(texture) |
| 95 , fMaskCoordTransform(kLocal_GrCoordSet, MakeDivByTextureWHMatrix(maskTe
xture), maskTexture) | 96 , fMaskCoordTransform(kLocal_GrCoordSet, |
| 97 GrCoordTransform::MakeDivByTextureWHMatrix(maskTex
ture), maskTexture) |
| 96 , fMaskTextureAccess(maskTexture) { | 98 , fMaskTextureAccess(maskTexture) { |
| 97 this->addCoordTransform(&fImageCoordTransform); | 99 this->addCoordTransform(&fImageCoordTransform); |
| 98 this->addTextureAccess(&fImageTextureAccess); | 100 this->addTextureAccess(&fImageTextureAccess); |
| 99 this->addCoordTransform(&fMaskCoordTransform); | 101 this->addCoordTransform(&fMaskCoordTransform); |
| 100 this->addTextureAccess(&fMaskTextureAccess); | 102 this->addTextureAccess(&fMaskTextureAccess); |
| 101 } | 103 } |
| 102 | 104 |
| 103 virtual bool onIsEqual(const GrEffect&) const SK_OVERRIDE; | 105 virtual bool onIsEqual(const GrEffect&) const SK_OVERRIDE; |
| 104 | 106 |
| 105 GR_DECLARE_EFFECT_TEST; | 107 GR_DECLARE_EFFECT_TEST; |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 (U8CPU)(SkColorGetG(source) *
scale), | 377 (U8CPU)(SkColorGetG(source) *
scale), |
| 376 (U8CPU)(SkColorGetB(source) *
scale)); | 378 (U8CPU)(SkColorGetB(source) *
scale)); |
| 377 } | 379 } |
| 378 } | 380 } |
| 379 dptr[y * dst->width() + x] = output_color; | 381 dptr[y * dst->width() + x] = output_color; |
| 380 } | 382 } |
| 381 } | 383 } |
| 382 | 384 |
| 383 return true; | 385 return true; |
| 384 } | 386 } |
| OLD | NEW |