diff options
| author | 2017-06-28 22:45:50 +0000 | |
|---|---|---|
| committer | 2017-06-28 22:45:50 +0000 | |
| commit | 14fe0b69c7b0a54742a9901fd2ec9eb4e31569e1 (patch) | |
| tree | a4b52337a6e1dddcf164e2c001342f9147c153d0 /libs/hwui/OpenGLReadback.cpp | |
| parent | 3bd6012ceed04933967e73b3e3de646639b32077 (diff) | |
| parent | 38c97237e32e9f94a266146e50f6527677cfbab8 (diff) | |
Merge "Selectively disable filtering if estimated safe" into oc-dev
am: 38c97237e3
Change-Id: I3ef75aea36939b1dffa44500097709ef51787a1d
Diffstat (limited to 'libs/hwui/OpenGLReadback.cpp')
| -rw-r--r-- | libs/hwui/OpenGLReadback.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libs/hwui/OpenGLReadback.cpp b/libs/hwui/OpenGLReadback.cpp index c460c0d2dfd4..51927d5a2c61 100644 --- a/libs/hwui/OpenGLReadback.cpp +++ b/libs/hwui/OpenGLReadback.cpp @@ -191,6 +191,7 @@ inline CopyResult copyTextureInto(Caches& caches, RenderState& renderState, GL_TEXTURE_2D, texture, 0); { + bool requiresFilter; // Draw & readback renderState.setViewport(destWidth, destHeight); renderState.scissor().setEnabled(false); @@ -208,12 +209,17 @@ inline CopyResult copyTextureInto(Caches& caches, RenderState& renderState, croppedTexTransform.scale(srcRect.getWidth() / sourceTexture.width(), srcRect.getHeight() / sourceTexture.height(), 1); croppedTexTransform.multiply(sFlipV); + requiresFilter = srcRect.getWidth() != (float) destWidth + || srcRect.getHeight() != (float) destHeight; + } else { + requiresFilter = sourceTexture.width() != (uint32_t) destWidth + || sourceTexture.height() != (uint32_t) destHeight; } Glop glop; GlopBuilder(renderState, caches, &glop) .setRoundRectClipState(nullptr) .setMeshTexturedUnitQuad(nullptr) - .setFillExternalTexture(sourceTexture, croppedTexTransform) + .setFillExternalTexture(sourceTexture, croppedTexTransform, requiresFilter) .setTransform(Matrix4::identity(), TransformFlags::None) .setModelViewMapUnitToRect(Rect(destWidth, destHeight)) .build(); |