summaryrefslogtreecommitdiffstats
path: root/libs/hwui/renderthread
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/renderthread')
-rw-r--r--libs/hwui/renderthread/RenderProxy.cpp23
-rw-r--r--libs/hwui/renderthread/RenderProxy.h1
-rw-r--r--libs/hwui/renderthread/RenderThread.cpp1
3 files changed, 20 insertions, 5 deletions
diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp
index 7c04f40..6b8341b 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;
diff --git a/libs/hwui/renderthread/RenderProxy.h b/libs/hwui/renderthread/RenderProxy.h
index cc475fa..057fde4 100644
--- a/libs/hwui/renderthread/RenderProxy.h
+++ b/libs/hwui/renderthread/RenderProxy.h
@@ -90,6 +90,7 @@ public:
ANDROID_API void destroyHardwareResources();
ANDROID_API static void trimMemory(int level);
+ ANDROID_API static void overrideProperty(const char* name, const char* value);
ANDROID_API void fence();
ANDROID_API void stopDrawing();
diff --git a/libs/hwui/renderthread/RenderThread.cpp b/libs/hwui/renderthread/RenderThread.cpp
index 3ac2976..64075f1 100644
--- a/libs/hwui/renderthread/RenderThread.cpp
+++ b/libs/hwui/renderthread/RenderThread.cpp
@@ -144,6 +144,7 @@ RenderThread::RenderThread() : Thread(true), Singleton<RenderThread>()
, mFrameCallbackTask(nullptr)
, mRenderState(nullptr)
, mEglManager(nullptr) {
+ Properties::load();
mFrameCallbackTask = new DispatchFrameCallbacks(this);
mLooper = new Looper(false);
run("RenderThread");