summaryrefslogtreecommitdiffstats
path: root/core/jni
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2015-05-04 14:36:49 -0700
committerChris Craik <ccraik@google.com>2015-05-05 10:36:09 -0700
commit2507c34d91bb0d722b6012e85cb47387b2aa6873 (patch)
treeff515c6827fb20c904ee1af7e551144c46ba3385 /core/jni
parent57436d3f7e7fca99400a9b90e93491e892d135ae (diff)
downloadframeworks_base-2507c34d91bb0d722b6012e85cb47387b2aa6873.zip
frameworks_base-2507c34d91bb0d722b6012e85cb47387b2aa6873.tar.gz
frameworks_base-2507c34d91bb0d722b6012e85cb47387b2aa6873.tar.bz2
Cleanup properties
bug:19967854 Separate properties from Caches, into static, RenderThread-only class. Also rewrites the means for java to set properties to correctly handle threading, and adds an override for profile bars so that SysUi doesn't clutter the screen with them. Change-Id: I6e21a96065f52b9ecc49d1a126244804ba106fa9
Diffstat (limited to 'core/jni')
-rw-r--r--core/jni/android_view_DisplayListCanvas.cpp20
-rw-r--r--core/jni/android_view_ThreadedRenderer.cpp10
2 files changed, 10 insertions, 20 deletions
diff --git a/core/jni/android_view_DisplayListCanvas.cpp b/core/jni/android_view_DisplayListCanvas.cpp
index 39449b0..bb8ef83 100644
--- a/core/jni/android_view_DisplayListCanvas.cpp
+++ b/core/jni/android_view_DisplayListCanvas.cpp
@@ -86,24 +86,6 @@ static void android_view_DisplayListCanvas_finish(JNIEnv* env, jobject clazz,
renderer->finish();
}
-static void android_view_DisplayListCanvas_setProperty(JNIEnv* env,
- jobject clazz, jstring name, jstring value) {
- if (!Caches::hasInstance()) {
- ALOGW("can't set property, no Caches instance");
- return;
- }
-
- if (name == NULL || value == NULL) {
- ALOGW("can't set prop, null passed");
- }
-
- const char* nameCharArray = env->GetStringUTFChars(name, NULL);
- const char* valueCharArray = env->GetStringUTFChars(value, NULL);
- Caches::getInstance().setTempProperty(nameCharArray, valueCharArray);
- env->ReleaseStringUTFChars(name, nameCharArray);
- env->ReleaseStringUTFChars(name, valueCharArray);
-}
-
// ----------------------------------------------------------------------------
// Functor
// ----------------------------------------------------------------------------
@@ -268,8 +250,6 @@ static JNINativeMethod gMethods[] = {
{ "nPrepare", "(J)V", (void*) android_view_DisplayListCanvas_prepare },
{ "nPrepareDirty", "(JIIII)V", (void*) android_view_DisplayListCanvas_prepareDirty },
{ "nFinish", "(J)V", (void*) android_view_DisplayListCanvas_finish },
- { "nSetProperty", "(Ljava/lang/String;Ljava/lang/String;)V",
- (void*) android_view_DisplayListCanvas_setProperty },
{ "nCallDrawGLFunction", "(JJ)V", (void*) android_view_DisplayListCanvas_callDrawGLFunction },
diff --git a/core/jni/android_view_ThreadedRenderer.cpp b/core/jni/android_view_ThreadedRenderer.cpp
index 4ccbb41..5d5465b 100644
--- a/core/jni/android_view_ThreadedRenderer.cpp
+++ b/core/jni/android_view_ThreadedRenderer.cpp
@@ -388,6 +388,15 @@ static void android_view_ThreadedRenderer_trimMemory(JNIEnv* env, jobject clazz,
RenderProxy::trimMemory(level);
}
+static void android_view_ThreadedRenderer_overrideProperty(JNIEnv* env, jobject clazz,
+ jstring name, jstring value) {
+ const char* nameCharArray = env->GetStringUTFChars(name, NULL);
+ const char* valueCharArray = env->GetStringUTFChars(value, NULL);
+ RenderProxy::overrideProperty(nameCharArray, valueCharArray);
+ env->ReleaseStringUTFChars(name, nameCharArray);
+ env->ReleaseStringUTFChars(name, valueCharArray);
+}
+
static void android_view_ThreadedRenderer_fence(JNIEnv* env, jobject clazz,
jlong proxyPtr) {
RenderProxy* proxy = reinterpret_cast<RenderProxy*>(proxyPtr);
@@ -466,6 +475,7 @@ static JNINativeMethod gMethods[] = {
{ "nDetachSurfaceTexture", "(JJ)V", (void*) android_view_ThreadedRenderer_detachSurfaceTexture },
{ "nDestroyHardwareResources", "(J)V", (void*) android_view_ThreadedRenderer_destroyHardwareResources },
{ "nTrimMemory", "(I)V", (void*) android_view_ThreadedRenderer_trimMemory },
+ { "nOverrideProperty", "(Ljava/lang/String;Ljava/lang/String;)V", (void*) android_view_ThreadedRenderer_overrideProperty },
{ "nFence", "(J)V", (void*) android_view_ThreadedRenderer_fence },
{ "nStopDrawing", "(J)V", (void*) android_view_ThreadedRenderer_stopDrawing },
{ "nNotifyFramePending", "(J)V", (void*) android_view_ThreadedRenderer_notifyFramePending },