From 2a23184e4109060ec772763e80dae2132cf9d2eb Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Mon, 24 Sep 2012 18:12:35 -0700 Subject: [PATCH] don't call eglMakeCurrent() before calling HWC commit() on HWC 1.1 this call is not needed and misleading on HWC 1.1; it can also have a negative performance impact when multiple displays are used. Bug: 7124069 Change-Id: I47cd25c9d6e69abcc9333b9ecd5044e8fb1919ec --- services/surfaceflinger/SurfaceFlinger.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 837269101..bc7552d7e 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -927,10 +927,13 @@ void SurfaceFlinger::postFramebuffer() HWComposer& hwc(getHwComposer()); if (hwc.initCheck() == NO_ERROR) { - // FIXME: EGL spec says: - // "surface must be bound to the calling thread's current context, - // for the current rendering API." - DisplayDevice::makeCurrent(mEGLDisplay, getDefaultDisplayDevice(), mEGLContext); + if (!hwc.supportsFramebufferTarget()) { + // EGL spec says: + // "surface must be bound to the calling thread's current context, + // for the current rendering API." + DisplayDevice::makeCurrent(mEGLDisplay, + getDefaultDisplayDevice(), mEGLContext); + } hwc.commit(); }