From fcea56c5d85a7bb91600194a5641a3958f96db9a Mon Sep 17 00:00:00 2001 From: Greg Daniel Date: Tue, 6 Mar 2018 15:17:57 -0500 Subject: Make GrReleaseProcHelper an SkWeakRefCnt Bug: skia: Change-Id: Iccc22d477c17c4c58615e3f3bf9e551f9596b710 Reviewed-on: https://skia-review.googlesource.com/112562 Reviewed-by: Brian Salomon Commit-Queue: Greg Daniel --- include/private/GrTypesPriv.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/private/GrTypesPriv.h b/include/private/GrTypesPriv.h index c7a7296639..5c6d1024be 100644 --- a/include/private/GrTypesPriv.h +++ b/include/private/GrTypesPriv.h @@ -12,7 +12,7 @@ #include "GrSharedEnums.h" #include "GrTypes.h" #include "SkImageInfo.h" -#include "SkRefCnt.h" +#include "SkWeakRefCnt.h" class GrCaps; @@ -1247,14 +1247,16 @@ static inline GrPixelConfig GrColorTypeToPixelConfig(GrColorType config, return kUnknown_GrPixelConfig; } -class GrReleaseProcHelper : public SkRefCnt { +class GrReleaseProcHelper : public SkWeakRefCnt { public: // These match the definitions in SkImage, from whence they came typedef void* ReleaseCtx; typedef void (*ReleaseProc)(ReleaseCtx); GrReleaseProcHelper(ReleaseProc proc, ReleaseCtx ctx) : fReleaseProc(proc), fReleaseCtx(ctx) {} - ~GrReleaseProcHelper() override { + ~GrReleaseProcHelper() override {} + + void weak_dispose() const override { fReleaseProc(fReleaseCtx); } -- cgit v1.2.3