SF: Call makeCurrent after presenting each display
HWC can change EGLContext in each present. Restore to
default EGLContext after commiting each display.
Change-Id: I4abc84fb3d4b74964fabcad5a2568ff01a6c5dbb
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 13c98e7..a0e040b 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -1475,13 +1475,7 @@
mHwc->commit(hwcId);
}
displayDevice->onSwapBuffersCompleted();
- if (displayId == 0) {
- // Make the default display current because the VirtualDisplayDevice
- // code cannot deal with dequeueBuffer() being called outside of the
- // composition loop; however the code below can call glFlush() which
- // is allowed to (and does in some case) call dequeueBuffer().
- displayDevice->makeCurrent(mEGLDisplay, mEGLContext);
- }
+ displayDevice->makeCurrent(mEGLDisplay, mEGLContext);
for (auto& layer : displayDevice->getVisibleLayersSortedByZ()) {
sp<Fence> releaseFence = Fence::NO_FENCE;
if (layer->getCompositionType(hwcId) == HWC2::Composition::Client) {