Edge extension effect: shader reimplementation
X-axis activity transitions require the translation of the surfaces
involved. As this movement would create unwanted see-through, we would
have added side windows anchored to the moving activities, and textured
them by clamping their parents.
We are replacing the additional windows with the extension of the
surfaces, and filling the area without buffer with a shader.
See go/edge-extension-sksl for more info.
Bug: 322036393
Test: LayerSnapshotTest
Flag: EXEMPT (calls will be protected by wm shell with com.android.window.flags.edge_extension_shader)
Change-Id: I3682efd16a1b311d67a522bb85960f100948b2ea
diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp
index 3745805..307ae39 100644
--- a/libs/gui/LayerState.cpp
+++ b/libs/gui/LayerState.cpp
@@ -177,6 +177,7 @@
}
SAFE_PARCEL(output.write, stretchEffect);
+ SAFE_PARCEL(output.writeParcelable, edgeExtensionParameters);
SAFE_PARCEL(output.write, bufferCrop);
SAFE_PARCEL(output.write, destinationFrame);
SAFE_PARCEL(output.writeInt32, static_cast<uint32_t>(trustedOverlay));
@@ -306,6 +307,7 @@
}
SAFE_PARCEL(input.read, stretchEffect);
+ SAFE_PARCEL(input.readParcelable, &edgeExtensionParameters);
SAFE_PARCEL(input.read, bufferCrop);
SAFE_PARCEL(input.read, destinationFrame);
uint32_t trustedOverlayInt;
@@ -682,6 +684,10 @@
what |= eStretchChanged;
stretchEffect = other.stretchEffect;
}
+ if (other.what & eEdgeExtensionChanged) {
+ what |= eEdgeExtensionChanged;
+ edgeExtensionParameters = other.edgeExtensionParameters;
+ }
if (other.what & eBufferCropChanged) {
what |= eBufferCropChanged;
bufferCrop = other.bufferCrop;
@@ -783,6 +789,7 @@
CHECK_DIFF(diff, eAutoRefreshChanged, other, autoRefresh);
CHECK_DIFF(diff, eTrustedOverlayChanged, other, trustedOverlay);
CHECK_DIFF(diff, eStretchChanged, other, stretchEffect);
+ CHECK_DIFF(diff, eEdgeExtensionChanged, other, edgeExtensionParameters);
CHECK_DIFF(diff, eBufferCropChanged, other, bufferCrop);
CHECK_DIFF(diff, eDestinationFrameChanged, other, destinationFrame);
if (other.what & eProducerDisconnect) diff |= eProducerDisconnect;