Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(387)

Unified Diff: src/effects/SkMatrixConvolutionImageFilter.cpp

Issue 1308703007: Fix filter primitive bounds computations. (Closed) Base URL: https://skia.googlesource.com/skia.git@saveLayer-bounds-not-transformed
Patch Set: Update to ToT Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/effects/SkMatrixConvolutionImageFilter.cpp
diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp
index 7c5dd8368f439e528ca06691d3f9ff3bb9273ad0..707e3a60b43529fc2b13e79b533d19f8f3954d4f 100644
--- a/src/effects/SkMatrixConvolutionImageFilter.cpp
+++ b/src/effects/SkMatrixConvolutionImageFilter.cpp
@@ -280,7 +280,7 @@ bool SkMatrixConvolutionImageFilter::onFilterImage(Proxy* proxy,
}
SkIRect bounds;
- if (!this->applyCropRect(ctx, proxy, src, &srcOffset, &bounds, &src)) {
+ if (!this->applyCropRect(this->mapContext(ctx), proxy, src, &srcOffset, &bounds, &src)) {
return false;
}
@@ -322,17 +322,12 @@ bool SkMatrixConvolutionImageFilter::onFilterImage(Proxy* proxy,
return true;
}
-bool SkMatrixConvolutionImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm,
- SkIRect* dst) const {
- SkIRect bounds = src;
- bounds.fRight += fKernelSize.width() - 1;
- bounds.fBottom += fKernelSize.height() - 1;
- bounds.offset(-fKernelOffset);
- if (getInput(0) && !getInput(0)->filterBounds(bounds, ctm, &bounds)) {
- return false;
- }
- *dst = bounds;
- return true;
+void SkMatrixConvolutionImageFilter::onFilterNodeBounds(const SkIRect& src, const SkMatrix& ctm,
+ SkIRect* dst, MapDirection direction) const {
+ *dst = src;
+ dst->fRight += fKernelSize.width() - 1;
+ dst->fBottom += fKernelSize.height() - 1;
+ dst->offset(kReverse_MapDirection == direction ? -fKernelOffset : fKernelOffset - SkIPoint::Make(fKernelSize.width() - 1, fKernelSize.height() - 1));
}
bool SkMatrixConvolutionImageFilter::canComputeFastBounds() const {

Powered by Google App Engine
This is Rietveld 408576698