summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger/LayerBase.cpp
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@no-log.org>2011-01-09 23:25:03 +0100
committerDenis 'GNUtoo' Carikli <GNUtoo@no-log.org>2011-01-09 23:32:18 +0100
commit5dbc8f9e4907a455cf187574007d34daf414479a (patch)
treec77faa7b2c536067fd63e9093f845ebd06b60e19 /libs/surfaceflinger/LayerBase.cpp
parentc6bf87d75456e2ade54acf79beff0d2045466a24 (diff)
downloadframeworks_base-5dbc8f9e4907a455cf187574007d34daf414479a.zip
frameworks_base-5dbc8f9e4907a455cf187574007d34daf414479a.tar.gz
frameworks_base-5dbc8f9e4907a455cf187574007d34daf414479a.tar.bz2
surfaceflinger and libagl: fix bug #11829
The bug #11829 that can be found here: http://code.google.com/p/android/issues/detail?id=11829 causes various graphic artefacts. According to naseer.ahmed it needed modifications in SurfaceFlinger and libagl The modifications comes from: https://www.codeaurora.org/gitweb/quic/la/?p=platform/frameworks/base.git;a=shortlog;h=refs/heads/froyo_almond at commit 33e6506d96d7602284e18ea8c66dbfd04dc72aa3 Change-Id: I703bace69cb7a41ac8ed69ca1e28b98aa618e0f3 Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
Diffstat (limited to 'libs/surfaceflinger/LayerBase.cpp')
-rw-r--r--libs/surfaceflinger/LayerBase.cpp60
1 files changed, 3 insertions, 57 deletions
diff --git a/libs/surfaceflinger/LayerBase.cpp b/libs/surfaceflinger/LayerBase.cpp
index 046c7c3..a8b735e 100644
--- a/libs/surfaceflinger/LayerBase.cpp
+++ b/libs/surfaceflinger/LayerBase.cpp
@@ -33,15 +33,6 @@
#include "SurfaceFlinger.h"
#include "DisplayHardware/DisplayHardware.h"
-#define RENDER_EFFECT_NIGHT 1
-#define RENDER_EFFECT_TERMINAL 2
-#define RENDER_EFFECT_BLUE 3
-#define RENDER_EFFECT_AMBER 4
-#define RENDER_EFFECT_SALMON 5
-#define RENDER_EFFECT_FUSCIA 6
-#define RENDER_EFFECT_N1_CALIBRATED_N 7
-#define RENDER_EFFECT_N1_CALIBRATED_R 8
-#define RENDER_EFFECT_N1_CALIBRATED_C 9
namespace android {
@@ -410,14 +401,7 @@ void LayerBase::drawWithOpenGL(const Region& clip, const Texture& texture) const
glEnable(GL_TEXTURE_2D);
- int renderEffect = mFlinger->getRenderEffect();
- int renderColorR = mFlinger->getRenderColorR();
- int renderColorG = mFlinger->getRenderColorG();
- int renderColorB = mFlinger->getRenderColorB();
-
- bool noEffect = renderEffect == 0;
-
- if (UNLIKELY(s.alpha < 0xFF) && noEffect) {
+ if (UNLIKELY(s.alpha < 0xFF)) {
// We have an alpha-modulation. We need to modulate all
// texture components by alpha because we're always using
// premultiplied alpha.
@@ -439,7 +423,7 @@ void LayerBase::drawWithOpenGL(const Region& clip, const Texture& texture) const
glEnable(GL_BLEND);
glBlendFunc(src, GL_ONE_MINUS_SRC_ALPHA);
glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, env);
- } else if (noEffect) {
+ } else {
glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glColor4x(0x10000, 0x10000, 0x10000, 0x10000);
if (needsBlending()) {
@@ -449,44 +433,6 @@ void LayerBase::drawWithOpenGL(const Region& clip, const Texture& texture) const
} else {
glDisable(GL_BLEND);
}
- } else {
- // Apply a render effect, which is simple color masks for now.
- GLenum env, src;
- env = GL_MODULATE;
- src = mPremultipliedAlpha ? GL_ONE : GL_SRC_ALPHA;
- const GGLfixed alpha = (s.alpha << 16)/255;
- switch (renderEffect) {
- case RENDER_EFFECT_NIGHT:
- glColor4x(alpha, 0, 0, alpha);
- break;
- case RENDER_EFFECT_TERMINAL:
- glColor4x(0, alpha, 0, alpha);
- break;
- case RENDER_EFFECT_BLUE:
- glColor4x(0, 0, alpha, alpha);
- break;
- case RENDER_EFFECT_AMBER:
- glColor4x(alpha, alpha*0.75, 0, alpha);
- break;
- case RENDER_EFFECT_SALMON:
- glColor4x(alpha, alpha*0.5, alpha*0.5, alpha);
- break;
- case RENDER_EFFECT_FUSCIA:
- glColor4x(alpha, 0, alpha*0.5, alpha);
- break;
- case RENDER_EFFECT_N1_CALIBRATED_N:
- glColor4x(alpha*renderColorR/1000, alpha*renderColorG/1000, alpha*renderColorB/1000, alpha);
- break;
- case RENDER_EFFECT_N1_CALIBRATED_R:
- glColor4x(alpha*(renderColorR-50)/1000, alpha*renderColorG/1000, alpha*(renderColorB-30)/1000, alpha);
- break;
- case RENDER_EFFECT_N1_CALIBRATED_C:
- glColor4x(alpha*renderColorR/1000, alpha*renderColorG/1000, alpha*(renderColorB+30)/1000, alpha);
- break;
- }
- glEnable(GL_BLEND);
- glBlendFunc(src, GL_ONE_MINUS_SRC_ALPHA);
- glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, env);
}
Region::const_iterator it = clip.begin();
@@ -880,4 +826,4 @@ sp<OverlayRef> LayerBaseClient::Surface::createOverlay(
// ---------------------------------------------------------------------------
-}; // namespace android \ No newline at end of file
+}; // namespace android