summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/RenderProxy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/renderthread/RenderProxy.cpp')
-rw-r--r--libs/hwui/renderthread/RenderProxy.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp
index ad325cf2cdcc..95aa29d9eb13 100644
--- a/libs/hwui/renderthread/RenderProxy.cpp
+++ b/libs/hwui/renderthread/RenderProxy.cpp
@@ -195,6 +195,17 @@ void RenderProxy::trimMemory(int level) {
}
}
+void RenderProxy::purgeCaches() {
+ if (RenderThread::hasInstance()) {
+ RenderThread& thread = RenderThread::getInstance();
+ thread.queue().post([&thread]() {
+ if (thread.getGrContext()) {
+ thread.cacheManager().trimMemory(CacheManager::TrimMemoryMode::Complete);
+ }
+ });
+ }
+}
+
void RenderProxy::overrideProperty(const char* name, const char* value) {
// expensive, but block here since name/value pointers owned by caller
RenderThread::getInstance().queue().runSync(
@@ -256,6 +267,13 @@ void RenderProxy::dumpGraphicsMemory(int fd, bool includeProfileData) {
}
}
+void RenderProxy::getMemoryUsage(size_t* cpuUsage, size_t* gpuUsage) {
+ if (RenderThread::hasInstance()) {
+ auto& thread = RenderThread::getInstance();
+ thread.queue().runSync([&]() { thread.getMemoryUsage(cpuUsage, gpuUsage); });
+ }
+}
+
void RenderProxy::setProcessStatsBuffer(int fd) {
auto& rt = RenderThread::getInstance();
rt.queue().post([&rt, fd = dup(fd)]() {