diff options
Diffstat (limited to 'libs/hwui/renderthread/RenderProxy.cpp')
-rw-r--r-- | libs/hwui/renderthread/RenderProxy.cpp | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp index 7c04f40..c643e1d 100644 --- a/libs/hwui/renderthread/RenderProxy.cpp +++ b/libs/hwui/renderthread/RenderProxy.cpp @@ -112,9 +112,9 @@ void RenderProxy::setSwapBehavior(SwapBehavior swapBehavior) { CREATE_BRIDGE1(loadSystemProperties, CanvasContext* context) { bool needsRedraw = false; if (Caches::hasInstance()) { - needsRedraw = Caches::getInstance().initProperties(); + needsRedraw = Properties::load(); } - if (args->context->profiler().loadSystemProperties()) { + if (args->context->profiler().consumeProperties()) { needsRedraw = true; } return (void*) needsRedraw; @@ -135,7 +135,7 @@ void RenderProxy::setName(const char* name) { SETUP_TASK(setName); args->context = mContext; args->name = name; - postAndWait(task); + postAndWait(task); // block since name/value pointers owned by caller } CREATE_BRIDGE2(initialize, CanvasContext* context, ANativeWindow* window) { @@ -331,7 +331,7 @@ void RenderProxy::destroyHardwareResources() { post(task); } -CREATE_BRIDGE2(timMemory, RenderThread* thread, int level) { +CREATE_BRIDGE2(trimMemory, RenderThread* thread, int level) { CanvasContext::trimMemory(*args->thread, args->level); return nullptr; } @@ -340,13 +340,26 @@ void RenderProxy::trimMemory(int level) { // Avoid creating a RenderThread to do a trimMemory. if (RenderThread::hasInstance()) { RenderThread& thread = RenderThread::getInstance(); - SETUP_TASK(timMemory); + SETUP_TASK(trimMemory); args->thread = &thread; args->level = level; thread.queue(task); } } +CREATE_BRIDGE2(overrideProperty, const char* name, const char* value) { + Properties::overrideProperty(args->name, args->value); + return nullptr; +} + +void RenderProxy::overrideProperty(const char* name, const char* value) { + RenderThread& thread = RenderThread::getInstance(); + SETUP_TASK(overrideProperty); + args->name = name; + args->value = value; + staticPostAndWait(task); // expensive, but block here since name/value pointers owned by caller +} + CREATE_BRIDGE0(fence) { // Intentionally empty return nullptr; @@ -383,8 +396,10 @@ void RenderProxy::notifyFramePending() { mRenderThread.queueAtFront(task); } -CREATE_BRIDGE3(dumpProfileInfo, CanvasContext* context, int fd, int dumpFlags) { +CREATE_BRIDGE4(dumpProfileInfo, CanvasContext* context, RenderThread* thread, + int fd, int dumpFlags) { args->context->profiler().dumpData(args->fd); + args->thread->jankTracker().dump(args->fd); if (args->dumpFlags & DumpFlags::kFrameStats) { args->context->dumpFrames(args->fd); } @@ -397,11 +412,23 @@ CREATE_BRIDGE3(dumpProfileInfo, CanvasContext* context, int fd, int dumpFlags) { void RenderProxy::dumpProfileInfo(int fd, int dumpFlags) { SETUP_TASK(dumpProfileInfo); args->context = mContext; + args->thread = &mRenderThread; args->fd = fd; args->dumpFlags = dumpFlags; postAndWait(task); } +CREATE_BRIDGE1(resetProfileInfo, CanvasContext* context) { + args->context->resetFrameStats(); + return nullptr; +} + +void RenderProxy::resetProfileInfo() { + SETUP_TASK(resetProfileInfo); + args->context = mContext; + postAndWait(task); +} + CREATE_BRIDGE2(dumpGraphicsMemory, int fd, RenderThread* thread) { args->thread->jankTracker().dump(args->fd); |