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

Unified Diff: include/core/SkImageFilter.h

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
« no previous file with comments | « no previous file | include/effects/SkBlurImageFilter.h » ('j') | src/core/SkRecordDraw.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkImageFilter.h
diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h
index 909a2f82840e93c2c6842a3407ef3b67ec3eb893..e9f856be209949f4153aa4436f0e6cba121acae0 100644
--- a/include/core/SkImageFilter.h
+++ b/include/core/SkImageFilter.h
@@ -156,6 +156,12 @@ public:
*/
bool filterBounds(const SkIRect& src, const SkMatrix& ctm, SkIRect* dst) const;
+ Context mapContext(const Context& ctx) const {
+ SkIRect clipBounds;
+ this->onFilterNodeBounds(ctx.clipBounds(), ctx.ctm(), &clipBounds, MapDirection::kReverse_MapDirection);
+ return Context(ctx.ctm(), clipBounds, ctx.cache(), ctx.sizeConstraint());
+ }
+
/**
* Returns true if the filter can be processed on the GPU. This is most
* often used for multi-pass effects, where intermediate results must be
@@ -346,6 +352,13 @@ protected:
// implementation recursively unions all input bounds, or returns false if
// no inputs.
virtual bool onFilterBounds(const SkIRect&, const SkMatrix&, SkIRect*) const;
+ enum MapDirection {
+ kForward_MapDirection,
+ kReverse_MapDirection
+ };
+
+ // Non-recursive version of the above.
+ virtual void onFilterNodeBounds(const SkIRect&, const SkMatrix&, SkIRect*, MapDirection direction) const;
// Helper function which invokes filter processing on the input at the
// specified "index". If the input is null, it leaves "result" and
« no previous file with comments | « no previous file | include/effects/SkBlurImageFilter.h » ('j') | src/core/SkRecordDraw.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698