This fixes a bug introduced in: https://codereview.chromium.org/
1961953002/ (Reland of Simplify SkGpuBlurUtils::GaussianBlur method)
Although the 'canOverwriteSrc' flag is/was being used I still believe we're better off re-adding it after the mask-blur refactoring finishes.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=
2100873002
Review-Url: https://codereview.chromium.org/
2100873002
/**
* This function is used to implement filters that require an explicit src mask. It should only
* be called if canFilterMaskGPU returned true and the maskRect param should be the output from
- * that call. canOverwriteSrc indicates whether the implementation may treat src as a scratch
- * texture and overwrite its contents. When true it is also legal to return src as the result.
+ * that call.
* Implementations are free to get the GrContext from the src texture in order to create
* additional textures and perform multiple passes.
*/
virtual bool filterMaskGPU(GrTexture* src,
const SkMatrix& ctm,
const SkIRect& maskRect,
- GrTexture** result,
- bool canOverwriteSrc) const;
+ GrTexture** result) const;
#endif
/**
bool SkMaskFilter::filterMaskGPU(GrTexture* src,
const SkMatrix& ctm,
const SkIRect& maskRect,
- GrTexture** result,
- bool canOverwriteSrc) const {
+ GrTexture** result) const {
return false;
}
#endif
bool filterMaskGPU(GrTexture* src,
const SkMatrix& ctm,
const SkIRect& maskRect,
- GrTexture** result,
- bool canOverwriteSrc) const override;
+ GrTexture** result) const override;
#endif
void computeFastBounds(const SkRect&, SkRect*) const override;
bool SkBlurMaskFilterImpl::filterMaskGPU(GrTexture* src,
const SkMatrix& ctm,
const SkIRect& maskRect,
- GrTexture** result,
- bool canOverwriteSrc) const {
+ GrTexture** result) const {
// 'maskRect' isn't snapped to the UL corner but the mask in 'src' is.
const SkIRect clipRect = SkIRect::MakeWH(maskRect.width(), maskRect.height());
// If we're doing a normal blur, we can clobber the pathTexture in the
// gaussianBlur. Otherwise, we need to save it for later compositing.
+ static const bool kIsGammaCorrect = false;
bool isNormalBlur = (kNormal_SkBlurStyle == fBlurStyle);
sk_sp<GrDrawContext> drawContext(SkGpuBlurUtils::GaussianBlur(context, src,
- isNormalBlur && canOverwriteSrc,
+ kIsGammaCorrect,
clipRect, nullptr,
xformedSigma, xformedSigma));
if (!drawContext) {
if (mask) {
GrTexture* filtered;
- if (maskFilter->filterMaskGPU(mask.get(), viewMatrix, finalIRect, &filtered, true)) {
+ if (maskFilter->filterMaskGPU(mask.get(), viewMatrix, finalIRect, &filtered)) {
// filterMaskGPU gives us ownership of a ref to the result
SkAutoTUnref<GrTexture> atu(filtered);
if (draw_mask(drawContext, clip, viewMatrix, finalIRect, paint, filtered)) {