aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/GrAlphaThresholdFragmentProcessor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/effects/GrAlphaThresholdFragmentProcessor.cpp')
-rw-r--r--src/effects/GrAlphaThresholdFragmentProcessor.cpp29
1 files changed, 10 insertions, 19 deletions
diff --git a/src/effects/GrAlphaThresholdFragmentProcessor.cpp b/src/effects/GrAlphaThresholdFragmentProcessor.cpp
index 8f9e45dc2b..a259607444 100644
--- a/src/effects/GrAlphaThresholdFragmentProcessor.cpp
+++ b/src/effects/GrAlphaThresholdFragmentProcessor.cpp
@@ -32,14 +32,6 @@ sk_sp<GrFragmentProcessor> GrAlphaThresholdFragmentProcessor::Make(
bounds));
}
-inline GrFragmentProcessor::OptimizationFlags GrAlphaThresholdFragmentProcessor::OptFlags(float outerThreshold) {
- if (outerThreshold >= 1.f) {
- return kPreservesOpaqueInput_OptimizationFlag | kModulatesInput_OptimizationFlag;
- } else {
- return kModulatesInput_OptimizationFlag;
- }
-}
-
GrAlphaThresholdFragmentProcessor::GrAlphaThresholdFragmentProcessor(
GrTexture* texture,
sk_sp<GrColorSpaceXform> colorSpaceXform,
@@ -47,17 +39,16 @@ GrAlphaThresholdFragmentProcessor::GrAlphaThresholdFragmentProcessor(
float innerThreshold,
float outerThreshold,
const SkIRect& bounds)
- : INHERITED(OptFlags(outerThreshold))
- , fInnerThreshold(innerThreshold)
- , fOuterThreshold(outerThreshold)
- , fImageCoordTransform(SkMatrix::I(), texture, GrSamplerParams::kNone_FilterMode)
- , fImageTextureSampler(texture)
- , fColorSpaceXform(std::move(colorSpaceXform))
- , fMaskCoordTransform(
- SkMatrix::MakeTrans(SkIntToScalar(-bounds.x()), SkIntToScalar(-bounds.y())),
- maskTexture,
- GrSamplerParams::kNone_FilterMode)
- , fMaskTextureSampler(maskTexture) {
+ : fInnerThreshold(innerThreshold)
+ , fOuterThreshold(outerThreshold)
+ , fImageCoordTransform(SkMatrix::I(), texture, GrSamplerParams::kNone_FilterMode)
+ , fImageTextureSampler(texture)
+ , fColorSpaceXform(std::move(colorSpaceXform))
+ , fMaskCoordTransform(SkMatrix::MakeTrans(SkIntToScalar(-bounds.x()),
+ SkIntToScalar(-bounds.y())),
+ maskTexture,
+ GrSamplerParams::kNone_FilterMode)
+ , fMaskTextureSampler(maskTexture) {
this->initClassID<GrAlphaThresholdFragmentProcessor>();
this->addCoordTransform(&fImageCoordTransform);
this->addTextureSampler(&fImageTextureSampler);