From e3c26851dc315b730ea0fe5ef35bb1db81f6d675 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Mon, 25 Jul 2011 16:36:01 -0700 Subject: Improve rendering performance on some GPUs This change sets textures filtering to GL_NEAREST by default. GL_LINEAR filtering is only used when textures are transformed with a scale or a rotation. This helps save a couple of fps on some GPUs. Change-Id: I1efaa452c2c79905f00238e54d886a37203a2ac1 --- libs/hwui/GradientCache.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'libs/hwui/GradientCache.cpp') diff --git a/libs/hwui/GradientCache.cpp b/libs/hwui/GradientCache.cpp index 4a40a63485ac..996acd5bceac 100644 --- a/libs/hwui/GradientCache.cpp +++ b/libs/hwui/GradientCache.cpp @@ -181,11 +181,8 @@ void GradientCache::generateTexture(SkBitmap* bitmap, Texture* texture) { glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, bitmap->rowBytesAsPixels(), texture->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, bitmap->getPixels()); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + texture->setFilter(GL_LINEAR, GL_LINEAR); + texture->setWrap(GL_CLAMP_TO_EDGE, GL_CLAMP_TO_EDGE); } }; // namespace uirenderer -- cgit v1.2.3-59-g8ed1b