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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 virtual GrGLFragmentProcessor* createGLInstance() const SK_OVERRIDE; | 80 virtual GrGLFragmentProcessor* createGLInstance() const SK_OVERRIDE; |
81 | 81 |
82 private: | 82 private: |
83 AlphaThresholdEffect(GrTexture* texture, | 83 AlphaThresholdEffect(GrTexture* texture, |
84 GrTexture* maskTexture, | 84 GrTexture* maskTexture, |
85 float innerThreshold, | 85 float innerThreshold, |
86 float outerThreshold) | 86 float outerThreshold) |
87 : fInnerThreshold(innerThreshold) | 87 : fInnerThreshold(innerThreshold) |
88 , fOuterThreshold(outerThreshold) | 88 , fOuterThreshold(outerThreshold) |
89 , fImageCoordTransform(kLocal_GrCoordSet, | 89 , fImageCoordTransform(kLocal_GrCoordSet, |
90 GrCoordTransform::MakeDivByTextureWHMatrix(textur
e), texture) | 90 GrCoordTransform::MakeDivByTextureWHMatrix(textur
e), texture, |
| 91 GrTextureParams::kNone_FilterMode) |
91 , fImageTextureAccess(texture) | 92 , fImageTextureAccess(texture) |
92 , fMaskCoordTransform(kLocal_GrCoordSet, | 93 , fMaskCoordTransform(kLocal_GrCoordSet, |
93 GrCoordTransform::MakeDivByTextureWHMatrix(maskTex
ture), maskTexture) | 94 GrCoordTransform::MakeDivByTextureWHMatrix(maskTex
ture), maskTexture, |
| 95 GrTextureParams::kNone_FilterMode) |
94 , fMaskTextureAccess(maskTexture) { | 96 , fMaskTextureAccess(maskTexture) { |
95 this->initClassID<AlphaThresholdEffect>(); | 97 this->initClassID<AlphaThresholdEffect>(); |
96 this->addCoordTransform(&fImageCoordTransform); | 98 this->addCoordTransform(&fImageCoordTransform); |
97 this->addTextureAccess(&fImageTextureAccess); | 99 this->addTextureAccess(&fImageTextureAccess); |
98 this->addCoordTransform(&fMaskCoordTransform); | 100 this->addCoordTransform(&fMaskCoordTransform); |
99 this->addTextureAccess(&fMaskTextureAccess); | 101 this->addTextureAccess(&fMaskTextureAccess); |
100 } | 102 } |
101 | 103 |
102 virtual bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE; | 104 virtual bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE; |
103 | 105 |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 (U8CPU)(SkColorGetG(source) *
scale), | 371 (U8CPU)(SkColorGetG(source) *
scale), |
370 (U8CPU)(SkColorGetB(source) *
scale)); | 372 (U8CPU)(SkColorGetB(source) *
scale)); |
371 } | 373 } |
372 } | 374 } |
373 dptr[y * dst->width() + x] = output_color; | 375 dptr[y * dst->width() + x] = output_color; |
374 } | 376 } |
375 } | 377 } |
376 | 378 |
377 return true; | 379 return true; |
378 } | 380 } |
OLD | NEW |