Index: include/effects/SkPictureImageFilter.h |
diff --git a/include/effects/SkPictureImageFilter.h b/include/effects/SkPictureImageFilter.h |
index f4f1fff4effa65fd386520edc16b1b8b056ceb09..8c3c9c46ec9d24188a2afbb27448ccf65ffc172a 100644 |
--- a/include/effects/SkPictureImageFilter.h |
+++ b/include/effects/SkPictureImageFilter.h |
@@ -24,15 +24,37 @@ public: |
* Refs the passed-in picture. cropRect can be used to crop or expand the destination rect when |
* the picture is drawn. (No scaling is implied by the dest rect; only the CTM is applied.) |
*/ |
- static SkPictureImageFilter* Create(const SkPicture* picture, const SkRect& cropRect, uint32_t uniqueID = 0) { |
- return SkNEW_ARGS(SkPictureImageFilter, (picture, cropRect, uniqueID)); |
+ static SkPictureImageFilter* Create(const SkPicture* picture, const SkRect& cropRect, |
+ uint32_t uniqueID = 0) { |
+ return SkNEW_ARGS(SkPictureImageFilter, (picture, cropRect, uniqueID, |
+ kDeviceSpace_PictureResolution)); |
+ } |
+ |
+ /** |
+ * Refs the passed-in picture. The picture is rasterized at a resolution that matches the |
+ * local coordinate space. If the picture needs to be resampled for drawing it into the |
+ * destination canvas, bilinear filtering will be used. cropRect can be used to crop or |
+ * expand the destination rect when the picture is drawn. (No scaling is implied by the |
+ * dest rect; only the CTM is applied.) |
+ */ |
+ static SkPictureImageFilter* CreateForLocalSpace(const SkPicture* picture, |
+ const SkRect& cropRect, |
+ uint32_t uniqueID = 0) { |
+ return SkNEW_ARGS(SkPictureImageFilter, (picture, cropRect, uniqueID, |
+ kLocalSpace_PictureResolution)); |
} |
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPictureImageFilter) |
protected: |
+ enum PictureResolution { |
+ kDeviceSpace_PictureResolution, |
+ kLocalSpace_PictureResolution |
+ }; |
+ |
explicit SkPictureImageFilter(const SkPicture* picture, uint32_t uniqueID); |
- SkPictureImageFilter(const SkPicture* picture, const SkRect& cropRect, uint32_t uniqueID); |
+ SkPictureImageFilter(const SkPicture* picture, const SkRect& cropRect, uint32_t uniqueID, |
+ PictureResolution); |
virtual ~SkPictureImageFilter(); |
/* Constructs an SkPictureImageFilter object from an SkReadBuffer. |
* Note: If the SkPictureImageFilter object construction requires bitmap |
@@ -45,8 +67,16 @@ protected: |
SkBitmap* result, SkIPoint* offset) const SK_OVERRIDE; |
private: |
- const SkPicture* fPicture; |
- SkRect fCropRect; |
+ |
+ |
+ void drawPictureAtDeviceResolution(Proxy*, SkBaseDevice*, const SkIRect& deviceBounds, |
+ const Context&) const; |
+ void drawPictureAtLocalResolution(Proxy*, SkBaseDevice*, const SkIRect& deviceBounds, |
+ const Context&) const; |
+ |
+ const SkPicture* fPicture; |
+ SkRect fCropRect; |
+ PictureResolution fPictureResolution; |
typedef SkImageFilter INHERITED; |
}; |