diff options
Diffstat (limited to 'src/core/SkCanvas.cpp')
-rw-r--r-- | src/core/SkCanvas.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index 3880fa9d73..0c9c20d1ee 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -40,8 +40,6 @@ #include "GrRenderTarget.h" #endif -#define SK_SUPPORT_SRC_BOUNDS_BLOAT_FOR_IMAGEFILTERS - /* * Return true if the drawing this rect would hit every pixels in the canvas. * @@ -1084,6 +1082,10 @@ bool SkCanvas::clipRectBounds(const SkRect* bounds, SaveFlags flags, } else { bounds = nullptr; } +#else + if (bounds && !imageFilter->canComputeFastBounds()) { + bounds = nullptr; + } #endif } SkIRect ir; @@ -1370,7 +1372,11 @@ 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(), SkImageFilter::kApprox_SizeConstraint); |