Add trace slices to capture tasks important for latency monitoring

Add a trace slices for:
    - for all post composition work on main thread
    - transaction callbacks
    - screenshot work on main thread

Flag: EXEMPT adding trace slices + trivial refactor

Bug: 333623207
Test: perfetto
Change-Id: I6ca0a80941327edc0c78decf82176459d15d4595
diff --git a/services/surfaceflinger/RegionSamplingThread.cpp b/services/surfaceflinger/RegionSamplingThread.cpp
index 5add290..86867d3 100644
--- a/services/surfaceflinger/RegionSamplingThread.cpp
+++ b/services/surfaceflinger/RegionSamplingThread.cpp
@@ -358,9 +358,8 @@
     if (FlagManager::getInstance().single_hop_screenshot() &&
         FlagManager::getInstance().ce_fence_promise()) {
         std::vector<sp<LayerFE>> layerFEs;
-        auto displayState =
-                mFlinger.getDisplayAndLayerSnapshotsFromMainThread(renderAreaBuilder,
-                                                                   getLayerSnapshotsFn, layerFEs);
+        auto displayState = mFlinger.getSnapshotsFromMainThread(renderAreaBuilder,
+                                                                getLayerSnapshotsFn, layerFEs);
         fenceResult =
                 mFlinger.captureScreenshot(renderAreaBuilder, buffer, kRegionSampling, kGrayscale,
                                            kIsProtected, nullptr, displayState, layerFEs)