From 2b739bbb63857888fb96bdcbfdf6da1f0e79bb8a Mon Sep 17 00:00:00 2001 From: Bo Liu Date: Wed, 10 Nov 2021 19:20:03 -0500 Subject: [PATCH] Performance hint ndk APIs Test: atest PerformanceHintNativeTestCases Change-Id: I8f410cf5ee8cee90465d1ce48a42c9ff8bbe80c4 --- libs/hwui/renderthread/DrawFrameTask.h | 9 ++++----- native/android/libandroid.map.txt | 12 ++++++------ native/android/performance_hint.cpp | 7 ++++--- .../performance_hint/PerformanceHintNativeTest.cpp | 2 ++ 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/libs/hwui/renderthread/DrawFrameTask.h b/libs/hwui/renderthread/DrawFrameTask.h index e3ea802b07b9c..95468b6d61b69 100644 --- a/libs/hwui/renderthread/DrawFrameTask.h +++ b/libs/hwui/renderthread/DrawFrameTask.h @@ -16,19 +16,18 @@ #ifndef DRAWFRAMETASK_H #define DRAWFRAMETASK_H -#include -#include - -#include +#include #include #include #include -#include "RenderTask.h" +#include +#include #include "../FrameInfo.h" #include "../Rect.h" #include "../TreeInfo.h" +#include "RenderTask.h" namespace android { namespace uirenderer { diff --git a/native/android/libandroid.map.txt b/native/android/libandroid.map.txt index f00eef2f1b001..29dff130b3a4d 100644 --- a/native/android/libandroid.map.txt +++ b/native/android/libandroid.map.txt @@ -314,18 +314,18 @@ LIBANDROID { AThermal_registerThermalStatusListener; # introduced=30 AThermal_unregisterThermalStatusListener; # introduced=30 AThermal_getThermalHeadroom; # introduced=31 + APerformanceHint_getManager; # introduced=Tiramisu + APerformanceHint_createSession; # introduced=Tiramisu + APerformanceHint_getPreferredUpdateRateNanos; # introduced=Tiramisu + APerformanceHint_updateTargetWorkDuration; # introduced=Tiramisu + APerformanceHint_reportActualWorkDuration; # introduced=Tiramisu + APerformanceHint_closeSession; # introduced=Tiramisu local: *; }; LIBANDROID_PLATFORM { global: - APerformanceHint_getManager; - APerformanceHint_createSession; - APerformanceHint_getPreferredUpdateRateNanos; - APerformanceHint_updateTargetWorkDuration; - APerformanceHint_reportActualWorkDuration; - APerformanceHint_closeSession; APerformanceHint_setIHintManagerForTesting; extern "C++" { ASurfaceControl_registerSurfaceStatsListener*; diff --git a/native/android/performance_hint.cpp b/native/android/performance_hint.cpp index 51a0c99af66ef..0c360519ceb29 100644 --- a/native/android/performance_hint.cpp +++ b/native/android/performance_hint.cpp @@ -16,17 +16,18 @@ #define LOG_TAG "perf_hint" -#include -#include - #include #include +#include #include #include #include #include #include +#include +#include + using namespace android; using namespace android::os; diff --git a/native/android/tests/performance_hint/PerformanceHintNativeTest.cpp b/native/android/tests/performance_hint/PerformanceHintNativeTest.cpp index 284e9ee909ee8..b17850e5d1e43 100644 --- a/native/android/tests/performance_hint/PerformanceHintNativeTest.cpp +++ b/native/android/tests/performance_hint/PerformanceHintNativeTest.cpp @@ -18,10 +18,12 @@ #include #include +#include #include #include #include #include + #include #include