Revert "Fix a bug in SkGpuBlurUtils::GaussianBlur (take 2)"
This reverts commit 72de74504f09f5de17af281b363fbc114ece3e73.
Reason for revert: We are missing some tests - Chrome images look different
Original change's description:
> Fix a bug in SkGpuBlurUtils::GaussianBlur (take 2)
>
> This fixes the remaining imageblurclampmode bug and a preexisting un-reported error in the imageblurrepeatmode GM.
>
> This relies on https://chromium-review.googlesource.com/c/chromium/src/+/1044113 (Add a flag to disable a blur imagefilter bug fix in Skia) landing in Chrome first.
>
> Bug: skia:7765
> Change-Id: I568d18c17bb95c9e270e4cfd304c8dc134a48a70
> Reviewed-on: https://skia-review.googlesource.com/125961
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
TBR=egdaniel@google.com,robertphillips@google.com
Change-Id: Ia56b3cf3009a95b7baaa9af62e97be390d0868fa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7765
Reviewed-on: https://skia-review.googlesource.com/126160
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/core/SkGpuBlurUtils.cpp b/src/core/SkGpuBlurUtils.cpp
index 0f94808..cfd14ee 100644
--- a/src/core/SkGpuBlurUtils.cpp
+++ b/src/core/SkGpuBlurUtils.cpp
@@ -161,11 +161,10 @@
Direction direction,
int radius,
float sigma,
- SkIRect* contentRect,
+ const SkIRect& srcBounds,
GrTextureDomain::Mode mode,
const SkImageInfo& dstII,
- SkBackingFit fit,
- int radiusY /* temporarary*/) {
+ SkBackingFit fit) {
SkASSERT(srcRect.width() <= dstII.width() && srcRect.height() <= dstII.height());
GrPixelConfig config = get_blur_config(proxy.get(), dstII.colorSpace());
@@ -185,19 +184,18 @@
int bounds[2] = { 0, 0 };
SkIRect dstRect = SkIRect::MakeWH(srcRect.width(), srcRect.height());
if (GrTextureDomain::kIgnore_Mode == mode) {
- *contentRect = dstRect;
convolve_gaussian_1d(dstRenderTargetContext.get(), clip, dstRect, srcOffset,
std::move(proxy), direction, radius, sigma,
GrTextureDomain::kIgnore_Mode, bounds);
return dstRenderTargetContext;
}
- SkIRect midRect = *contentRect, leftRect, rightRect;
+ SkIRect midRect = srcBounds, leftRect, rightRect;
midRect.offset(srcOffset);
SkIRect topRect, bottomRect;
if (Direction::kX == direction) {
- bounds[0] = contentRect->left();
- bounds[1] = contentRect->right();
+ bounds[0] = srcBounds.left();
+ bounds[1] = srcBounds.right();
topRect = SkIRect::MakeLTRB(0, 0, dstRect.right(), midRect.top());
bottomRect = SkIRect::MakeLTRB(0, midRect.bottom(), dstRect.right(), dstRect.bottom());
midRect.inset(radius, 0);
@@ -206,22 +204,9 @@
SkIRect::MakeLTRB(midRect.right(), midRect.top(), dstRect.width(), midRect.bottom());
dstRect.fTop = midRect.top();
dstRect.fBottom = midRect.bottom();
-
-#ifdef SK_IGNORE_BLUR_IMAGE_FILTER_FIX
- *contentRect = dstRect;
- if (GrTextureDomain::kClamp_Mode == mode) {
- // We need to adjust bounds because we only fill part of the srcRect in x-pass.
- contentRect->inset(0, radiusY);
- }
-#else
- contentRect->fLeft = dstRect.fLeft;
- contentRect->fTop = midRect.fTop;
- contentRect->fRight = dstRect.fRight;
- contentRect->fBottom = midRect.fBottom;
-#endif
} else {
- bounds[0] = contentRect->top();
- bounds[1] = contentRect->bottom();
+ bounds[0] = srcBounds.top();
+ bounds[1] = srcBounds.bottom();
topRect = SkIRect::MakeLTRB(0, 0, midRect.left(), dstRect.bottom());
bottomRect = SkIRect::MakeLTRB(midRect.right(), 0, dstRect.right(), dstRect.bottom());
midRect.inset(0, radius);
@@ -230,13 +215,6 @@
SkIRect::MakeLTRB(midRect.left(), midRect.bottom(), midRect.right(), dstRect.height());
dstRect.fLeft = midRect.left();
dstRect.fRight = midRect.right();
-
-#ifndef SK_IGNORE_BLUR_IMAGE_FILTER_FIX
- contentRect->fLeft = midRect.fLeft;
- contentRect->fTop = dstRect.fTop;
- contentRect->fRight = midRect.fRight;
- contentRect->fBottom = dstRect.fBottom;
-#endif
}
if (!topRect.isEmpty()) {
dstRenderTargetContext->clear(&topRect, 0, GrRenderTargetContext::CanClearFullscreen::kNo);
@@ -510,8 +488,8 @@
scale_irect_roundout(&srcRect, 1.0f / scaleFactorX, 1.0f / scaleFactorY);
if (sigmaX > 0.0f) {
dstRenderTargetContext = convolve_gaussian(context, std::move(srcProxy), srcRect, srcOffset,
- Direction::kX, radiusX, sigmaX, &localSrcBounds,
- mode, finalDestII, xFit, radiusY);
+ Direction::kX, radiusX, sigmaX, localSrcBounds,
+ mode, finalDestII, xFit);
if (!dstRenderTargetContext) {
return nullptr;
}
@@ -530,13 +508,18 @@
}
srcRect.offsetTo(0, 0);
+ localSrcBounds = srcRect;
+ if (GrTextureDomain::kClamp_Mode == mode) {
+ // We need to adjust bounds because we only fill part of the srcRect in x-pass.
+ localSrcBounds.inset(0, radiusY);
+ }
srcOffset.set(0, 0);
}
if (sigmaY > 0.0f) {
dstRenderTargetContext = convolve_gaussian(context, std::move(srcProxy), srcRect, srcOffset,
- Direction::kY, radiusY, sigmaY, &localSrcBounds,
- mode, finalDestII, yFit, radiusY);
+ Direction::kY, radiusY, sigmaY, localSrcBounds,
+ mode, finalDestII, yFit);
if (!dstRenderTargetContext) {
return nullptr;
}