diff options
| author | 2013-03-04 15:15:46 -0800 | |
|---|---|---|
| committer | 2013-05-13 13:26:19 -0700 | |
| commit | c8c71096195de0128e57574b1ddf685838ceb2f0 (patch) | |
| tree | d8fc08a04da4103bb05459889813405135833ee0 | |
| parent | 906bd0422a99b37663a1cb130bf061fdbb3ea189 (diff) | |
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.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 9afa4c12c2..055bfe47fa 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -1520,7 +1520,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); |