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

Unified Diff: include/core/SkImageFilter.h

Issue 23295017: In image filters, apply the CTM and offset to the crop rect. This is necessary to compensate for bo… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix documentation comment. Created 7 years, 4 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 | « gm/lighting.cpp ('k') | include/effects/SkMagnifierImageFilter.h » ('j') | no next file with comments »
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 01b3e0bca85279231952913e927e057128be8b3a..7b9dd3217ed32e52cae9174e58c70a02db6ebe66 100644
--- a/include/core/SkImageFilter.h
+++ b/include/core/SkImageFilter.h
@@ -77,16 +77,18 @@ public:
* caller to unref it.
*
* The effect can assume its vertexCoords space maps 1-to-1 with texels
- * in the texture. "offset" is the delta between the source and
- * destination rect's origins, when cropped processing is being performed.
+ * in the texture. "matrix" is a transformation to apply to filter
+ * parameters before they are used in the effect. Note that this function
+ * will be called with (NULL, NULL, SkMatrix::I()) to query for support,
+ * so returning "true" indicates support for all possible matrices.
*/
- virtual bool asNewEffect(GrEffectRef** effect, GrTexture*, const SkIPoint& offset) const;
+ virtual bool asNewEffect(GrEffectRef** effect, GrTexture*, const SkMatrix& matrix) const;
/**
* 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
* rendered to textures. For single-pass effects, use asNewEffect().
- * The default implementation returns asNewEffect(NULL, NULL).
+ * The default implementation returns asNewEffect(NULL, NULL, SkMatrix::I()).
*/
virtual bool canFilterImageGPU() const;
@@ -159,9 +161,10 @@ protected:
// Default impl copies src into dst and returns true
virtual bool onFilterBounds(const SkIRect&, const SkMatrix&, SkIRect*);
- // Sets rect to the intersection of rect and the crop rect. If there
- // is no overlap, returns false and leaves rect unchanged.
- bool applyCropRect(SkIRect* rect) const;
+ // Applies "matrix" to the crop rect, and sets "rect" to the intersection of
+ // "rect" and the transformed crop rect. If there is no overlap, returns
+ // false and leaves "rect" unchanged.
+ bool applyCropRect(SkIRect* rect, const SkMatrix& matrix) const;
private:
typedef SkFlattenable INHERITED;
« no previous file with comments | « gm/lighting.cpp ('k') | include/effects/SkMagnifierImageFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698