summaryrefslogtreecommitdiffstats
path: root/libhwcomposer
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-11-16 20:59:19 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-11-16 20:59:19 -0800
commit190f057048db376d0c6fadd979ba307afde11b36 (patch)
tree893c6eaf82bdc9213a19769695fa471bfbb59205 /libhwcomposer
parente5315c678872c64f0f3064d54ea2f006540917ed (diff)
parent85a2e2f0284ce5b5cc79b2db775d32cf03078029 (diff)
downloaddevice_samsung_crespo-190f057048db376d0c6fadd979ba307afde11b36.zip
device_samsung_crespo-190f057048db376d0c6fadd979ba307afde11b36.tar.gz
device_samsung_crespo-190f057048db376d0c6fadd979ba307afde11b36.tar.bz2
Merge "don't call eglSwapBufferss() when its not needed." into ics-mr1
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 6fe39a0..0f81277 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) {