diff options
author | 2021-02-10 05:42:36 +0000 | |
---|---|---|
committer | 2021-02-10 05:42:36 +0000 | |
commit | 1c69780efbb60608767a28a0887f2cb548fa2002 (patch) | |
tree | e3ac9f7ffebbd3d4ba24921f73311a09ddbf2ec8 /libs/gui/SurfaceComposerClient.cpp | |
parent | 70091d6660ae38137971ebed061c3aedad775937 (diff) | |
parent | cdb4ed7743f5abfa4e9a785b14a50ca25c906f3f (diff) |
Merge "Add plumbing for sending stretch effect to SF" into sc-dev
Diffstat (limited to 'libs/gui/SurfaceComposerClient.cpp')
-rw-r--r-- | libs/gui/SurfaceComposerClient.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp index 4493a21fc3..27fb2a8cd7 100644 --- a/libs/gui/SurfaceComposerClient.cpp +++ b/libs/gui/SurfaceComposerClient.cpp @@ -1569,6 +1569,23 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setApply return *this; } +SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setStretchEffect( + const sp<SurfaceControl>& sc, float left, float top, float right, float bottom, float vecX, + float vecY, float maxAmount) { + layer_state_t* s = getLayerState(sc); + if (!s) { + mStatus = BAD_INDEX; + return *this; + } + + s->what |= layer_state_t::eStretchChanged; + s->stretchEffect = StretchEffect{.area = {left, top, right, bottom}, + .vectorX = vecX, + .vectorY = vecY, + .maxAmount = maxAmount}; + return *this; +} + // --------------------------------------------------------------------------- DisplayState& SurfaceComposerClient::Transaction::getDisplayState(const sp<IBinder>& token) { |