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

Unified Diff: src/core/SkPictureShader.h

Issue 1772463002: use Make instead of Create to return a shared shader (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 months 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 | « src/core/SkPaint.cpp ('k') | src/core/SkPictureShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPictureShader.h
diff --git a/src/core/SkPictureShader.h b/src/core/SkPictureShader.h
index 8cccd251d558db6d80d383e5c88bb1e3d1e4fdae..eb9c38b95b499f664074aedff4a27304bb361a99 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;
};
« no previous file with comments | « src/core/SkPaint.cpp ('k') | src/core/SkPictureShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698