diff options
author | 2017-06-29 02:13:18 +0000 | |
---|---|---|
committer | 2017-06-29 02:13:18 +0000 | |
commit | dfce81961dc6f6d17a2a497b95194e7bd7043300 (patch) | |
tree | cb8ca6d89b4750afa91b0be857532a52ed2fe7c1 /libs/hwui/OpenGLReadback.cpp | |
parent | 9d41ce8c4f53b083d62e1a3abdb1d12f6a9a5458 (diff) | |
parent | 38c97237e32e9f94a266146e50f6527677cfbab8 (diff) |
Merge "Selectively disable filtering if estimated safe" into oc-dev
am: 38c97237e3
Change-Id: Ic3be7167429e8cd6a291ac0465e883522afcf9e3
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 b073070b58b6..19d5d9d2250e 100644 --- a/libs/hwui/OpenGLReadback.cpp +++ b/libs/hwui/OpenGLReadback.cpp @@ -199,6 +199,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); @@ -216,12 +217,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(); |