SF: Introduce LayerSnapshot and LayerSnapshotBuilder
Create a builder that walks through the layer hierarchy
to build an ordered list of LayerSnapshots that can be
passed on to CompositionEngine.
This builder does a minimum amount of work to update
an existing set of snapshots based on hierarchy changes
and RequestedLayerState changes.
The builder also introduces a fast path to update
snapshots when there are only buffer updates.
Additionally, pull out LayerSnapshot class from LayerFE
and move it to frontend package.
Bug: 238781169
Test: presubmit
Change-Id: I3fbd6d60968950df2ee97d975c72f9e0aa31b007
diff --git a/services/surfaceflinger/LayerFE.cpp b/services/surfaceflinger/LayerFE.cpp
index 363adc6..c31a2e3 100644
--- a/services/surfaceflinger/LayerFE.cpp
+++ b/services/surfaceflinger/LayerFE.cpp
@@ -148,14 +148,14 @@
case LayerFE::ClientCompositionTargetSettings::BlurSetting::Enabled:
layerSettings.backgroundBlurRadius = mSnapshot->backgroundBlurRadius;
layerSettings.blurRegions = mSnapshot->blurRegions;
- layerSettings.blurRegionTransform = mSnapshot->blurRegionTransform.asMatrix4();
+ layerSettings.blurRegionTransform = mSnapshot->localTransformInverse.asMatrix4();
break;
case LayerFE::ClientCompositionTargetSettings::BlurSetting::BackgroundBlurOnly:
layerSettings.backgroundBlurRadius = mSnapshot->backgroundBlurRadius;
break;
case LayerFE::ClientCompositionTargetSettings::BlurSetting::BlurRegionsOnly:
layerSettings.blurRegions = mSnapshot->blurRegions;
- layerSettings.blurRegionTransform = mSnapshot->blurRegionTransform.asMatrix4();
+ layerSettings.blurRegionTransform = mSnapshot->localTransformInverse.asMatrix4();
break;
case LayerFE::ClientCompositionTargetSettings::BlurSetting::Disabled:
default:
@@ -275,7 +275,7 @@
* of a camera where the buffer remains in native orientation,
* we want the pixels to always be upright.
*/
- const auto parentTransform = mSnapshot->transform;
+ const auto parentTransform = mSnapshot->parentTransform;
tr = tr * inverseOrientation(parentTransform.getOrientation());
// and finally apply it to the original texture matrix