From 82364e3cea0bf88fa8147766433329b3dd5148b8 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Sun, 15 May 2016 11:27:47 -0700 Subject: SurfaceFlinger: Add mode to apply position with resize. For some cases, like scaled windows with shadows, we need to be able to apply the position concurrent with window resize. This is because the scaling of the shadows causes the top left coordinate of the non shadow surface content to change before and after the resize. Bug: 28899837 Change-Id: I522eacfbbcd79707dc1e5ab71901a263b3004ba9 --- libs/gui/SurfaceComposerClient.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'libs/gui/SurfaceComposerClient.cpp') diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp index e33cc37b24..92ae41eec8 100644 --- a/libs/gui/SurfaceComposerClient.cpp +++ b/libs/gui/SurfaceComposerClient.cpp @@ -165,6 +165,8 @@ public: uint64_t frameNumber); status_t setOverrideScalingMode(const sp& client, const sp& id, int32_t overrideScalingMode); + status_t setPositionAppliesWithResize(const sp& client, + const sp& id); void setDisplaySurface(const sp& token, const sp& bufferProducer); @@ -443,6 +445,18 @@ status_t Composer::setOverrideScalingMode( return NO_ERROR; } +status_t Composer::setPositionAppliesWithResize( + const sp& client, + const sp& id) { + Mutex::Autolock lock(mLock); + layer_state_t* s = getLayerStateLocked(client, id); + if (!s) { + return BAD_INDEX; + } + s->what |= layer_state_t::ePositionAppliesWithResize; + return NO_ERROR; +} + // --------------------------------------------------------------------------- DisplayState& Composer::getDisplayStateLocked(const sp& token) { @@ -685,6 +699,11 @@ status_t SurfaceComposerClient::setOverrideScalingMode( this, id, overrideScalingMode); } +status_t SurfaceComposerClient::setPositionAppliesWithResize( + const sp& id) { + return getComposer().setPositionAppliesWithResize(this, id); +} + // ---------------------------------------------------------------------------- void SurfaceComposerClient::setDisplaySurface(const sp& token, -- cgit v1.2.3-59-g8ed1b