From cc934763c3fc789f53edb64de16fc36d43c3705d Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Wed, 23 Sep 2009 19:16:27 -0700 Subject: turn dithering off if it's not needed --- libs/surfaceflinger/LayerBase.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'libs/surfaceflinger/LayerBase.cpp') 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, -- cgit v1.2.3-59-g8ed1b