summaryrefslogtreecommitdiffstats
path: root/libhwcomposer
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-11-17 11:46:17 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-11-17 11:46:17 -0800
commit4dceee07d247ed4755a98cc56b0628ebc5ddc132 (patch)
tree3c304f31ea73da0da6e8aca8eb8b83c96122600f /libhwcomposer
parent362bce5d3fdba3197cb0137b6595a2bf1216436b (diff)
parente5315c678872c64f0f3064d54ea2f006540917ed (diff)
downloaddevice_samsung_crespo-4dceee07d247ed4755a98cc56b0628ebc5ddc132.zip
device_samsung_crespo-4dceee07d247ed4755a98cc56b0628ebc5ddc132.tar.gz
device_samsung_crespo-4dceee07d247ed4755a98cc56b0628ebc5ddc132.tar.bz2
am e5315c67: Merge "fix an issue were hwc wouldn\'t clear some areas of the screen." into ics-mr1
* commit 'e5315c678872c64f0f3064d54ea2f006540917ed': fix an issue were hwc wouldn't clear some areas of the screen.
Diffstat (limited to 'libhwcomposer')
-rw-r--r--libhwcomposer/Android.mk2
-rw-r--r--libhwcomposer/SecHWC.cpp25
-rw-r--r--libhwcomposer/SecHWCUtils.h1
3 files changed, 27 insertions, 1 deletions
diff --git a/libhwcomposer/Android.mk b/libhwcomposer/Android.mk
index eb57887..f484dfd 100644
--- a/libhwcomposer/Android.mk
+++ b/libhwcomposer/Android.mk
@@ -21,7 +21,7 @@ LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_PRELINK_MODULE := false
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
-LOCAL_SHARED_LIBRARIES := liblog libcutils libEGL libhardware
+LOCAL_SHARED_LIBRARIES := liblog libcutils libEGL libGLESv1_CM libhardware
LOCAL_CFLAGS += -DLOG_TAG=\"hwcomposer\"
LOCAL_C_INCLUDES := \
diff --git a/libhwcomposer/SecHWC.cpp b/libhwcomposer/SecHWC.cpp
index 6488a48..63173a4 100644
--- a/libhwcomposer/SecHWC.cpp
+++ b/libhwcomposer/SecHWC.cpp
@@ -26,6 +26,7 @@
#include <cutils/log.h>
#include <cutils/atomic.h>
#include <EGL/egl.h>
+#include <GLES/gl.h>
#include "SecHWCUtils.h"
static IMG_gralloc_module_public_t *gpsGrallocModule;
@@ -291,6 +292,30 @@ static int hwc_set(hwc_composer_device_t *dev,
struct sec_rect src_rect;
struct sec_rect dst_rect;
+
+ /*
+ * H/W composer documentation states:
+ * There is an implicit layer containing opaque black
+ * pixels behind all the layers in the list.
+ * It is the responsibility of the hwcomposer module to make
+ * sure black pixels are output (or blended from).
+ *
+ * Since we're using a blitter, we need to erase the frame-buffer when
+ * switching to all-overlay mode.
+ *
+ */
+ if (ctx->num_of_hwc_layer &&
+ ctx->num_of_fb_layer==0 && ctx->num_of_fb_layer_prev) {
+ /* we're clearing the screen using GLES here, this is very
+ * hack-ish, ideal we would use the fimc (if it can do it) */
+ glDisable(GL_SCISSOR_TEST);
+ glClearColor(0, 0, 0, 0);
+ glClear(GL_COLOR_BUFFER_BIT);
+ glEnable(GL_SCISSOR_TEST);
+ }
+
+ ctx->num_of_fb_layer_prev = ctx->num_of_fb_layer;
+
EGLBoolean sucess = eglSwapBuffers((EGLDisplay)dpy, (EGLSurface)sur);
if (!sucess) {
return HWC_EGL_ERROR;
diff --git a/libhwcomposer/SecHWCUtils.h b/libhwcomposer/SecHWCUtils.h
index 7715cb4..880e073 100644
--- a/libhwcomposer/SecHWCUtils.h
+++ b/libhwcomposer/SecHWCUtils.h
@@ -117,6 +117,7 @@ struct hwc_context_t {
s5p_fimc_t fimc;
unsigned int num_of_fb_layer;
unsigned int num_of_hwc_layer;
+ unsigned int num_of_fb_layer_prev;
};
int window_open(struct hwc_win_info_t *win, int id);