Force-use the pbuffer surface for destroy

Bug: 18518580

If CanvasContext is being destroyed() the Surface
is probably no longer valid as well, so make sure to
makeCurrent() to the pbuffer surface so that the
subsequent GL operations are not using an invalid
EGLSurface

Change-Id: Ica5d6a065841772c47e00ad65aa7894c7e27e043
This commit is contained in:
John Reck
2014-11-25 09:54:13 -08:00
parent 0c31d97a38
commit b945f2313a

View File

@@ -60,6 +60,8 @@ CanvasContext::~CanvasContext() {
void CanvasContext::destroy() {
stopDrawing();
setSurface(NULL);
mEglManager.usePBufferSurface();
freePrefetechedLayers();
destroyHardwareResources();
mAnimationContext->destroy();
@@ -67,7 +69,6 @@ void CanvasContext::destroy() {
delete mCanvas;
mCanvas = 0;
}
setSurface(NULL);
}
void CanvasContext::setSurface(ANativeWindow* window) {