Chromium Code Reviews| Index: include/effects/SkPictureImageFilter.h |
| diff --git a/include/effects/SkPictureImageFilter.h b/include/effects/SkPictureImageFilter.h |
| index 8c3c9c46ec9d24188a2afbb27448ccf65ffc172a..ded3f88207c0fa7e8352a64af558cf8bec554c0d 100644 |
| --- a/include/effects/SkPictureImageFilter.h |
| +++ b/include/effects/SkPictureImageFilter.h |
| @@ -27,34 +27,37 @@ public: |
| static SkPictureImageFilter* Create(const SkPicture* picture, const SkRect& cropRect, |
| uint32_t uniqueID = 0) { |
| return SkNEW_ARGS(SkPictureImageFilter, (picture, cropRect, uniqueID, |
| - kDeviceSpace_PictureResolution)); |
| + kDeviceSpace_PictureMode)); |
| } |
| /** |
| * 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 |
| + * destination canvas, bilinear filtering will be used. If pixelated is true, then |
| + * nearest neighbor filtering is used instead. 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) { |
| + uint32_t uniqueID = 0, |
| + bool pixelated = false) { |
|
Stephen White
2014/12/09 16:22:10
I think this should take a SkPaint::FilterLevel, r
|
| return SkNEW_ARGS(SkPictureImageFilter, (picture, cropRect, uniqueID, |
| - kLocalSpace_PictureResolution)); |
| + pixelated ? kLocalSpacePixelated_PictureMode : kLocalSpace_PictureMode)); |
| } |
| SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPictureImageFilter) |
| protected: |
| - enum PictureResolution { |
| - kDeviceSpace_PictureResolution, |
| - kLocalSpace_PictureResolution |
| + enum PictureMode { |
| + kDeviceSpace_PictureMode, |
| + kLocalSpace_PictureMode, |
| + kLocalSpacePixelated_PictureMode |
| }; |
| explicit SkPictureImageFilter(const SkPicture* picture, uint32_t uniqueID); |
| SkPictureImageFilter(const SkPicture* picture, const SkRect& cropRect, uint32_t uniqueID, |
| - PictureResolution); |
| + PictureMode); |
| virtual ~SkPictureImageFilter(); |
| /* Constructs an SkPictureImageFilter object from an SkReadBuffer. |
| * Note: If the SkPictureImageFilter object construction requires bitmap |
| @@ -76,7 +79,7 @@ private: |
| const SkPicture* fPicture; |
| SkRect fCropRect; |
| - PictureResolution fPictureResolution; |
| + PictureMode fPictureMode; |
| typedef SkImageFilter INHERITED; |
| }; |