aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPictureShader.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/SkPictureShader.h')
-rw-r--r--src/core/SkPictureShader.h26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/core/SkPictureShader.h b/src/core/SkPictureShader.h
index 8cccd251d5..eb9c38b95b 100644
--- a/src/core/SkPictureShader.h
+++ b/src/core/SkPictureShader.h
@@ -22,8 +22,8 @@ class SkPicture;
*/
class SkPictureShader : public SkShader {
public:
- static SkShader* Create(const SkPicture*, TileMode, TileMode, const SkMatrix*,
- const SkRect*);
+ static sk_sp<SkShader> Make(sk_sp<const SkPicture>, TileMode, TileMode, const SkMatrix*,
+ const SkRect*);
SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPictureShader)
@@ -42,18 +42,19 @@ protected:
Context* onCreateContext(const ContextRec&, void* storage) const override;
private:
- SkPictureShader(const SkPicture*, TileMode, TileMode, const SkMatrix*, const SkRect*);
+ SkPictureShader(sk_sp<const SkPicture>, TileMode, TileMode, const SkMatrix*, const SkRect*);
- SkShader* refBitmapShader(const SkMatrix&, const SkMatrix* localMatrix, const int maxTextureSize = 0) const;
+ sk_sp<SkShader> refBitmapShader(const SkMatrix&, const SkMatrix* localMatrix,
+ const int maxTextureSize = 0) const;
- SkAutoTUnref<const SkPicture> fPicture;
- SkRect fTile;
- TileMode fTmx, fTmy;
+ sk_sp<const SkPicture> fPicture;
+ SkRect fTile;
+ TileMode fTmx, fTmy;
class PictureShaderContext : public SkShader::Context {
public:
static Context* Create(void* storage, const SkPictureShader&, const ContextRec&,
- SkShader* bitmapShader);
+ sk_sp<SkShader> bitmapShader);
virtual ~PictureShaderContext();
@@ -63,11 +64,12 @@ private:
void shadeSpan(int x, int y, SkPMColor dstC[], int count) override;
private:
- PictureShaderContext(const SkPictureShader&, const ContextRec&, SkShader* bitmapShader);
+ PictureShaderContext(const SkPictureShader&, const ContextRec&,
+ sk_sp<SkShader> bitmapShader);
- SkAutoTUnref<SkShader> fBitmapShader;
- SkShader::Context* fBitmapShaderContext;
- void* fBitmapShaderContextStorage;
+ sk_sp<SkShader> fBitmapShader;
+ SkShader::Context* fBitmapShaderContext;
+ void* fBitmapShaderContextStorage;
typedef SkShader::Context INHERITED;
};