Skip to content

Commit 9b9783a

Browse files
Romain GuyAndroid (Google) Code Review
authored andcommitted
Merge "Enable linear filter when scaling bitmaps Bug #5205673"
2 parents a407aef + 631582f commit 9b9783a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libs/hwui/OpenGLRenderer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1493,7 +1493,8 @@ void OpenGLRenderer::drawBitmap(SkBitmap* bitmap,
14931493
const float y = (int) floorf(dstTop + mSnapshot->transform->getTranslateY() + 0.5f);
14941494

14951495
GLenum filter = GL_NEAREST;
1496-
if (u1 > 0.0f || u2 < 1.0f || v1 > 0.0f || v2 < 1.0f) {
1496+
// Enable linear filtering if the source rectangle is scaled
1497+
if (srcRight - srcLeft != dstRight - dstLeft || srcBottom - srcTop != dstBottom - dstTop) {
14971498
filter = GL_LINEAR;
14981499
}
14991500
texture->setFilter(filter, filter, true);

0 commit comments

Comments
 (0)