diff options
author | Scott Lobdell <slobdell@google.com> | 2021-02-23 11:55:26 -0800 |
---|---|---|
committer | Daniel Norman <danielnorman@google.com> | 2021-03-01 15:24:51 -0800 |
commit | 24818fca475a6726f5ef0cae42149615079af6e9 (patch) | |
tree | 1a3163ac7ce01c335d8d1c05cacddf47c0a30bfd /libs/hwui/renderthread/RenderProxy.cpp | |
parent | 8deb6bda58c7ecd95285f4dc934269e0c98c989a (diff) | |
parent | 0f50c486e59546c32acf3f2cdf6667897600de5c (diff) |
Merge SP1A.210222.001
Change-Id: If3509f3a660e820f4c8c0b29e007faa868e1f089
Diffstat (limited to 'libs/hwui/renderthread/RenderProxy.cpp')
-rw-r--r-- | libs/hwui/renderthread/RenderProxy.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp index b51f6dcfc66f..b9568fcf8e66 100644 --- a/libs/hwui/renderthread/RenderProxy.cpp +++ b/libs/hwui/renderthread/RenderProxy.cpp @@ -84,6 +84,19 @@ void RenderProxy::setSurface(ANativeWindow* window, bool enableTimeout) { }); } +void RenderProxy::setSurfaceControl(ASurfaceControl* surfaceControl) { + auto funcs = mRenderThread.getASurfaceControlFunctions(); + if (surfaceControl) { + funcs.acquireFunc(surfaceControl); + } + mRenderThread.queue().post([this, control = surfaceControl, funcs]() mutable { + mContext->setSurfaceControl(control); + if (control) { + funcs.releaseFunc(control); + } + }); +} + void RenderProxy::allocateBuffers() { mRenderThread.queue().post([=]() { mContext->allocateBuffers(); }); } @@ -202,6 +215,7 @@ void RenderProxy::notifyFramePending() { void RenderProxy::dumpProfileInfo(int fd, int dumpFlags) { mRenderThread.queue().runSync([&]() { + std::lock_guard lock(mRenderThread.getJankDataMutex()); mContext->profiler().dumpData(fd); if (dumpFlags & DumpFlags::FrameStats) { mContext->dumpFrames(fd); @@ -221,6 +235,7 @@ void RenderProxy::resetProfileInfo() { uint32_t RenderProxy::frameTimePercentile(int percentile) { return mRenderThread.queue().runSync([&]() -> auto { + std::lock_guard lock(mRenderThread.globalProfileData().getDataMutex()); return mRenderThread.globalProfileData()->findPercentile(percentile); }); } @@ -295,11 +310,6 @@ void RenderProxy::setForceDark(bool enable) { mRenderThread.queue().post([this, enable]() { mContext->setForceDark(enable); }); } -void RenderProxy::setRenderAheadDepth(int renderAhead) { - mRenderThread.queue().post( - [context = mContext, renderAhead] { context->setRenderAheadDepth(renderAhead); }); -} - int RenderProxy::copySurfaceInto(ANativeWindow* window, int left, int top, int right, int bottom, SkBitmap* bitmap) { auto& thread = RenderThread::getInstance(); |