From 6a3fc60f4358a49536bb58bf703c97651b2eccba Mon Sep 17 00:00:00 2001 From: Bo Liu Date: Sat, 17 Jul 2021 16:42:13 -0400 Subject: Switch HWUI to use native performance hint API Test: None Bug: 194204196 Change-Id: I80dfdb5d56921c465406cc4534e82738c668d46d --- libs/hwui/renderthread/RenderProxy.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'libs/hwui/renderthread/RenderProxy.cpp') 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 + 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 updateTargetWorkDuration, - std::function 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 { -- cgit v1.2.3