Use NEAREST filtering for layers whenever possible.
Change-Id: Id5bee1bd4a322cf93e8000b08e18f1e1b058648e
diff --git a/libs/hwui/Texture.h b/libs/hwui/Texture.h
index 4922bb3..c6ae326 100644
--- a/libs/hwui/Texture.h
+++ b/libs/hwui/Texture.h
@@ -29,8 +29,22 @@
Texture() {
cleanup = false;
bitmapSize = 0;
+
wrapS = GL_CLAMP_TO_EDGE;
wrapT = GL_CLAMP_TO_EDGE;
+
+ minFilter = GL_NEAREST;
+ magFilter = GL_NEAREST;
+ }
+
+ void setWrap(GLenum wrapS, GLenum wrapT) {
+ this->wrapS = wrapS;
+ this->wrapT = wrapT;
+ }
+
+ void setFilter(GLenum min, GLenum mag) {
+ minFilter = min;
+ magFilter = mag;
}
/**
@@ -67,6 +81,12 @@
*/
GLenum wrapS;
GLenum wrapT;
+
+ /**
+ * Last filters set on this texture. Defaults to GL_NEAREST.
+ */
+ GLenum minFilter;
+ GLenum magFilter;
}; // struct Texture
class AutoTexture {