am dec3f138: Merge "Force-use the pbuffer surface for destroy" into lmp-mr1-dev

* commit 'dec3f138c2f6a31879b0fe055a26d618e4874bb5':
  Force-use the pbuffer surface for destroy
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp
index 39528be..4f39ac9 100644
--- a/libs/hwui/renderthread/CanvasContext.cpp
+++ b/libs/hwui/renderthread/CanvasContext.cpp
@@ -60,6 +60,8 @@
 
 void CanvasContext::destroy() {
     stopDrawing();
+    setSurface(NULL);
+    mEglManager.usePBufferSurface();
     freePrefetechedLayers();
     destroyHardwareResources();
     mAnimationContext->destroy();
@@ -67,7 +69,6 @@
         delete mCanvas;
         mCanvas = 0;
     }
-    setSurface(NULL);
 }
 
 void CanvasContext::setSurface(ANativeWindow* window) {