Skia: Track the fIsWrapped separately so that we delete correctly
GrGlTextureRenderTarget inherits virtually from both GrGlRenderTarget and
GrGLTexture, which both have a 'wrap' flag. The passed in wrap setting could
be different for the two base classes, but since it's virtually inherited,
they share the same flag, so they're either both on, or both off.
As a result, we fail to delete the frambuffer.
To fix this, we now keep a separate isWrapped flag for GrGlRenderTarget.
BUG=437998
Review URL: https://codereview.chromium.org/791493003
diff --git a/src/gpu/gl/GrGLTexture.cpp b/src/gpu/gl/GrGLTexture.cpp
index 8777d1b..ce892dd 100644
--- a/src/gpu/gl/GrGLTexture.cpp
+++ b/src/gpu/gl/GrGLTexture.cpp
@@ -30,20 +30,23 @@
fTexParams.invalidate();
fTexParamsTimestamp = GrGpu::kExpiredTimestamp;
fTextureID = idDesc.fTextureID;
+ fIsWrapped = idDesc.fIsWrapped;
}
void GrGLTexture::onRelease() {
if (fTextureID) {
- if (!this->isWrapped()) {
+ if (!fIsWrapped) {
GL_CALL(DeleteTextures(1, &fTextureID));
}
fTextureID = 0;
+ fIsWrapped = false;
}
INHERITED::onRelease();
}
void GrGLTexture::onAbandon() {
fTextureID = 0;
+ fIsWrapped = false;
INHERITED::onAbandon();
}