summaryrefslogtreecommitdiffstats
path: root/libhwcomposer/SecHWC.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-11-15 22:37:36 -0800
committerMathias Agopian <mathias@google.com>2011-11-16 16:13:03 -0800
commit7adf0e24868b88a1541bb88444a58d276d394e68 (patch)
tree17c6dd92f2f24538f7121a719a78df539e5f7112 /libhwcomposer/SecHWC.cpp
parent691a7f459aab9ada52edaa1adbc46a9ec708cbbe (diff)
downloaddevice_samsung_crespo-7adf0e24868b88a1541bb88444a58d276d394e68.zip
device_samsung_crespo-7adf0e24868b88a1541bb88444a58d276d394e68.tar.gz
device_samsung_crespo-7adf0e24868b88a1541bb88444a58d276d394e68.tar.bz2
fix an issue were hwc wouldn't clear some areas of the screen.
Bug: 5429709 Change-Id: I2be2be6ba2c7b89a19d79d0cbe6a4b894bb79261
Diffstat (limited to 'libhwcomposer/SecHWC.cpp')
-rw-r--r--libhwcomposer/SecHWC.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/libhwcomposer/SecHWC.cpp b/libhwcomposer/SecHWC.cpp
index 140a23e..6fe39a0 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;