OSDN Git Service

Fix virtual displays for HWC 1.0
authorAndy McFadden <fadden@android.com>
Tue, 20 Aug 2013 23:04:47 +0000 (16:04 -0700)
committerAndy McFadden <fadden@android.com>
Tue, 20 Aug 2013 23:04:47 +0000 (16:04 -0700)
We weren't swapping the buffers.

Bug 10366404

Change-Id: I43eb7648231bedf24899da6fc0d9acc09e0b047e

services/surfaceflinger/DisplayDevice.cpp

index 79b6689..ad63cac 100644 (file)
@@ -218,13 +218,15 @@ status_t DisplayDevice::prepareFrame(const HWComposer& hwc) const {
 }
 
 void DisplayDevice::swapBuffers(HWComposer& hwc) const {
-    // We need to call eglSwapBuffers() unless:
-    // (a) there was no GLES composition this frame, or
-    // (b) we're using a legacy HWC with no framebuffer target support (in
-    //     which case HWComposer::commit() handles things).
+    // We need to call eglSwapBuffers() if:
+    //  (1) we don't have a hardware composer, or
+    //  (2) we did GLES composition this frame, and either
+    //    (a) we have framebuffer target support (not present on legacy
+    //        devices, where HWComposer::commit() handles things); or
+    //    (b) this is a virtual display
     if (hwc.initCheck() != NO_ERROR ||
             (hwc.hasGlesComposition(mHwcDisplayId) &&
-             hwc.supportsFramebufferTarget())) {
+             (hwc.supportsFramebufferTarget() || mType >= DISPLAY_VIRTUAL))) {
         EGLBoolean success = eglSwapBuffers(mDisplay, mSurface);
         if (!success) {
             EGLint error = eglGetError();