diff options
author | Bo Liu <boliu@google.com> | 2021-07-17 16:42:13 -0400 |
---|---|---|
committer | Bo Liu <boliu@google.com> | 2021-07-22 11:33:01 -0400 |
commit | 6a3fc60f4358a49536bb58bf703c97651b2eccba (patch) | |
tree | fc805606213481adeaec4c2d04dd4431cb1d1764 /libs/hwui/renderthread/RenderProxy.cpp | |
parent | 4426772eabda18a5391715ef1a762c2fcfe13eb0 (diff) |
Switch HWUI to use native performance hint API
Test: None
Bug: 194204196
Change-Id: I80dfdb5d56921c465406cc4534e82738c668d46d
Diffstat (limited to 'libs/hwui/renderthread/RenderProxy.cpp')
-rw-r--r-- | libs/hwui/renderthread/RenderProxy.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp index a77b5b569907..c485ce2781e5 100644 --- a/libs/hwui/renderthread/RenderProxy.cpp +++ b/libs/hwui/renderthread/RenderProxy.cpp @@ -29,6 +29,8 @@ #include "utils/Macros.h" #include "utils/TimeUtils.h" +#include <pthread.h> + namespace android { namespace uirenderer { namespace renderthread { @@ -39,7 +41,8 @@ RenderProxy::RenderProxy(bool translucent, RenderNode* rootRenderNode, mContext = mRenderThread.queue().runSync([&]() -> CanvasContext* { return CanvasContext::create(mRenderThread, translucent, rootRenderNode, contextFactory); }); - mDrawFrameTask.setContext(&mRenderThread, mContext, rootRenderNode); + mDrawFrameTask.setContext(&mRenderThread, mContext, rootRenderNode, + pthread_gettid_np(pthread_self()), getRenderThreadTid()); } RenderProxy::~RenderProxy() { @@ -48,7 +51,7 @@ RenderProxy::~RenderProxy() { void RenderProxy::destroyContext() { if (mContext) { - mDrawFrameTask.setContext(nullptr, nullptr, nullptr); + mDrawFrameTask.setContext(nullptr, nullptr, nullptr, -1, -1); // This is also a fence as we need to be certain that there are no // outstanding mDrawFrame tasks posted before it is destroyed mRenderThread.queue().runSync([this]() { delete mContext; }); @@ -76,12 +79,6 @@ void RenderProxy::setName(const char* name) { mRenderThread.queue().runSync([this, name]() { mContext->setName(std::string(name)); }); } -void RenderProxy::setHintSessionCallbacks(std::function<void(int64_t)> updateTargetWorkDuration, - std::function<void(int64_t)> reportActualWorkDuration) { - mDrawFrameTask.setHintSessionCallbacks(std::move(updateTargetWorkDuration), - std::move(reportActualWorkDuration)); -} - void RenderProxy::setSurface(ANativeWindow* window, bool enableTimeout) { if (window) { ANativeWindow_acquire(window); } mRenderThread.queue().post([this, win = window, enableTimeout]() mutable { |