| Index: src/core/SkSpecialSurface.cpp
|
| diff --git a/src/core/SkSpecialSurface.cpp b/src/core/SkSpecialSurface.cpp
|
| index 5d57dcfd4fc0bea5c1677e43955ef74c7b769de5..548552cc93a7aecbe0f8fc8a6644bdb9dc284fc5 100644
|
| --- a/src/core/SkSpecialSurface.cpp
|
| +++ b/src/core/SkSpecialSurface.cpp
|
| @@ -54,7 +54,7 @@ SkCanvas* SkSpecialSurface::getCanvas() {
|
| SkSpecialImage* SkSpecialSurface::newImageSnapshot() {
|
| SkSpecialImage* image = as_SB(this)->onNewImageSnapshot();
|
| as_SB(this)->reset();
|
| - return SkSafeRef(image); // the caller will call unref() to balance this
|
| + return image; // the caller gets the creation ref
|
| }
|
|
|
| ///////////////////////////////////////////////////////////////////////////////
|
| @@ -110,7 +110,7 @@ class SkSpecialSurface_Gpu : public SkSpecialSurface_Base {
|
| public:
|
| SkSpecialSurface_Gpu(GrTexture* texture, const SkIRect& subset, const SkSurfaceProps* props)
|
| : INHERITED(subset, props)
|
| - , fTexture(texture) {
|
| + , fTexture(SkRef(texture)) {
|
|
|
| SkASSERT(fTexture->asRenderTarget());
|
|
|
| @@ -151,7 +151,7 @@ SkSpecialSurface* SkSpecialSurface::NewRenderTarget(GrContext* context,
|
| return nullptr;
|
| }
|
|
|
| - GrTexture* temp = context->textureProvider()->createApproxTexture(desc);
|
| + SkAutoTUnref<GrTexture> temp(context->textureProvider()->createApproxTexture(desc));
|
| if (!temp) {
|
| return nullptr;
|
| }
|
|
|