From b325c93b5ef70c3392dbde815b9867b01ab997f8 Mon Sep 17 00:00:00 2001 From: Kevin DuBois Date: Tue, 21 May 2019 08:34:09 -0700 Subject: SF: adapt region sampling to display orientation Pass in the orientation flags of SF to RenderEngine when conducting the sampling composition. This resulted mis-sampled areas, especially when the region was outside of the clip of the 0-degree rotated display. Bug: 132394665 Test: manual verification with 90, 270, 0 rotations Test: new tests in libsurfaceflinger_unittest#RegionSamplingTest.* Change-Id: I2869ef191572dbcc9170df8d3ed17414ab053ca4 --- services/surfaceflinger/RegionSamplingThread.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'services/surfaceflinger/RegionSamplingThread.h') diff --git a/services/surfaceflinger/RegionSamplingThread.h b/services/surfaceflinger/RegionSamplingThread.h index 08134e6acd..3c6fcf3872 100644 --- a/services/surfaceflinger/RegionSamplingThread.h +++ b/services/surfaceflinger/RegionSamplingThread.h @@ -37,7 +37,8 @@ class Scheduler; class SurfaceFlinger; struct SamplingOffsetCallback; -float sampleArea(const uint32_t* data, int32_t stride, const Rect& area); +float sampleArea(const uint32_t* data, int32_t width, int32_t height, int32_t stride, + uint32_t orientation, const Rect& area); class RegionSamplingThread : public IBinder::DeathRecipient { public: @@ -94,7 +95,7 @@ private: }; std::vector sampleBuffer( const sp& buffer, const Point& leftTop, - const std::vector& descriptors); + const std::vector& descriptors, uint32_t orientation); void doSample(); void binderDied(const wp& who) override; -- cgit v1.2.3-59-g8ed1b