Reland "Revert "Make FP optimizations helpers use SkAlphaType not GrColorType""
This reverts commit 997b37fdb986b45ff9941319b0111b188e749cfc.
Reason for revert: May be blocking Chrome roll
Original change's description:
> Revert "Revert "Make FP optimizations helpers use SkAlphaType not GrColorType""
>
> This reverts commit 078e8faa26d8b1f33a92e57f587be011150d1776.
>
> Change-Id: I67b2970584db5a1afbf9928b77c5444947ef71a3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255897
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=egdaniel@google.com,bsalomon@google.com
Change-Id: I0d2754ac7f4672f0758e4d00cd9e06998637846a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256196
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp b/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp
index dd6e7c5..fd70616 100644
--- a/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp
+++ b/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp
@@ -211,15 +211,16 @@
}
GrGaussianConvolutionFragmentProcessor::GrGaussianConvolutionFragmentProcessor(
- sk_sp<GrTextureProxy> proxy,
- SkAlphaType alphaType,
- Direction direction,
- int radius,
- float gaussianSigma,
- GrTextureDomain::Mode mode,
- int bounds[2])
+ sk_sp<GrTextureProxy> proxy,
+ GrColorType srcColorType,
+ Direction direction,
+ int radius,
+ float gaussianSigma,
+ GrTextureDomain::Mode mode,
+ int bounds[2])
: INHERITED(kGrGaussianConvolutionFragmentProcessor_ClassID,
- ModulateForSamplerOptFlags(alphaType, mode == GrTextureDomain::kDecal_Mode))
+ ModulateForSamplerOptFlags(srcColorType,
+ mode == GrTextureDomain::kDecal_Mode))
, fCoordTransform(proxy.get())
, fTextureSampler(std::move(proxy))
, fRadius(radius)
@@ -297,10 +298,8 @@
int radius = d->fRandom->nextRangeU(1, kMaxKernelRadius);
float sigma = radius / 3.f;
- auto alphaType = static_cast<SkAlphaType>(
- d->fRandom->nextRangeU(kUnknown_SkAlphaType + 1, kLastEnum_SkAlphaType));
return GrGaussianConvolutionFragmentProcessor::Make(
- std::move(proxy), alphaType, dir, radius, sigma,
- static_cast<GrTextureDomain::Mode>(modeIdx), bounds);
+ std::move(proxy), d->textureProxyColorType(texIdx),
+ dir, radius, sigma, static_cast<GrTextureDomain::Mode>(modeIdx), bounds);
}
#endif