From f2568dea419562ad75b2e79dcbd358af34e9f8ad Mon Sep 17 00:00:00 2001 From: Michael Lentine Date: Wed, 20 Aug 2014 10:51:23 -0700 Subject: [PATCH] Destroy eglSurface before recreating. Bug: 16856208 Change-Id: Ifb5c8997afab4bc922356a3542d1f899a2546855 --- services/surfaceflinger/DisplayDevice.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/surfaceflinger/DisplayDevice.cpp b/services/surfaceflinger/DisplayDevice.cpp index 221325979..05f500efc 100644 --- a/services/surfaceflinger/DisplayDevice.cpp +++ b/services/surfaceflinger/DisplayDevice.cpp @@ -401,6 +401,11 @@ status_t DisplayDevice::orientationToTransfrom( void DisplayDevice::setDisplaySize(const int newWidth, const int newHeight) { dirtyRegion.set(getBounds()); + if (mSurface != EGL_NO_SURFACE) { + eglDestroySurface(mDisplay, mSurface); + mSurface = EGL_NO_SURFACE; + } + mDisplaySurface->resizeBuffers(newWidth, newHeight); ANativeWindow* const window = mNativeWindow.get();