Cache buffers if only source crop is moved and no other changes.
- also add trunk flag to guard it
Bug: 305718400
Test: libcompositionengine_test
Change-Id: I071d3c3610ba8516529621a0b9f56298f0439e0c
diff --git a/services/surfaceflinger/common/FlagManager.cpp b/services/surfaceflinger/common/FlagManager.cpp
index 35dd428..a582232 100644
--- a/services/surfaceflinger/common/FlagManager.cpp
+++ b/services/surfaceflinger/common/FlagManager.cpp
@@ -122,6 +122,7 @@
DUMP_READ_ONLY_FLAG(multithreaded_present);
DUMP_READ_ONLY_FLAG(add_sf_skipped_frames_to_trace);
DUMP_READ_ONLY_FLAG(use_known_refresh_rate_for_fps_consistency);
+ DUMP_READ_ONLY_FLAG(cache_if_source_crop_layer_only_moved);
#undef DUMP_READ_ONLY_FLAG
#undef DUMP_SERVER_FLAG
@@ -192,6 +193,8 @@
FLAG_MANAGER_READ_ONLY_FLAG(multithreaded_present, "debug.sf.multithreaded_present")
FLAG_MANAGER_READ_ONLY_FLAG(add_sf_skipped_frames_to_trace, "")
FLAG_MANAGER_READ_ONLY_FLAG(use_known_refresh_rate_for_fps_consistency, "")
+FLAG_MANAGER_READ_ONLY_FLAG(cache_if_source_crop_layer_only_moved,
+ "debug.sf.cache_source_crop_only_moved")
/// Trunk stable server flags ///
FLAG_MANAGER_SERVER_FLAG(late_boot_misc2, "")
diff --git a/services/surfaceflinger/common/include/common/FlagManager.h b/services/surfaceflinger/common/include/common/FlagManager.h
index 6d5846a..15ca345 100644
--- a/services/surfaceflinger/common/include/common/FlagManager.h
+++ b/services/surfaceflinger/common/include/common/FlagManager.h
@@ -61,6 +61,7 @@
bool multithreaded_present() const;
bool add_sf_skipped_frames_to_trace() const;
bool use_known_refresh_rate_for_fps_consistency() const;
+ bool cache_if_source_crop_layer_only_moved() const;
protected:
// overridden for unit tests