blob: b764f74bf116e7233626ec778aed74444cf9dfbb [file] [log] [blame]
John Reck4f02bf42014-01-03 18:09:17 -08001/*
2 * Copyright (C) 2013 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
John Reck4f02bf42014-01-03 18:09:17 -080017#include "RenderProxy.h"
18
John Reckba6adf62015-02-19 14:36:50 -080019#include "DeferredLayerUpdater.h"
20#include "DisplayList.h"
John Recka8963062017-06-14 10:47:50 -070021#include "Properties.h"
John Reck10dd0582016-03-31 16:36:16 -070022#include "Readback.h"
John Reckba6adf62015-02-19 14:36:50 -080023#include "Rect.h"
John Reck5cca8f22018-12-10 17:06:22 -080024#include "WebViewFunctorManager.h"
John Reckba6adf62015-02-19 14:36:50 -080025#include "renderthread/CanvasContext.h"
26#include "renderthread/RenderTask.h"
27#include "renderthread/RenderThread.h"
28#include "utils/Macros.h"
John Reck43871902016-08-01 14:39:24 -070029#include "utils/TimeUtils.h"
John Reck322b8ab2019-03-14 13:15:28 -070030#include "utils/TraceUtils.h"
John Reck4f02bf42014-01-03 18:09:17 -080031
32namespace android {
33namespace uirenderer {
34namespace renderthread {
35
John Reck1bcacfd2017-11-03 10:12:19 -070036RenderProxy::RenderProxy(bool translucent, RenderNode* rootRenderNode,
37 IContextFactory* contextFactory)
38 : mRenderThread(RenderThread::getInstance()), mContext(nullptr) {
John Reckf8441e62017-10-23 13:10:41 -070039 mContext = mRenderThread.queue().runSync([&]() -> CanvasContext* {
40 return CanvasContext::create(mRenderThread, translucent, rootRenderNode, contextFactory);
41 });
Skuhneea7a7fb2015-08-28 07:10:31 -070042 mDrawFrameTask.setContext(&mRenderThread, mContext, rootRenderNode);
John Reck4f02bf42014-01-03 18:09:17 -080043}
44
45RenderProxy::~RenderProxy() {
46 destroyContext();
47}
48
John Reck4f02bf42014-01-03 18:09:17 -080049void RenderProxy::destroyContext() {
50 if (mContext) {
Skuhneea7a7fb2015-08-28 07:10:31 -070051 mDrawFrameTask.setContext(nullptr, nullptr, nullptr);
John Reck668f0e32014-03-26 15:10:40 -070052 // This is also a fence as we need to be certain that there are no
53 // outstanding mDrawFrame tasks posted before it is destroyed
John Reck1bcacfd2017-11-03 10:12:19 -070054 mRenderThread.queue().runSync([this]() { delete mContext; });
John Reckf8441e62017-10-23 13:10:41 -070055 mContext = nullptr;
John Reck4f02bf42014-01-03 18:09:17 -080056 }
57}
58
John Reck1125d1f2014-10-23 11:02:19 -070059void RenderProxy::setSwapBehavior(SwapBehavior swapBehavior) {
John Reck1bcacfd2017-11-03 10:12:19 -070060 mRenderThread.queue().post([this, swapBehavior]() { mContext->setSwapBehavior(swapBehavior); });
John Recke4280ba2014-05-05 16:39:37 -070061}
62
63bool RenderProxy::loadSystemProperties() {
John Reckf8441e62017-10-23 13:10:41 -070064 return mRenderThread.queue().runSync([this]() -> bool {
John Reckd9d7f122018-05-03 14:40:56 -070065 bool needsRedraw = Properties::load();
John Reckf8441e62017-10-23 13:10:41 -070066 if (mContext->profiler().consumeProperties()) {
67 needsRedraw = true;
68 }
69 return needsRedraw;
70 });
John Reckb36016c2015-03-11 08:50:53 -070071}
72
73void RenderProxy::setName(const char* name) {
John Reckf8441e62017-10-23 13:10:41 -070074 // block since name/value pointers owned by caller
75 // TODO: Support move arguments
John Reck1bcacfd2017-11-03 10:12:19 -070076 mRenderThread.queue().runSync([this, name]() { mContext->setName(std::string(name)); });
John Reck4f02bf42014-01-03 18:09:17 -080077}
78
Alec Mouri43fe6fc2019-12-23 07:46:19 -080079void RenderProxy::setSurface(ANativeWindow* window, bool enableTimeout) {
80 ANativeWindow_acquire(window);
81 mRenderThread.queue().post([this, win = window, enableTimeout]() mutable {
82 mContext->setSurface(win, enableTimeout);
83 ANativeWindow_release(win);
John Reckcd18c222019-11-21 14:40:53 -080084 });
John Reck4f02bf42014-01-03 18:09:17 -080085}
86
John Reck8785ceb2018-10-29 16:45:58 -070087void RenderProxy::allocateBuffers() {
88 mRenderThread.queue().post([=]() { mContext->allocateBuffers(); });
Jorim Jaggi7823ee72018-07-17 15:24:16 +020089}
90
John Reck8785ceb2018-10-29 16:45:58 -070091bool RenderProxy::pause() {
John Reck1bcacfd2017-11-03 10:12:19 -070092 return mRenderThread.queue().runSync([this]() -> bool { return mContext->pauseSurface(); });
John Reck8afcc762016-04-13 10:24:06 -070093}
94
95void RenderProxy::setStopped(bool stopped) {
John Reck1bcacfd2017-11-03 10:12:19 -070096 mRenderThread.queue().runSync([this, stopped]() { mContext->setStopped(stopped); });
John Reck8afcc762016-04-13 10:24:06 -070097}
98
John Reck8785ceb2018-10-29 16:45:58 -070099void RenderProxy::setLightAlpha(uint8_t ambientShadowAlpha, uint8_t spotShadowAlpha) {
John Reck1bcacfd2017-11-03 10:12:19 -0700100 mRenderThread.queue().post(
John Reck8785ceb2018-10-29 16:45:58 -0700101 [=]() { mContext->setLightAlpha(ambientShadowAlpha, spotShadowAlpha); });
Alan Viverette50210d92015-05-14 18:05:36 -0700102}
103
John Reck8785ceb2018-10-29 16:45:58 -0700104void RenderProxy::setLightGeometry(const Vector3& lightCenter, float lightRadius) {
105 mRenderThread.queue().post([=]() { mContext->setLightGeometry(lightCenter, lightRadius); });
John Reck63a06672014-05-07 13:45:54 -0700106}
107
108void RenderProxy::setOpaque(bool opaque) {
John Reck1bcacfd2017-11-03 10:12:19 -0700109 mRenderThread.queue().post([=]() { mContext->setOpaque(opaque); });
Romain Guy26a2b972017-04-17 09:39:51 -0700110}
111
112void RenderProxy::setWideGamut(bool wideGamut) {
John Reck1bcacfd2017-11-03 10:12:19 -0700113 mRenderThread.queue().post([=]() { mContext->setWideGamut(wideGamut); });
Romain Guy26a2b972017-04-17 09:39:51 -0700114}
115
John Reckba6adf62015-02-19 14:36:50 -0800116int64_t* RenderProxy::frameInfo() {
117 return mDrawFrameTask.frameInfo();
118}
119
John Reck2de950d2017-01-25 10:58:30 -0800120int RenderProxy::syncAndDrawFrame() {
121 return mDrawFrameTask.drawFrame();
John Reck4f02bf42014-01-03 18:09:17 -0800122}
123
John Reck2de950d2017-01-25 10:58:30 -0800124void RenderProxy::destroy() {
John Reckfae904d2014-04-14 11:01:57 -0700125 // destroyCanvasAndSurface() needs a fence as when it returns the
126 // underlying BufferQueue is going to be released from under
127 // the render thread.
John Reck1bcacfd2017-11-03 10:12:19 -0700128 mRenderThread.queue().runSync([=]() { mContext->destroy(); });
John Reck0d1f6342014-03-28 20:30:27 -0700129}
130
John Reck283bb462018-12-13 16:40:14 -0800131void RenderProxy::destroyFunctor(int functor) {
132 ATRACE_CALL();
133 RenderThread& thread = RenderThread::getInstance();
John Reck5cca8f22018-12-10 17:06:22 -0800134 thread.queue().post([=]() { WebViewFunctorManager::instance().destroyFunctor(functor); });
John Reck283bb462018-12-13 16:40:14 -0800135}
136
John Reck19b6bcf2014-02-14 20:03:38 -0800137DeferredLayerUpdater* RenderProxy::createTextureLayer() {
John Reckf8441e62017-10-23 13:10:41 -0700138 return mRenderThread.queue().runSync([this]() -> auto {
139 return mContext->createTextureLayer();
140 });
John Reck3e824952014-08-20 10:08:39 -0700141}
142
John Reck2de950d2017-01-25 10:58:30 -0800143void RenderProxy::buildLayer(RenderNode* node) {
John Reck1bcacfd2017-11-03 10:12:19 -0700144 mRenderThread.queue().runSync([&]() { mContext->buildLayer(node); });
John Reck19b6bcf2014-02-14 20:03:38 -0800145}
146
John Reck3731dc22015-04-13 15:20:29 -0700147bool RenderProxy::copyLayerInto(DeferredLayerUpdater* layer, SkBitmap& bitmap) {
John Reckfbeac3c2019-03-29 11:24:56 -0700148 ATRACE_NAME("TextureView#getBitmap");
Stan Iliev1a025a72018-09-05 16:35:11 -0400149 auto& thread = RenderThread::getInstance();
John Reck5cca8f22018-12-10 17:06:22 -0800150 return thread.queue().runSync([&]() -> bool {
151 return thread.readback().copyLayerInto(layer, &bitmap) == CopyResult::Success;
152 });
John Reck19b6bcf2014-02-14 20:03:38 -0800153}
154
John Reckd72e0a32014-05-29 18:56:11 -0700155void RenderProxy::pushLayerUpdate(DeferredLayerUpdater* layer) {
156 mDrawFrameTask.pushLayerUpdate(layer);
157}
158
159void RenderProxy::cancelLayerUpdate(DeferredLayerUpdater* layer) {
160 mDrawFrameTask.removeLayerUpdate(layer);
John Reck19b6bcf2014-02-14 20:03:38 -0800161}
162
John Reck918ad522014-06-27 14:45:25 -0700163void RenderProxy::detachSurfaceTexture(DeferredLayerUpdater* layer) {
John Reck1bcacfd2017-11-03 10:12:19 -0700164 return mRenderThread.queue().runSync([&]() { layer->detachSurfaceTexture(); });
John Recke1628b72014-05-23 15:11:19 -0700165}
166
John Reck2de950d2017-01-25 10:58:30 -0800167void RenderProxy::destroyHardwareResources() {
John Reck1bcacfd2017-11-03 10:12:19 -0700168 return mRenderThread.queue().runSync([&]() { mContext->destroyHardwareResources(); });
John Reckf47a5942014-06-30 16:20:04 -0700169}
170
171void RenderProxy::trimMemory(int level) {
John Reckcd3a22c2014-08-06 13:33:59 -0700172 // Avoid creating a RenderThread to do a trimMemory.
173 if (RenderThread::hasInstance()) {
174 RenderThread& thread = RenderThread::getInstance();
John Reck1bcacfd2017-11-03 10:12:19 -0700175 thread.queue().post([&thread, level]() { CanvasContext::trimMemory(thread, level); });
John Reckcd3a22c2014-08-06 13:33:59 -0700176 }
John Reckf47a5942014-06-30 16:20:04 -0700177}
178
Chris Craik2507c342015-05-04 14:36:49 -0700179void RenderProxy::overrideProperty(const char* name, const char* value) {
John Reckf8441e62017-10-23 13:10:41 -0700180 // expensive, but block here since name/value pointers owned by caller
John Reck1bcacfd2017-11-03 10:12:19 -0700181 RenderThread::getInstance().queue().runSync(
182 [&]() { Properties::overrideProperty(name, value); });
Chris Craik2507c342015-05-04 14:36:49 -0700183}
184
John Reck28ad7b52014-04-07 16:59:25 -0700185void RenderProxy::fence() {
John Reck1bcacfd2017-11-03 10:12:19 -0700186 mRenderThread.queue().runSync([]() {});
John Reck28ad7b52014-04-07 16:59:25 -0700187}
188
John Recke4c1e6c2018-05-24 16:27:35 -0700189int RenderProxy::maxTextureSize() {
John Reck5cca8f22018-12-10 17:06:22 -0800190 static int maxTextureSize = RenderThread::getInstance().queue().runSync(
191 []() { return DeviceInfo::get()->maxTextureSize(); });
John Recke4c1e6c2018-05-24 16:27:35 -0700192 return maxTextureSize;
John Reckf47a5942014-06-30 16:20:04 -0700193}
194
195void RenderProxy::stopDrawing() {
John Reck1bcacfd2017-11-03 10:12:19 -0700196 mRenderThread.queue().runSync([this]() { mContext->stopDrawing(); });
John Recka5dda642014-05-22 15:43:54 -0700197}
198
199void RenderProxy::notifyFramePending() {
John Reck1bcacfd2017-11-03 10:12:19 -0700200 mRenderThread.queue().post([this]() { mContext->notifyFramePending(); });
John Reckfe5e7b72014-05-23 17:42:28 -0700201}
202
John Reckba6adf62015-02-19 14:36:50 -0800203void RenderProxy::dumpProfileInfo(int fd, int dumpFlags) {
John Reckf8441e62017-10-23 13:10:41 -0700204 mRenderThread.queue().runSync([&]() {
205 mContext->profiler().dumpData(fd);
206 if (dumpFlags & DumpFlags::FrameStats) {
207 mContext->dumpFrames(fd);
208 }
209 if (dumpFlags & DumpFlags::JankStats) {
210 mRenderThread.globalProfileData()->dump(fd);
211 }
212 if (dumpFlags & DumpFlags::Reset) {
213 mContext->resetFrameStats();
214 }
215 });
John Reck7f2e5e32015-05-05 11:00:53 -0700216}
217
218void RenderProxy::resetProfileInfo() {
John Reck1bcacfd2017-11-03 10:12:19 -0700219 mRenderThread.queue().runSync([=]() { mContext->resetFrameStats(); });
John Reck7f2e5e32015-05-05 11:00:53 -0700220}
221
John Reckf8441e62017-10-23 13:10:41 -0700222uint32_t RenderProxy::frameTimePercentile(int percentile) {
223 return mRenderThread.queue().runSync([&]() -> auto {
224 return mRenderThread.globalProfileData()->findPercentile(percentile);
225 });
John Reck0e89e2b2014-10-31 14:49:06 -0700226}
227
Chris Craik2ae07332015-01-21 14:22:39 -0800228void RenderProxy::dumpGraphicsMemory(int fd) {
John Reckba7e9652019-01-23 10:33:41 -0800229 if (RenderThread::hasInstance()) {
230 auto& thread = RenderThread::getInstance();
231 thread.queue().runSync([&]() { thread.dumpGraphicsMemory(fd); });
232 }
John Reckedc524c2015-03-18 15:24:33 -0700233}
234
235void RenderProxy::setProcessStatsBuffer(int fd) {
John Reckdf1742e2017-01-19 15:56:21 -0800236 auto& rt = RenderThread::getInstance();
John Reck0fa0cbc2019-04-05 16:57:46 -0700237 rt.queue().post([&rt, fd = dup(fd)]() {
John Reckf8441e62017-10-23 13:10:41 -0700238 rt.globalProfileData().switchStorageToAshmem(fd);
239 close(fd);
240 });
John Reckdf1742e2017-01-19 15:56:21 -0800241}
242
243void RenderProxy::rotateProcessStatsBuffer() {
John Reckdf1742e2017-01-19 15:56:21 -0800244 auto& rt = RenderThread::getInstance();
John Reck1bcacfd2017-11-03 10:12:19 -0700245 rt.queue().post([&rt]() { rt.globalProfileData().rotateStorage(); });
John Reckedc524c2015-03-18 15:24:33 -0700246}
247
Tim Murray33eb07f2016-06-10 10:03:20 -0700248int RenderProxy::getRenderThreadTid() {
249 return mRenderThread.getTid();
250}
251
Skuhneea7a7fb2015-08-28 07:10:31 -0700252void RenderProxy::addRenderNode(RenderNode* node, bool placeFront) {
John Reck1bcacfd2017-11-03 10:12:19 -0700253 mRenderThread.queue().post([=]() { mContext->addRenderNode(node, placeFront); });
Skuhneea7a7fb2015-08-28 07:10:31 -0700254}
255
256void RenderProxy::removeRenderNode(RenderNode* node) {
John Reck1bcacfd2017-11-03 10:12:19 -0700257 mRenderThread.queue().post([=]() { mContext->removeRenderNode(node); });
Skuhneea7a7fb2015-08-28 07:10:31 -0700258}
259
260void RenderProxy::drawRenderNode(RenderNode* node) {
John Reck1bcacfd2017-11-03 10:12:19 -0700261 mRenderThread.queue().runSync([=]() { mContext->prepareAndDraw(node); });
Skuhneea7a7fb2015-08-28 07:10:31 -0700262}
263
Skuhneb8160872015-09-22 09:51:39 -0700264void RenderProxy::setContentDrawBounds(int left, int top, int right, int bottom) {
John Reckf138b172017-09-08 11:00:42 -0700265 mDrawFrameTask.setContentDrawBounds(left, top, right, bottom);
Skuhneea7a7fb2015-08-28 07:10:31 -0700266}
267
John Reck5cca8f22018-12-10 17:06:22 -0800268void RenderProxy::setPictureCapturedCallback(
269 const std::function<void(sk_sp<SkPicture>&&)>& callback) {
270 mRenderThread.queue().post(
John Reck0fa0cbc2019-04-05 16:57:46 -0700271 [this, cb = callback]() { mContext->setPictureCapturedCallback(cb); });
John Reck5cca8f22018-12-10 17:06:22 -0800272}
273
Mihai Popa95688002018-02-23 16:10:11 +0000274void RenderProxy::setFrameCallback(std::function<void(int64_t)>&& callback) {
275 mDrawFrameTask.setFrameCallback(std::move(callback));
276}
277
John Reckcc2eee82018-05-17 10:44:00 -0700278void RenderProxy::setFrameCompleteCallback(std::function<void(int64_t)>&& callback) {
279 mDrawFrameTask.setFrameCompleteCallback(std::move(callback));
280}
281
John Reckf8441e62017-10-23 13:10:41 -0700282void RenderProxy::addFrameMetricsObserver(FrameMetricsObserver* observerPtr) {
John Reck0fa0cbc2019-04-05 16:57:46 -0700283 mRenderThread.queue().post([this, observer = sp{observerPtr}]() {
John Reckf8441e62017-10-23 13:10:41 -0700284 mContext->addFrameMetricsObserver(observer.get());
285 });
Andres Morales06f5bc72015-12-15 15:21:31 -0800286}
287
John Reckf8441e62017-10-23 13:10:41 -0700288void RenderProxy::removeFrameMetricsObserver(FrameMetricsObserver* observerPtr) {
John Reck0fa0cbc2019-04-05 16:57:46 -0700289 mRenderThread.queue().post([this, observer = sp{observerPtr}]() {
John Reckf8441e62017-10-23 13:10:41 -0700290 mContext->removeFrameMetricsObserver(observer.get());
291 });
John Reck10dd0582016-03-31 16:36:16 -0700292}
293
John Reckbb3a3582018-09-26 11:21:08 -0700294void RenderProxy::setForceDark(bool enable) {
John Reck5cca8f22018-12-10 17:06:22 -0800295 mRenderThread.queue().post([this, enable]() { mContext->setForceDark(enable); });
John Reckbb3a3582018-09-26 11:21:08 -0700296}
297
John Reck4d527222019-03-13 16:25:20 -0700298void RenderProxy::setRenderAheadDepth(int renderAhead) {
John Reck0fa0cbc2019-04-05 16:57:46 -0700299 mRenderThread.queue().post(
300 [context = mContext, renderAhead] { context->setRenderAheadDepth(renderAhead); });
John Reck4d527222019-03-13 16:25:20 -0700301}
302
Alec Mouri43fe6fc2019-12-23 07:46:19 -0800303int RenderProxy::copySurfaceInto(ANativeWindow* window, int left, int top, int right, int bottom,
John Reck1bcacfd2017-11-03 10:12:19 -0700304 SkBitmap* bitmap) {
John Reckf8441e62017-10-23 13:10:41 -0700305 auto& thread = RenderThread::getInstance();
306 return static_cast<int>(thread.queue().runSync([&]() -> auto {
Alec Mouri8a82b142019-12-17 09:41:48 -0800307 return thread.readback().copySurfaceInto(window, Rect(left, top, right, bottom), bitmap);
John Reckf8441e62017-10-23 13:10:41 -0700308 }));
John Reck43871902016-08-01 14:39:24 -0700309}
310
sergeyvec4a4b12016-10-20 18:39:04 -0700311void RenderProxy::prepareToDraw(Bitmap& bitmap) {
John Reck43871902016-08-01 14:39:24 -0700312 // If we haven't spun up a hardware accelerated window yet, there's no
313 // point in precaching these bitmaps as it can't impact jank.
314 // We also don't know if we even will spin up a hardware-accelerated
315 // window or not.
316 if (!RenderThread::hasInstance()) return;
317 RenderThread* renderThread = &RenderThread::getInstance();
sergeyvec4a4b12016-10-20 18:39:04 -0700318 bitmap.ref();
John Reckf8441e62017-10-23 13:10:41 -0700319 auto task = [renderThread, &bitmap]() {
320 CanvasContext::prepareToDraw(*renderThread, &bitmap);
321 bitmap.unref();
322 };
John Reck43871902016-08-01 14:39:24 -0700323 nsecs_t lastVsync = renderThread->timeLord().latestVsync();
324 nsecs_t estimatedNextVsync = lastVsync + renderThread->timeLord().frameIntervalNanos();
Jerome Gaillarde218c692019-06-14 12:58:57 +0100325 nsecs_t timeToNextVsync = estimatedNextVsync - systemTime(SYSTEM_TIME_MONOTONIC);
John Reck43871902016-08-01 14:39:24 -0700326 // We expect the UI thread to take 4ms and for RT to be active from VSYNC+4ms to
327 // VSYNC+12ms or so, so aim for the gap during which RT is expected to
328 // be idle
329 // TODO: Make this concept a first-class supported thing? RT could use
330 // knowledge of pending draws to better schedule this task
331 if (timeToNextVsync > -6_ms && timeToNextVsync < 1_ms) {
John Reckf8441e62017-10-23 13:10:41 -0700332 renderThread->queue().postAt(estimatedNextVsync + 8_ms, task);
John Reck43871902016-08-01 14:39:24 -0700333 } else {
John Reckf8441e62017-10-23 13:10:41 -0700334 renderThread->queue().post(task);
John Reck43871902016-08-01 14:39:24 -0700335 }
336}
337
Stan Iliev1a025a72018-09-05 16:35:11 -0400338int RenderProxy::copyHWBitmapInto(Bitmap* hwBitmap, SkBitmap* bitmap) {
John Reckfbeac3c2019-03-29 11:24:56 -0700339 ATRACE_NAME("HardwareBitmap readback");
Stan Iliev6983bc42017-02-02 14:11:53 -0500340 RenderThread& thread = RenderThread::getInstance();
John Reck1072fff2018-04-12 15:20:09 -0700341 if (gettid() == thread.getTid()) {
John Reck1bcacfd2017-11-03 10:12:19 -0700342 // TODO: fix everything that hits this. We should never be triggering a readback ourselves.
Stan Iliev1a025a72018-09-05 16:35:11 -0400343 return (int)thread.readback().copyHWBitmapInto(hwBitmap, bitmap);
Stan Iliev6983bc42017-02-02 14:11:53 -0500344 } else {
John Reck5cca8f22018-12-10 17:06:22 -0800345 return thread.queue().runSync(
346 [&]() -> int { return (int)thread.readback().copyHWBitmapInto(hwBitmap, bitmap); });
Stan Iliev6983bc42017-02-02 14:11:53 -0500347 }
sergeyv59eecb522016-11-17 17:54:57 -0800348}
349
John Recka8963062017-06-14 10:47:50 -0700350void RenderProxy::disableVsync() {
351 Properties::disableVsync = true;
352}
353
Stan Iliev898123b2019-02-14 14:57:44 -0500354void RenderProxy::preload() {
355 // Create RenderThread object and start the thread. Then preload Vulkan/EGL driver.
356 auto& thread = RenderThread::getInstance();
John Reck0fa0cbc2019-04-05 16:57:46 -0700357 thread.queue().post([&thread]() { thread.preload(); });
Stan Iliev898123b2019-02-14 14:57:44 -0500358}
359
John Reck4f02bf42014-01-03 18:09:17 -0800360} /* namespace renderthread */
361} /* namespace uirenderer */
362} /* namespace android */