diff options
author | Chris Gross <chrisgross@google.com> | 2021-03-10 23:00:14 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-03-10 23:00:14 +0000 |
commit | 1cb919df825afb10aaa5e796a7f4360be2d0ffd8 (patch) | |
tree | 30edf79f5c62d947eb8086a5274ab28f847bce1a /libs/hwui/renderthread/RenderThread.cpp | |
parent | 984b7be598827be9938ce00b8f550ad4836bf67a (diff) | |
parent | 4edca1117cdcad002c57f24db04b833088f2439b (diff) |
Merge changes from topic "SP1A.210222.001" into s-keystone-qcom-dev
* changes:
Adapt to rename of DisplayConfig to DisplayMode.
Moves assignDisplayIdLocked to the Layout class.
Removes import of deprecated com.android.ims.ImsException.
Remove duplicate definitions of stringToAdnStringField().
Stops enforcing uses_libs matching AndroidManifest.xml for SystemUI.
Revert "CamcorderProfiles: Add 8KUHD camcorder profile"
Merge SP1A.210222.001
Diffstat (limited to 'libs/hwui/renderthread/RenderThread.cpp')
-rw-r--r-- | libs/hwui/renderthread/RenderThread.cpp | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/libs/hwui/renderthread/RenderThread.cpp b/libs/hwui/renderthread/RenderThread.cpp index 7750a31b817f..5dc02e8454ac 100644 --- a/libs/hwui/renderthread/RenderThread.cpp +++ b/libs/hwui/renderthread/RenderThread.cpp @@ -33,6 +33,7 @@ #include <GrContextOptions.h> #include <gl/GrGLInterface.h> +#include <dlfcn.h> #include <sys/resource.h> #include <utils/Condition.h> #include <utils/Log.h> @@ -49,6 +50,37 @@ static bool gHasRenderThreadInstance = false; static JVMAttachHook gOnStartHook = nullptr; +ASurfaceControlFunctions::ASurfaceControlFunctions() { + void* handle_ = dlopen("libandroid.so", RTLD_NOW | RTLD_NODELETE); + acquireFunc = (ASC_acquire) dlsym(handle_, "ASurfaceControl_acquire"); + LOG_ALWAYS_FATAL_IF(acquireFunc == nullptr, + "Failed to find required symbol ASurfaceControl_acquire!"); + + releaseFunc = (ASC_release) dlsym(handle_, "ASurfaceControl_release"); + LOG_ALWAYS_FATAL_IF(releaseFunc == nullptr, + "Failed to find required symbol ASurfaceControl_release!"); + + registerListenerFunc = (ASC_registerSurfaceStatsListener) dlsym(handle_, + "ASurfaceControl_registerSurfaceStatsListener"); + LOG_ALWAYS_FATAL_IF(registerListenerFunc == nullptr, + "Failed to find required symbol ASurfaceControl_registerSurfaceStatsListener!"); + + unregisterListenerFunc = (ASC_unregisterSurfaceStatsListener) dlsym(handle_, + "ASurfaceControl_unregisterSurfaceStatsListener"); + LOG_ALWAYS_FATAL_IF(unregisterListenerFunc == nullptr, + "Failed to find required symbol ASurfaceControl_unregisterSurfaceStatsListener!"); + + getAcquireTimeFunc = (ASCStats_getAcquireTime) dlsym(handle_, + "ASurfaceControlStats_getAcquireTime"); + LOG_ALWAYS_FATAL_IF(getAcquireTimeFunc == nullptr, + "Failed to find required symbol ASurfaceControlStats_getAcquireTime!"); + + getFrameNumberFunc = (ASCStats_getFrameNumber) dlsym(handle_, + "ASurfaceControlStats_getFrameNumber"); + LOG_ALWAYS_FATAL_IF(getFrameNumberFunc == nullptr, + "Failed to find required symbol ASurfaceControlStats_getFrameNumber!"); +} + void RenderThread::frameCallback(int64_t frameTimeNanos, void* data) { RenderThread* rt = reinterpret_cast<RenderThread*>(data); int64_t vsyncId = AChoreographer_getVsyncId(rt->mChoreographer); @@ -134,7 +166,8 @@ RenderThread::RenderThread() , mFrameCallbackTaskPending(false) , mRenderState(nullptr) , mEglManager(nullptr) - , mFunctorManager(WebViewFunctorManager::instance()) { + , mFunctorManager(WebViewFunctorManager::instance()) + , mGlobalProfileData(mJankDataMutex) { Properties::load(); start("RenderThread"); } |