Make SkPictureShader and SkPictureImageFilter use const SkPictures
R=mtklein@google.com, reed@google.com
TBR=reed@google.com
Author: robertphillips@google.com
Review URL: https://codereview.chromium.org/390023002
diff --git a/include/effects/SkPictureImageFilter.h b/include/effects/SkPictureImageFilter.h
index fe07215..84d0c10 100644
--- a/include/effects/SkPictureImageFilter.h
+++ b/include/effects/SkPictureImageFilter.h
@@ -16,7 +16,7 @@
/**
* Refs the passed-in picture.
*/
- static SkPictureImageFilter* Create(SkPicture* picture) {
+ static SkPictureImageFilter* Create(const SkPicture* picture) {
return SkNEW_ARGS(SkPictureImageFilter, (picture));
}
@@ -24,15 +24,15 @@
* 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(SkPicture* picture, const SkRect& cropRect) {
+ static SkPictureImageFilter* Create(const SkPicture* picture, const SkRect& cropRect) {
return SkNEW_ARGS(SkPictureImageFilter, (picture, cropRect));
}
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPictureImageFilter)
protected:
- explicit SkPictureImageFilter(SkPicture* picture);
- SkPictureImageFilter(SkPicture* picture, const SkRect& cropRect);
+ explicit SkPictureImageFilter(const SkPicture* picture);
+ SkPictureImageFilter(const SkPicture* picture, const SkRect& cropRect);
virtual ~SkPictureImageFilter();
/* Constructs an SkPictureImageFilter object from an SkReadBuffer.
* Note: If the SkPictureImageFilter object construction requires bitmap
@@ -48,8 +48,8 @@
SkIRect* dst) const SK_OVERRIDE;
private:
- SkPicture* fPicture;
- SkRect fCropRect;
+ const SkPicture* fPicture;
+ SkRect fCropRect;
typedef SkImageFilter INHERITED;
};