summaryrefslogtreecommitdiffstats
path: root/libhwcomposer
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-11-17 11:46:18 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-11-17 11:46:18 -0800
commit2aee11b2faa521ff44dd57590c77f976e5956d8a (patch)
tree9c9fa28ecfc3cd3d64f0026df989a2d03052469d /libhwcomposer
parent4dceee07d247ed4755a98cc56b0628ebc5ddc132 (diff)
parent190f057048db376d0c6fadd979ba307afde11b36 (diff)
downloaddevice_samsung_crespo-2aee11b2faa521ff44dd57590c77f976e5956d8a.zip
device_samsung_crespo-2aee11b2faa521ff44dd57590c77f976e5956d8a.tar.gz
device_samsung_crespo-2aee11b2faa521ff44dd57590c77f976e5956d8a.tar.bz2
am 190f0570: Merge "don\'t call eglSwapBufferss() when its not needed." into ics-mr1
* commit '190f057048db376d0c6fadd979ba307afde11b36': don't call eglSwapBufferss() when its not needed.
Diffstat (limited to 'libhwcomposer')
-rw-r--r--libhwcomposer/SecHWC.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/libhwcomposer/SecHWC.cpp b/libhwcomposer/SecHWC.cpp
index 63173a4..a90a67e 100644
--- a/libhwcomposer/SecHWC.cpp
+++ b/libhwcomposer/SecHWC.cpp
@@ -293,6 +293,8 @@ static int hwc_set(hwc_composer_device_t *dev,
struct sec_rect dst_rect;
+ bool need_swap_buffers = ctx->num_of_fb_layer > 0;
+
/*
* H/W composer documentation states:
* There is an implicit layer containing opaque black
@@ -312,13 +314,16 @@ static int hwc_set(hwc_composer_device_t *dev,
glClearColor(0, 0, 0, 0);
glClear(GL_COLOR_BUFFER_BIT);
glEnable(GL_SCISSOR_TEST);
+ need_swap_buffers = true;
}
ctx->num_of_fb_layer_prev = ctx->num_of_fb_layer;
- EGLBoolean sucess = eglSwapBuffers((EGLDisplay)dpy, (EGLSurface)sur);
- if (!sucess) {
- return HWC_EGL_ERROR;
+ if (need_swap_buffers || !list) {
+ EGLBoolean sucess = eglSwapBuffers((EGLDisplay)dpy, (EGLSurface)sur);
+ if (!sucess) {
+ return HWC_EGL_ERROR;
+ }
}
if (!list) {