diff options
| author | 2016-06-16 15:18:02 -0700 | |
|---|---|---|
| committer | 2016-06-21 16:28:41 -0700 | |
| commit | 99e27f0bc236e38d88ff4f9912ede514a729b8eb (patch) | |
| tree | 17bcbc4da8aeee91ac1ba9371a5c061974c24f5c /services/surfaceflinger/Layer.cpp | |
| parent | f9d7e1a0aa05bb47527f054b85a36f16e7955088 (diff) | |
Change setPositionAppliesWithResize to apply to all geometry.
To support seamless rotation, change setPositionAppliesWithResize
to also include the crop. As the transformation matrix is already
frozen during resize, this enables the window manager to set the
total geometry state before and after resize in a race free fashion.
Bug: 28823590
Change-Id: I3f8f0e162b7ef4e9403c1220c7e4191b3ef30526
Diffstat (limited to 'services/surfaceflinger/Layer.cpp')
| -rw-r--r-- | services/surfaceflinger/Layer.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index d732c0732e..3f70144904 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -1574,11 +1574,15 @@ bool Layer::setFlags(uint8_t flags, uint8_t mask) { setTransactionFlags(eTransactionNeeded); return true; } -bool Layer::setCrop(const Rect& crop) { + +bool Layer::setCrop(const Rect& crop, bool immediate) { if (mCurrentState.crop == crop) return false; mCurrentState.sequence++; - mCurrentState.crop = crop; + mCurrentState.requestedCrop = crop; + if (immediate) { + mCurrentState.crop = crop; + } mCurrentState.modified = true; setTransactionFlags(eTransactionNeeded); return true; @@ -1870,6 +1874,12 @@ Region Layer::latchBuffer(bool& recomputeVisibleRegions) recomputeVisibleRegions = true; } + if (front.crop != front.requestedCrop) { + front.crop = front.requestedCrop; + current.crop = front.requestedCrop; + recomputeVisibleRegions = true; + } + return false; } }; |