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

Unified Diff: src/image/SkImageShader.h

Issue 2239723002: fix memory leak, remake Imageshader to use sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 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/image/SkImage.cpp ('k') | src/image/SkImageShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImageShader.h
diff --git a/src/image/SkImageShader.h b/src/image/SkImageShader.h
index e9911e6c2500ae124fd8927857a7f083d986cf8f..213d5e8a8df0ffc0651b590342d348667fd1dabd 100644
--- a/src/image/SkImageShader.h
+++ b/src/image/SkImageShader.h
@@ -14,7 +14,7 @@
class SkImageShader : public SkShader {
public:
- static sk_sp<SkShader> Make(const SkImage*, TileMode tx, TileMode ty,
+ static sk_sp<SkShader> Make(sk_sp<SkImage>, TileMode tx, TileMode ty,
const SkMatrix* localMatrix, SkTBlitterAllocator* = nullptr);
bool isOpaque() const override;
@@ -26,7 +26,7 @@ public:
sk_sp<GrFragmentProcessor> asFragmentProcessor(const AsFPArgs&) const override;
#endif
- SkImageShader(const SkImage*, TileMode tx, TileMode ty, const SkMatrix* localMatrix);
+ SkImageShader(sk_sp<SkImage>, TileMode tx, TileMode ty, const SkMatrix* localMatrix);
protected:
void flatten(SkWriteBuffer&) const override;
@@ -35,9 +35,9 @@ protected:
bool onIsABitmap(SkBitmap*, SkMatrix*, TileMode*) const override;
SkImage* onIsAImage(SkMatrix*, TileMode*) const override;
- SkAutoTUnref<const SkImage> fImage;
- const TileMode fTileModeX;
- const TileMode fTileModeY;
+ sk_sp<SkImage> fImage;
+ const TileMode fTileModeX;
+ const TileMode fTileModeY;
private:
friend class SkShader;
« no previous file with comments | « src/image/SkImage.cpp ('k') | src/image/SkImageShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698