summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Chock <mchock@nvidia.com>2013-03-04 15:15:46 -0800
committerSteve Kondik <shade@chemlab.org>2013-05-31 22:15:25 -0700
commit143d05abd6e3e1a6b850bc6c10e5bf28362b2d8e (patch)
treef34bc70e9a7ff6ad917e91230467b97275c99b30
parentba27ea466575c61c42a435958695a15e69c308e5 (diff)
downloadframeworks_native-143d05abd6e3e1a6b850bc6c10e5bf28362b2d8e.zip
frameworks_native-143d05abd6e3e1a6b850bc6c10e5bf28362b2d8e.tar.gz
frameworks_native-143d05abd6e3e1a6b850bc6c10e5bf28362b2d8e.tar.bz2
Abort surface composition if hw surface is invalid
If an invalid display device is detected during surface composition (e.g., a simulated secondary display is removed), abort the composition. Change-Id: Ia6afb2e287882d8ae0614eb25463d3f85b687adf
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 1842949..f31bae4 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -1559,7 +1559,11 @@ void SurfaceFlinger::doComposeSurfaces(const sp<const DisplayDevice>& hw, const
const bool hasGlesComposition = hwc.hasGlesComposition(id) || (cur==end);
if (hasGlesComposition) {
- DisplayDevice::makeCurrent(mEGLDisplay, hw, mEGLContext);
+ if (!DisplayDevice::makeCurrent(mEGLDisplay, hw, mEGLContext)) {
+ ALOGW("DisplayDevice::makeCurrent failed. Aborting surface composition for display %s",
+ hw->getDisplayName().string());
+ return;
+ }
// set the frame buffer
glMatrixMode(GL_MODELVIEW);