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

Unified Diff: include/core/SkImageFilter.h

Issue 1848953002: Image filters: optimize crop rect application (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update to ToT Created 4 years, 9 months 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/SkColorFilterImageFilter.h » ('j') | src/core/SkImageFilter.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 d1b1483386bdd0c3378a16c50cd27e5e8e649c79..c677c9a297395b16c27b8b9242fc305d97fcfd1e 100644
--- a/include/core/SkImageFilter.h
+++ b/include/core/SkImageFilter.h
@@ -88,12 +88,14 @@ public:
/**
* Apply this cropRect to the imageBounds. If a given edge of the cropRect is not
- * set, then the corresponding edge from imageBounds will be used.
+ * set, then the corresponding edge from imageBounds will be used. If "embiggen"
+ * is false, edges which would grow the size of the bounds will be ignored; only
+ * edges which reduce the size of the bounds will be used.
robertphillips 2016/04/01 19:58:08 Maybe: * This is to accommodate filter that affect
Stephen White 2016/04/01 21:26:35 OK, I tried to clarify it a bit.
*
* Note: imageBounds is in "device" space, as the output cropped rectangle will be,
* so the matrix is ignored for those. It is only applied the croprect's bounds.
*/
robertphillips 2016/04/01 19:58:08 overlength
Stephen White 2016/04/01 21:26:35 Fixed.
- void applyTo(const SkIRect& imageBounds, const SkMatrix&, SkIRect* cropped) const;
+ void applyTo(const SkIRect& imageBounds, const SkMatrix&, bool embiggen, SkIRect* dst) const;
private:
SkRect fRect;
@@ -249,7 +251,7 @@ public:
virtual SkRect computeFastBounds(const SkRect&) const;
// Can this filter DAG compute the resulting bounds of an object-space rectangle?
- virtual bool canComputeFastBounds() const;
+ bool canComputeFastBounds() const;
/**
* If this filter can be represented by another filter + a localMatrix, return that filter,
@@ -466,6 +468,7 @@ private:
SkBitmap* result, SkIPoint* offset) const;
bool usesSrcInput() const { return fUsesSrcInput; }
+ virtual bool affectsTransparentBlack() const { return false; }
typedef SkFlattenable INHERITED;
int fInputCount;
« no previous file with comments | « no previous file | include/effects/SkColorFilterImageFilter.h » ('j') | src/core/SkImageFilter.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698