diff options
author | 2017-04-21 11:52:27 -0400 | |
---|---|---|
committer | 2017-04-21 17:20:27 +0000 | |
commit | cef213c97ea9992efacd028fe304a18b438f8147 (patch) | |
tree | aa7662dd076fad410dad942da947014abb8cd205 /include | |
parent | 795c5b156756796cbb3a584c99b1ab51fb5fe187 (diff) |
Move ReleaseProc info to GrTexture and for implementations to define it.
Bug: skia:
Change-Id: I0dbe421ebd17ef7d21fd2f4f027d2a3bdcf04b7b
Reviewed-on: https://skia-review.googlesource.com/14031
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/gpu/GrSurface.h | 24 | ||||
-rw-r--r-- | include/gpu/GrTexture.h | 6 |
2 files changed, 8 insertions, 22 deletions
diff --git a/include/gpu/GrSurface.h b/include/gpu/GrSurface.h index 65f1e0f690..dd37c18008 100644 --- a/include/gpu/GrSurface.h +++ b/include/gpu/GrSurface.h @@ -70,14 +70,6 @@ public: inline GrSurfacePriv surfacePriv(); inline const GrSurfacePriv surfacePriv() const; - typedef void* ReleaseCtx; - typedef void (*ReleaseProc)(ReleaseCtx); - - void setRelease(ReleaseProc proc, ReleaseCtx ctx) { - fReleaseProc = proc; - fReleaseCtx = ctx; - } - static size_t WorstCaseSize(const GrSurfaceDesc& desc, bool useNextPow2 = false); static size_t ComputeSize(const GrSurfaceDesc& desc, int colorSamplesPerPixel, bool hasMIPMaps, bool useNextPow2 = false); @@ -93,11 +85,9 @@ protected: GrSurface(GrGpu* gpu, const GrSurfaceDesc& desc) : INHERITED(gpu) - , fDesc(desc) - , fReleaseProc(nullptr) - , fReleaseCtx(nullptr) { + , fDesc(desc) { } - ~GrSurface() override; + ~GrSurface() override {} GrSurfaceDesc fDesc; @@ -105,16 +95,6 @@ protected: void onAbandon() override; private: - void invokeReleaseProc() { - if (fReleaseProc) { - fReleaseProc(fReleaseCtx); - fReleaseProc = nullptr; - } - } - - ReleaseProc fReleaseProc; - ReleaseCtx fReleaseCtx; - typedef GrGpuResource INHERITED; }; diff --git a/include/gpu/GrTexture.h b/include/gpu/GrTexture.h index 1f63958d28..ba7d506c7d 100644 --- a/include/gpu/GrTexture.h +++ b/include/gpu/GrTexture.h @@ -41,6 +41,12 @@ public: } #endif + // These match the definitions in SkImage, for whence they came + typedef void* ReleaseCtx; + typedef void (*ReleaseProc)(ReleaseCtx); + + virtual void setRelease(ReleaseProc proc, ReleaseCtx ctx) = 0; + /** Access methods that are only to be used within Skia code. */ inline GrTexturePriv texturePriv(); inline const GrTexturePriv texturePriv() const; |