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/src/core/SkPictureShader.cpp b/src/core/SkPictureShader.cpp
index ab4de03..6ea67f8 100644
--- a/src/core/SkPictureShader.cpp
+++ b/src/core/SkPictureShader.cpp
@@ -18,7 +18,7 @@
#include "GrContext.h"
#endif
-SkPictureShader::SkPictureShader(SkPicture* picture, TileMode tmx, TileMode tmy,
+SkPictureShader::SkPictureShader(const SkPicture* picture, TileMode tmx, TileMode tmy,
const SkMatrix* localMatrix)
: INHERITED(localMatrix)
, fPicture(SkRef(picture))
@@ -36,7 +36,7 @@
fPicture->unref();
}
-SkPictureShader* SkPictureShader::Create(SkPicture* picture, TileMode tmx, TileMode tmy,
+SkPictureShader* SkPictureShader::Create(const SkPicture* picture, TileMode tmx, TileMode tmy,
const SkMatrix* localMatrix) {
if (!picture || 0 == picture->width() || 0 == picture->height()) {
return NULL;
diff --git a/src/core/SkPictureShader.h b/src/core/SkPictureShader.h
index 8df6030..00aee9b 100644
--- a/src/core/SkPictureShader.h
+++ b/src/core/SkPictureShader.h
@@ -21,7 +21,7 @@
*/
class SkPictureShader : public SkShader {
public:
- static SkPictureShader* Create(SkPicture*, TileMode, TileMode, const SkMatrix* = NULL);
+ static SkPictureShader* Create(const SkPicture*, TileMode, TileMode, const SkMatrix* = NULL);
virtual ~SkPictureShader();
virtual size_t contextSize() const SK_OVERRIDE;
@@ -38,12 +38,12 @@
virtual Context* onCreateContext(const ContextRec&, void* storage) const SK_OVERRIDE;
private:
- SkPictureShader(SkPicture*, TileMode, TileMode, const SkMatrix* = NULL);
+ SkPictureShader(const SkPicture*, TileMode, TileMode, const SkMatrix* = NULL);
SkShader* refBitmapShader(const SkMatrix&, const SkMatrix* localMatrix) const;
- SkPicture* fPicture;
- TileMode fTmx, fTmy;
+ const SkPicture* fPicture;
+ TileMode fTmx, fTmy;
mutable SkMutex fCachedBitmapShaderMutex;
mutable SkAutoTUnref<SkShader> fCachedBitmapShader;