Start removing Current state
Now that we only write to current state from the main thread
we can actually just write directly in to drawing state and
avoid copying current to drawing state on each frame. simpleperf
on bouncing ball indicates this was saving around 8% CPU or so
per frame. As a next target we will eliminate the remaining work
in doTransaction and eliminate the doTransaction pass.
Test: Existing tests pass. simpleperf
Bug: 186200583
Change-Id: I59b75747d7371b3ffe870129c8be100c7daa6c4e
diff --git a/services/surfaceflinger/FpsReporter.cpp b/services/surfaceflinger/FpsReporter.cpp
index 23db805..e12835f 100644
--- a/services/surfaceflinger/FpsReporter.cpp
+++ b/services/surfaceflinger/FpsReporter.cpp
@@ -55,7 +55,7 @@
std::vector<std::pair<TrackedListener, sp<Layer>>> listenersAndLayersToReport;
mFlinger.mCurrentState.traverse([&](Layer* layer) {
- auto& currentState = layer->getCurrentState();
+ auto& currentState = layer->getDrawingState();
if (currentState.metadata.has(METADATA_TASK_ID)) {
int32_t taskId = currentState.metadata.getInt32(METADATA_TASK_ID, 0);
if (seenTasks.count(taskId) == 0) {
@@ -100,4 +100,4 @@
mListeners.erase(wp<IBinder>(IInterface::asBinder(listener)));
}
-} // namespace android
\ No newline at end of file
+} // namespace android