From 69162d0bbc444c66ad7cdf4ad5df26798fb2cc7a Mon Sep 17 00:00:00 2001 From: Kevin DuBois Date: Tue, 4 Jun 2019 20:22:43 -0700 Subject: SF: left/right flip luma calculation 90 deg rot During 90 degree screenshots, the gles produced images were actually rotated 180, whereas current code was written to accommodate flipped vertically only. Flip coordinates during luma calc horizontally to match the correct region the luma-listening client is expecting. Test: manual testing of content with different left/right luma Bug: 132394665 Change-Id: Ia3954cf97f57f5f563978f24391e66da23282d44 --- services/surfaceflinger/RegionSamplingThread.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'services/surfaceflinger/RegionSamplingThread.cpp') diff --git a/services/surfaceflinger/RegionSamplingThread.cpp b/services/surfaceflinger/RegionSamplingThread.cpp index 7fa33f597c..66906e950c 100644 --- a/services/surfaceflinger/RegionSamplingThread.cpp +++ b/services/surfaceflinger/RegionSamplingThread.cpp @@ -280,6 +280,10 @@ float sampleArea(const uint32_t* data, int32_t width, int32_t height, int32_t st area.top = height - area.top; area.bottom = height - area.bottom; std::swap(area.top, area.bottom); + + area.left = width - area.left; + area.right = width - area.right; + std::swap(area.left, area.right); } std::array brightnessBuckets = {}; -- cgit v1.2.3-59-g8ed1b