Skip to content

Commit 0c8ad64

Browse files
Simon WilsonAndroid (Google) Code Review
authored andcommitted
Merge "fix [3127755] Launcher is missing anti-aliasing" into gingerbread
2 parents 12b82c8 + f9954c7 commit 0c8ad64

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

libs/rs/rsContext.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,7 @@ void Context::setSurface(uint32_t w, uint32_t h, ANativeWindow *sur)
572572
glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_VECTORS, &mGL.mMaxFragmentUniformVectors);
573573

574574
mGL.OES_texture_npot = NULL != strstr((const char *)mGL.mExtensions, "GL_OES_texture_npot");
575+
mGL.GL_IMG_texture_npot = NULL != strstr((const char *)mGL.mExtensions, "GL_IMG_texture_npot");
575576
}
576577

577578
}

libs/rs/rsContext.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ class Context
166166
mutable const ObjectBase * mObjHead;
167167

168168
bool ext_OES_texture_npot() const {return mGL.OES_texture_npot;}
169+
bool ext_GL_IMG_texture_npot() const {return mGL.GL_IMG_texture_npot;}
169170

170171
protected:
171172
Device *mDev;
@@ -202,6 +203,7 @@ class Context
202203
int32_t mMaxVertexTextureUnits;
203204

204205
bool OES_texture_npot;
206+
bool GL_IMG_texture_npot;
205207
} mGL;
206208

207209
uint32_t mWidth;

libs/rs/rsSampler.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ void Sampler::setupGL(const Context *rsc, bool npot)
7070
}
7171

7272
if ((mMinFilter == RS_SAMPLER_LINEAR_MIP_LINEAR) && forceNonMip) {
73-
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
73+
if (rsc->ext_GL_IMG_texture_npot()) {
74+
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
75+
} else {
76+
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
77+
}
7478
} else {
7579
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, trans[mMinFilter]);
7680
}

0 commit comments

Comments
 (0)