summaryrefslogtreecommitdiff
path: root/libs/surfaceflinger/LayerBase.cpp
diff options
context:
space:
mode:
author Mathias Agopian <mathias@google.com> 2009-09-23 19:16:27 -0700
committer Mathias Agopian <mathias@google.com> 2009-09-23 19:16:27 -0700
commitcc934763c3fc789f53edb64de16fc36d43c3705d (patch)
tree5e9f508326cbaa27bd1fd255324dfcd4026badbf /libs/surfaceflinger/LayerBase.cpp
parent44cac134655d5c3b2eeab2e42792c70a7aa8b92f (diff)
turn dithering off if it's not needed
Diffstat (limited to 'libs/surfaceflinger/LayerBase.cpp')
-rw-r--r--libs/surfaceflinger/LayerBase.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/libs/surfaceflinger/LayerBase.cpp b/libs/surfaceflinger/LayerBase.cpp
index 8b9a84230098..5a93b2d46161 100644
--- a/libs/surfaceflinger/LayerBase.cpp
+++ b/libs/surfaceflinger/LayerBase.cpp
@@ -393,14 +393,6 @@ void LayerBase::drawWithOpenGL(const Region& clip, const Texture& texture) const
glEnable(GL_TEXTURE_2D);
- // Dithering...
- bool fast = !(mFlags & DisplayHardware::SLOW_CONFIG);
- if (fast || s.flags & ISurfaceComposer::eLayerDither) {
- glEnable(GL_DITHER);
- } else {
- glDisable(GL_DITHER);
- }
-
if (UNLIKELY(s.alpha < 0xFF)) {
// We have an alpha-modulation. We need to modulate all
// texture components by alpha because we're always using
@@ -516,6 +508,12 @@ void LayerBase::validateTexture(GLint textureName) const
glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
}
+
+ if (needsDithering()) {
+ glEnable(GL_DITHER);
+ } else {
+ glDisable(GL_DITHER);
+ }
}
void LayerBase::loadTexture(Texture* texture, GLint textureName,