surfaceflinger: improve RenderArea needsFiltering
Compare source crop (instead of the logical render area) against
physical render area to decide whether filtering is required. This
allows us to get rid of Layer::setFiltering.
As a result, captureLayers for Recents no longer enables filtering.
Screenshots under landscape mode no longer enables filtering.
Bug: 113041375
Test: take screenshot, rotate screen, screencap
Change-Id: Ida95fdfec3a0dde7a19adf35c91bf3d570bab6bb
diff --git a/services/surfaceflinger/BufferLayer.cpp b/services/surfaceflinger/BufferLayer.cpp
index 1bb7a85..2d6f79c 100644
--- a/services/surfaceflinger/BufferLayer.cpp
+++ b/services/surfaceflinger/BufferLayer.cpp
@@ -180,7 +180,7 @@
if (!blackOutLayer) {
// TODO: we could be more subtle with isFixedSize()
- const bool useFiltering = getFiltering() || needsFiltering(renderArea) || isFixedSize();
+ const bool useFiltering = needsFiltering(renderArea) || isFixedSize();
// Query the texture matrix given our current filtering mode.
float textureMatrix[16];