SF multithreaded_present: clean up and add more tests
Add tests for CompositionEngine to verify that the displays which are
expected to offload HWC calls do so.
In CompositionEngine::present, improve the process for selecting which
displays to offload. In the old process, a virtual display without HAL
support could in theory return true for supportsOffloadPresent. Even
though it wasn't counted in the original number, it could then be told
to offload present, resulting in one of the intended displays not
offloading.
In the new process, store a list of eligible displays, so that only
eligible displays are told to offload. This also means that
supportsOffloadPresent is called at most once per frame.
Bug: 241285491
Bug: 259132483
Test: libcompositionengine_test
Change-Id: Ie2836e07e900c0269d60112ec0ebfa82ee4b82d7
diff --git a/services/surfaceflinger/CompositionEngine/Android.bp b/services/surfaceflinger/CompositionEngine/Android.bp
index 455e623..e316190 100644
--- a/services/surfaceflinger/CompositionEngine/Android.bp
+++ b/services/surfaceflinger/CompositionEngine/Android.bp
@@ -127,6 +127,10 @@
cc_test {
name: "libcompositionengine_test",
test_suites: ["device-tests"],
+ include_dirs: [
+ "frameworks/native/services/surfaceflinger/common/include",
+ "frameworks/native/services/surfaceflinger/tests/unittests",
+ ],
defaults: ["libcompositionengine_defaults"],
srcs: [
"tests/planner/CachedSetTest.cpp",