aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/core/SkCanvas.cpp18
-rw-r--r--src/core/SkDevice.cpp4
-rw-r--r--src/core/SkImageFilter.cpp12
-rw-r--r--src/core/SkMatrixImageFilter.cpp3
-rw-r--r--src/effects/SkOffsetImageFilter.cpp9
-rw-r--r--src/effects/SkTileImageFilter.cpp9
-rw-r--r--src/gpu/SkGpuDevice.cpp8
7 files changed, 0 insertions, 63 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index e577b21932..cd7c6f8a14 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1071,25 +1071,11 @@ bool SkCanvas::clipRectBounds(const SkRect* bounds, SaveLayerFlags saveLayerFlag
const SkMatrix& ctm = fMCRec->fMatrix; // this->getTotalMatrix()
-// This is a temporary hack, until individual filters can do their own
-// bloating, when this will be removed.
-#ifdef SK_SUPPORT_SRC_BOUNDS_BLOAT_FOR_IMAGEFILTERS
- SkRect storage;
-#endif
if (imageFilter) {
imageFilter->filterBounds(clipBounds, ctm, &clipBounds);
-#ifdef SK_SUPPORT_SRC_BOUNDS_BLOAT_FOR_IMAGEFILTERS
- if (bounds && imageFilter->canComputeFastBounds()) {
- imageFilter->computeFastBounds(*bounds, &storage);
- bounds = &storage;
- } else {
- bounds = nullptr;
- }
-#else
if (bounds && !imageFilter->canComputeFastBounds()) {
bounds = nullptr;
}
-#endif
}
SkIRect ir;
if (bounds) {
@@ -1433,11 +1419,7 @@ void SkCanvas::internalDrawDevice(SkBaseDevice* srcDev, int x, int y,
const SkBitmap& src = srcDev->accessBitmap(false);
SkMatrix matrix = *iter.fMatrix;
matrix.postTranslate(SkIntToScalar(-pos.x()), SkIntToScalar(-pos.y()));
-#ifdef SK_SUPPORT_SRC_BOUNDS_BLOAT_FOR_IMAGEFILTERS
- SkIRect clipBounds = SkIRect::MakeWH(srcDev->width(), srcDev->height());
-#else
SkIRect clipBounds = iter.fClip->getBounds().makeOffset(-pos.x(), -pos.y());
-#endif
SkAutoTUnref<SkImageFilter::Cache> cache(dstDev->getImageFilterCache());
SkImageFilter::Context ctx(matrix, clipBounds, cache.get());
if (filter->filterImage(&proxy, src, ctx, &dst, &offset)) {
diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp
index 8ff5827ada..78aa3ee52f 100644
--- a/src/core/SkDevice.cpp
+++ b/src/core/SkDevice.cpp
@@ -412,11 +412,7 @@ void SkBaseDevice::drawBitmapAsSprite(const SkDraw& draw, const SkBitmap& bitmap
SkIPoint offset = SkIPoint::Make(0, 0);
SkMatrix matrix = *draw.fMatrix;
matrix.postTranslate(SkIntToScalar(-x), SkIntToScalar(-y));
-#ifdef SK_SUPPORT_SRC_BOUNDS_BLOAT_FOR_IMAGEFILTERS
- const SkIRect clipBounds = bitmap.bounds();
-#else
const SkIRect clipBounds = draw.fClip->getBounds().makeOffset(-x, -y);
-#endif
SkAutoTUnref<SkImageFilter::Cache> cache(this->getImageFilterCache());
SkImageFilter::Context ctx(matrix, clipBounds, cache.get());
if (filter->filterImage(&proxy, bitmap, ctx, &dst, &offset)) {
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index 489a52bf87..141d2e03fb 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -397,12 +397,8 @@ bool SkImageFilter::applyCropRect(const Context& ctx, const SkBitmap& src,
}
src.getBounds(srcBounds);
srcBounds->offset(srcOffset);
-#ifdef SK_SUPPORT_SRC_BOUNDS_BLOAT_FOR_IMAGEFILTERS
- return fCropRect.applyTo(*srcBounds, ctx, dstBounds);
-#else
this->onFilterNodeBounds(*srcBounds, ctx.ctm(), dstBounds, kForward_MapDirection);
return fCropRect.applyTo(*dstBounds, ctx, dstBounds);
-#endif
}
bool SkImageFilter::applyCropRect(const Context& ctx, Proxy* proxy, const SkBitmap& src,
@@ -410,13 +406,9 @@ bool SkImageFilter::applyCropRect(const Context& ctx, Proxy* proxy, const SkBitm
SkIRect srcBounds;
src.getBounds(&srcBounds);
srcBounds.offset(*srcOffset);
-#ifdef SK_SUPPORT_SRC_BOUNDS_BLOAT_FOR_IMAGEFILTERS
- if (!fCropRect.applyTo(srcBounds, ctx, bounds)) {
-#else
SkIRect dstBounds;
this->onFilterNodeBounds(srcBounds, ctx.ctm(), &dstBounds, kForward_MapDirection);
if (!fCropRect.applyTo(dstBounds, ctx, bounds)) {
-#endif
return false;
}
@@ -472,14 +464,10 @@ void SkImageFilter::onFilterNodeBounds(const SkIRect& src, const SkMatrix&,
SkImageFilter::Context SkImageFilter::mapContext(const Context& ctx) const {
-#ifdef SK_SUPPORT_SRC_BOUNDS_BLOAT_FOR_IMAGEFILTERS
- return ctx;
-#else
SkIRect clipBounds;
this->onFilterNodeBounds(ctx.clipBounds(), ctx.ctm(), &clipBounds,
MapDirection::kReverse_MapDirection);
return Context(ctx.ctm(), clipBounds, ctx.cache());
-#endif
}
bool SkImageFilter::asFragmentProcessor(GrFragmentProcessor**, GrTexture*,
diff --git a/src/core/SkMatrixImageFilter.cpp b/src/core/SkMatrixImageFilter.cpp
index 4138ccf677..dd9e79f2cc 100644
--- a/src/core/SkMatrixImageFilter.cpp
+++ b/src/core/SkMatrixImageFilter.cpp
@@ -97,9 +97,6 @@ void SkMatrixImageFilter::computeFastBounds(const SkRect& src, SkRect* dst) cons
getInput(0)->computeFastBounds(src, &bounds);
}
fTransform.mapRect(dst, bounds);
-#ifdef SK_SUPPORT_SRC_BOUNDS_BLOAT_FOR_IMAGEFILTERS
- dst->join(bounds); // Work around for skia:3194
-#endif
}
void SkMatrixImageFilter::onFilterNodeBounds(const SkIRect& src, const SkMatrix& ctm,
diff --git a/src/effects/SkOffsetImageFilter.cpp b/src/effects/SkOffsetImageFilter.cpp
index e39c8d2506..70247f2a19 100644
--- a/src/effects/SkOffsetImageFilter.cpp
+++ b/src/effects/SkOffsetImageFilter.cpp
@@ -66,13 +66,7 @@ void SkOffsetImageFilter::computeFastBounds(const SkRect& src, SkRect* dst) cons
} else {
*dst = src;
}
-#ifdef SK_SUPPORT_SRC_BOUNDS_BLOAT_FOR_IMAGEFILTERS
- SkRect copy = *dst;
-#endif
dst->offset(fOffset.fX, fOffset.fY);
-#ifdef SK_SUPPORT_SRC_BOUNDS_BLOAT_FOR_IMAGEFILTERS
- dst->join(copy);
-#endif
}
void SkOffsetImageFilter::onFilterNodeBounds(const SkIRect& src, const SkMatrix& ctm,
@@ -85,9 +79,6 @@ void SkOffsetImageFilter::onFilterNodeBounds(const SkIRect& src, const SkMatrix&
*dst = src;
dst->offset(SkScalarCeilToInt(vec.fX), SkScalarCeilToInt(vec.fY));
-#ifdef SK_SUPPORT_SRC_BOUNDS_BLOAT_FOR_IMAGEFILTERS
- dst->join(src);
-#endif
}
SkFlattenable* SkOffsetImageFilter::CreateProc(SkReadBuffer& buffer) {
diff --git a/src/effects/SkTileImageFilter.cpp b/src/effects/SkTileImageFilter.cpp
index 6da572b3b8..55eb8a1d64 100644
--- a/src/effects/SkTileImageFilter.cpp
+++ b/src/effects/SkTileImageFilter.cpp
@@ -113,9 +113,6 @@ void SkTileImageFilter::onFilterNodeBounds(const SkIRect& src, const SkMatrix& c
SkRect rect = kReverse_MapDirection == direction ? fSrcRect : fDstRect;
ctm.mapRect(&rect);
rect.roundOut(dst);
-#ifdef SK_SUPPORT_SRC_BOUNDS_BLOAT_FOR_IMAGEFILTERS
- dst->join(src);
-#endif
}
bool SkTileImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm,
@@ -125,13 +122,7 @@ bool SkTileImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm,
}
void SkTileImageFilter::computeFastBounds(const SkRect& src, SkRect* dst) const {
-#ifdef SK_SUPPORT_SRC_BOUNDS_BLOAT_FOR_IMAGEFILTERS
- // This is a workaround for skia:3194.
- *dst = src;
- dst->join(fDstRect);
-#else
*dst = fDstRect;
-#endif
}
SkFlattenable* SkTileImageFilter::CreateProc(SkReadBuffer& buffer) {
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 0359b57ca5..4fdd4aea8a 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1171,11 +1171,7 @@ void SkGpuDevice::drawSprite(const SkDraw& draw, const SkBitmap& bitmap,
SkIPoint offset = SkIPoint::Make(0, 0);
SkMatrix matrix(*draw.fMatrix);
matrix.postTranslate(SkIntToScalar(-left), SkIntToScalar(-top));
-#ifdef SK_SUPPORT_SRC_BOUNDS_BLOAT_FOR_IMAGEFILTERS
- SkIRect clipBounds = SkIRect::MakeWH(bitmap.width(), bitmap.height());
-#else
SkIRect clipBounds = draw.fClip->getBounds().makeOffset(-left, -top);
-#endif
SkAutoTUnref<SkImageFilter::Cache> cache(getImageFilterCache());
// This cache is transient, and is freed (along with all its contained
// textures) when it goes out of scope.
@@ -1339,11 +1335,7 @@ void SkGpuDevice::drawDevice(const SkDraw& draw, SkBaseDevice* device,
SkIPoint offset = SkIPoint::Make(0, 0);
SkMatrix matrix(*draw.fMatrix);
matrix.postTranslate(SkIntToScalar(-x), SkIntToScalar(-y));
-#ifdef SK_SUPPORT_SRC_BOUNDS_BLOAT_FOR_IMAGEFILTERS
- SkIRect clipBounds = SkIRect::MakeWH(devTex->width(), devTex->height());
-#else
SkIRect clipBounds = draw.fClip->getBounds().makeOffset(-x, -y);
-#endif
// This cache is transient, and is freed (along with all its contained
// textures) when it goes out of scope.
SkAutoTUnref<SkImageFilter::Cache> cache(getImageFilterCache());