Support render-ahead in vulkan
Bug: 127822449
Test: verified render_ahead working with skiavk
Change-Id: Iae1b227a763f6def035057f38cca4b0ab65c7e82
diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp
index b58bab1..1a1b9da 100644
--- a/libs/hwui/renderthread/RenderProxy.cpp
+++ b/libs/hwui/renderthread/RenderProxy.cpp
@@ -84,7 +84,7 @@
void RenderProxy::setSurface(const sp<Surface>& surface) {
mRenderThread.queue().post(
- [ this, surf = surface ]() mutable { mContext->setSurface(std::move(surf)); });
+ [this, surf = surface]() mutable { mContext->setSurface(std::move(surf)); });
}
void RenderProxy::allocateBuffers() {
@@ -251,7 +251,7 @@
void RenderProxy::setProcessStatsBuffer(int fd) {
auto& rt = RenderThread::getInstance();
- rt.queue().post([&rt, fd = dup(fd) ]() {
+ rt.queue().post([&rt, fd = dup(fd)]() {
rt.globalProfileData().switchStorageToAshmem(fd);
close(fd);
});
@@ -285,7 +285,7 @@
void RenderProxy::setPictureCapturedCallback(
const std::function<void(sk_sp<SkPicture>&&)>& callback) {
mRenderThread.queue().post(
- [ this, cb = callback ]() { mContext->setPictureCapturedCallback(cb); });
+ [this, cb = callback]() { mContext->setPictureCapturedCallback(cb); });
}
void RenderProxy::setFrameCallback(std::function<void(int64_t)>&& callback) {
@@ -297,13 +297,13 @@
}
void RenderProxy::addFrameMetricsObserver(FrameMetricsObserver* observerPtr) {
- mRenderThread.queue().post([ this, observer = sp{observerPtr} ]() {
+ mRenderThread.queue().post([this, observer = sp{observerPtr}]() {
mContext->addFrameMetricsObserver(observer.get());
});
}
void RenderProxy::removeFrameMetricsObserver(FrameMetricsObserver* observerPtr) {
- mRenderThread.queue().post([ this, observer = sp{observerPtr} ]() {
+ mRenderThread.queue().post([this, observer = sp{observerPtr}]() {
mContext->removeFrameMetricsObserver(observer.get());
});
}
@@ -313,9 +313,8 @@
}
void RenderProxy::setRenderAheadDepth(int renderAhead) {
- mRenderThread.queue().post([ context = mContext, renderAhead ] {
- context->setRenderAheadDepth(renderAhead);
- });
+ mRenderThread.queue().post(
+ [context = mContext, renderAhead] { context->setRenderAheadDepth(renderAhead); });
}
int RenderProxy::copySurfaceInto(sp<Surface>& surface, int left, int top, int right, int bottom,
@@ -393,9 +392,7 @@
void RenderProxy::preload() {
// Create RenderThread object and start the thread. Then preload Vulkan/EGL driver.
auto& thread = RenderThread::getInstance();
- thread.queue().post([&thread]() {
- thread.preload();
- });
+ thread.queue().post([&thread]() { thread.preload(); });
}
} /* namespace renderthread */