[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/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 42d5db7..74d00dd 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -1382,7 +1382,7 @@
                     snapshotFilterFn);
     std::function<std::vector<std::pair<Layer*, sp<LayerFE>>>()> getLayerSnapshotsForScreenshots(
             uint32_t rootLayerId, uint32_t uid, std::unordered_set<uint32_t> excludeLayerIds,
-            bool childrenOnly, const FloatRect& parentCrop);
+            bool childrenOnly, const std::optional<FloatRect>& optionalParentCrop);
 
     const sp<WindowInfosListenerInvoker> mWindowInfosListenerInvoker;