summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorAndy McFadden <fadden@android.com>2013-08-21 14:31:34 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-08-21 14:31:35 +0000
commit32551478fc5417d3b7b5e33a202eb6ca66061f7d (patch)
tree15af2f2aed316ec18085949c236f37851c4d4f2b /services
parent4f4f0943489d9113c66ac22b58cfba8c21dfa879 (diff)
parent22a99f0fc2884227b9d7e46959fcbe6270667efb (diff)
downloadframeworks_native-32551478fc5417d3b7b5e33a202eb6ca66061f7d.zip
frameworks_native-32551478fc5417d3b7b5e33a202eb6ca66061f7d.tar.gz
frameworks_native-32551478fc5417d3b7b5e33a202eb6ca66061f7d.tar.bz2
Merge "Fix virtual displays for HWC 1.0" into klp-dev
Diffstat (limited to 'services')
-rw-r--r--services/surfaceflinger/DisplayDevice.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/services/surfaceflinger/DisplayDevice.cpp b/services/surfaceflinger/DisplayDevice.cpp
index 79b6689..ad63cac 100644
--- a/services/surfaceflinger/DisplayDevice.cpp
+++ b/services/surfaceflinger/DisplayDevice.cpp
@@ -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();