diff options
author | 2015-06-18 09:12:16 -0700 | |
---|---|---|
committer | 2015-06-18 09:12:17 -0700 | |
commit | 6dc6f5f4a153d33ed91565cb3cd397a310a937d0 (patch) | |
tree | a432ddf0638895a1d1d645876575aa64a9d9d6c7 /src/gpu/gl/GrGLRenderTarget.cpp | |
parent | 4c58e085b27c4cd9813ed7cad2388194d1d1f089 (diff) |
Add support for creating texture backed images where Skia will delete the texture.
Review URL: https://codereview.chromium.org/1187523005
Diffstat (limited to 'src/gpu/gl/GrGLRenderTarget.cpp')
-rw-r--r-- | src/gpu/gl/GrGLRenderTarget.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gpu/gl/GrGLRenderTarget.cpp b/src/gpu/gl/GrGLRenderTarget.cpp index a89022e27c..e93c5c100b 100644 --- a/src/gpu/gl/GrGLRenderTarget.cpp +++ b/src/gpu/gl/GrGLRenderTarget.cpp @@ -31,7 +31,7 @@ void GrGLRenderTarget::init(const GrSurfaceDesc& desc, const IDDesc& idDesc) { fRTFBOID = idDesc.fRTFBOID; fTexFBOID = idDesc.fTexFBOID; fMSColorRenderbufferID = idDesc.fMSColorRenderbufferID; - fIsWrapped = kWrapped_LifeCycle == idDesc.fLifeCycle; + fRTLifecycle = idDesc.fLifeCycle; fViewport.fLeft = 0; fViewport.fBottom = 0; @@ -59,7 +59,7 @@ size_t GrGLRenderTarget::onGpuMemorySize() const { } void GrGLRenderTarget::onRelease() { - if (!fIsWrapped) { + if (kBorrowed_LifeCycle != fRTLifecycle) { if (fTexFBOID) { GL_CALL(DeleteFramebuffers(1, &fTexFBOID)); } @@ -73,7 +73,6 @@ void GrGLRenderTarget::onRelease() { fRTFBOID = 0; fTexFBOID = 0; fMSColorRenderbufferID = 0; - fIsWrapped = false; INHERITED::onRelease(); } @@ -81,6 +80,5 @@ void GrGLRenderTarget::onAbandon() { fRTFBOID = 0; fTexFBOID = 0; fMSColorRenderbufferID = 0; - fIsWrapped = false; INHERITED::onAbandon(); } |