[sf] fix screenshots when new fe is enabled
- Use uid in layer state when filtering by uid for screenshots
because there is a mismatch between uid provided by layer
and input info (b/271132344)
- Pass transform and buffersize into LayerRenderArea so we
don't need to check legacy drawing state.
Bug: 238781169
Test: atest SurfaceFlinger_test
Change-Id: I2bd5ceeba8303cad2996f521ea03f727269a7a96
diff --git a/services/surfaceflinger/FrontEnd/LayerSnapshot.cpp b/services/surfaceflinger/FrontEnd/LayerSnapshot.cpp
index 5e7c259..2d6d8ad 100644
--- a/services/surfaceflinger/FrontEnd/LayerSnapshot.cpp
+++ b/services/surfaceflinger/FrontEnd/LayerSnapshot.cpp
@@ -44,6 +44,8 @@
inputInfo.id = static_cast<int32_t>(uniqueSequence);
inputInfo.ownerUid = static_cast<int32_t>(state.ownerUid);
inputInfo.ownerPid = state.ownerPid;
+ uid = state.ownerUid;
+ pid = state.ownerPid;
changes = RequestedLayerState::Changes::Created;
mirrorRootPath = path.variant == LayerHierarchy::Variant::Mirror
? path
@@ -179,7 +181,12 @@
std::stringstream debug;
debug << "Snapshot{" << path.toString() << name << " isVisible=" << isVisible << " {"
<< getIsVisibleReason() << "} changes=" << changes.string()
- << " layerStack=" << outputFilter.layerStack.id << "}";
+ << " layerStack=" << outputFilter.layerStack.id << " geomLayerBounds={"
+ << geomLayerBounds.left << "," << geomLayerBounds.top << "," << geomLayerBounds.bottom
+ << "," << geomLayerBounds.right << "}"
+ << " geomLayerTransform={tx=" << geomLayerTransform.tx()
+ << ",ty=" << geomLayerTransform.ty() << "}"
+ << "}";
return debug.str();
}