summaryrefslogtreecommitdiff
path: root/libs/hwui/TextureCache.cpp
diff options
context:
space:
mode:
author Romain Guy <romainguy@google.com> 2011-07-25 16:36:01 -0700
committer Romain Guy <romainguy@google.com> 2011-07-25 16:36:01 -0700
commite3c26851dc315b730ea0fe5ef35bb1db81f6d675 (patch)
treebc3fbae626f785fa38e40d4f5ab3737777d9a1ef /libs/hwui/TextureCache.cpp
parent29d23ecfd8612ecd4a7b2140acd344934b73a558 (diff)
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
Diffstat (limited to 'libs/hwui/TextureCache.cpp')
-rw-r--r--libs/hwui/TextureCache.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/libs/hwui/TextureCache.cpp b/libs/hwui/TextureCache.cpp
index 3752874053a6..f926fddcd7b3 100644
--- a/libs/hwui/TextureCache.cpp
+++ b/libs/hwui/TextureCache.cpp
@@ -219,11 +219,8 @@ void TextureCache::generateTexture(SkBitmap* bitmap, Texture* texture, bool rege
break;
}
- 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);
}
void TextureCache::uploadLoFiTexture(bool resize, SkBitmap* bitmap,