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

Unified Diff: include/effects/SkPictureImageFilter.h

Issue 787073003: Adding an option for pixelated rendering in SkPictureImageFilter (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 | « gm/pictureimagefilter.cpp ('k') | src/effects/SkPictureImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
};
« no previous file with comments | « gm/pictureimagefilter.cpp ('k') | src/effects/SkPictureImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698