summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2012-09-18 01:21:55 -0700
committerMathias Agopian <mathias@google.com>2012-09-18 01:21:55 -0700
commitd870703d5566490cfdfb389d9336b2b8d3c6cc7a (patch)
tree515dfd2a7cc98ae7f84eb83fa09ed2819ee11ac6 /services
parent41cb1b5f673b7f73e7f781b9f51ed095085dfdcd (diff)
downloadframeworks_native-d870703d5566490cfdfb389d9336b2b8d3c6cc7a.zip
frameworks_native-d870703d5566490cfdfb389d9336b2b8d3c6cc7a.tar.gz
frameworks_native-d870703d5566490cfdfb389d9336b2b8d3c6cc7a.tar.bz2
fix external displays
we were not calling eglSwapBuffers() on external displays because they can't use HWC which caused us to think they didn't have GLES composition. Change-Id: I6cef4ae40b138412d2e6f2acda33c9d222b03a83
Diffstat (limited to 'services')
-rw-r--r--services/surfaceflinger/DisplayDevice.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/services/surfaceflinger/DisplayDevice.cpp b/services/surfaceflinger/DisplayDevice.cpp
index 72f73f7..2708a90 100644
--- a/services/surfaceflinger/DisplayDevice.cpp
+++ b/services/surfaceflinger/DisplayDevice.cpp
@@ -179,7 +179,7 @@ void DisplayDevice::flip(const Region& dirty) const
b.left, b.top, b.width(), b.height());
}
#endif
-
+
mPageFlipCount++;
}
@@ -188,14 +188,21 @@ void DisplayDevice::swapBuffers(HWComposer& hwc) const {
// no HWC, we call eglSwapBuffers()
eglSwapBuffers(mDisplay, mSurface);
} else {
- if (hwc.hasGlesComposition(mType)) {
- if (hwc.supportsFramebufferTarget() ||
- mType >= DisplayDevice::DISPLAY_VIRTUAL) {
- // as of hwc 1.1 we always call eglSwapBuffers, however,
- // on older versions of HWC, we need to call it only on
- // virtual displays
+ // We have a valid HWC, but not all displays can use it, in particular
+ // the virtual displays are on their own.
+ // TODO: HWC 1.2 will allow virtual displays
+ if (mType >= DisplayDevice::DISPLAY_VIRTUAL) {
+ // always call eglSwapBuffers() for virtual displays
+ eglSwapBuffers(mDisplay, mSurface);
+ } else if (hwc.supportsFramebufferTarget()) {
+ // as of hwc 1.1 we always call eglSwapBuffers if we have some
+ // GLES layers
+ if (hwc.hasGlesComposition(mType)) {
eglSwapBuffers(mDisplay, mSurface);
}
+ } else {
+ // HWC doesn't have the framebuffer target, we don't call
+ // eglSwapBuffers(), since this is handled by HWComposer::commit().
}
}
}