diff options
author | Romain Guy <romainguy@google.com> | 2011-08-22 17:33:33 -0700 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2011-08-22 17:33:33 -0700 |
commit | 6816972eb69ee8b294553dac92b3c1ad5b1ca1f7 (patch) | |
tree | 6174bc7bba14ffc748bff13bbebcd62f6f6a1f9a /libs | |
parent | 91bd59dbda75d176a79d5c42cccce0a9b0391bde (diff) | |
download | frameworks_base-6816972eb69ee8b294553dac92b3c1ad5b1ca1f7.zip frameworks_base-6816972eb69ee8b294553dac92b3c1ad5b1ca1f7.tar.gz frameworks_base-6816972eb69ee8b294553dac92b3c1ad5b1ca1f7.tar.bz2 |
Don't use bilinear filtering on unscaled bitmaps
Bug #5198590
Change-Id: I4333d850501ac849eeeeb247e4178dd469b9de3d
Diffstat (limited to 'libs')
-rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index a0f806a..e89d6ec 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -1476,10 +1476,10 @@ void OpenGLRenderer::drawBitmap(SkBitmap* bitmap, const float width = texture->width; const float height = texture->height; - const float u1 = (srcLeft + 0.5f) / width; - const float v1 = (srcTop + 0.5f) / height; - const float u2 = (srcRight - 0.5f) / width; - const float v2 = (srcBottom - 0.5f) / height; + const float u1 = fmax(0.0f, srcLeft / width); + const float v1 = fmax(0.0f, srcTop / height); + const float u2 = fmin(1.0f, srcRight / width); + const float v2 = fmin(1.0f, srcBottom / height); mCaches.unbindMeshBuffer(); resetDrawTextureTexCoords(u1, v1, u2, v2); |