OSDN Git Service

Destroy eglSurface before recreating.
authorMichael Lentine <mlentine@google.com>
Wed, 20 Aug 2014 17:51:23 +0000 (10:51 -0700)
committerMichael Lentine <mlentine@google.com>
Wed, 20 Aug 2014 17:56:34 +0000 (10:56 -0700)
Bug: 16856208

Change-Id: Ifb5c8997afab4bc922356a3542d1f899a2546855

services/surfaceflinger/DisplayDevice.cpp

index 2213259..05f500e 100644 (file)
@@ -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();