diff options
author | John Reck <jreck@google.com> | 2014-05-23 15:11:19 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2014-05-23 15:40:14 -0700 |
commit | e1628b7c6fc3822fa83cf02028ce8ad67abb0afe (patch) | |
tree | 096479f24da83593cab3505bde3aa8688e3b8f10 /core | |
parent | ec41d7ababd3145b7f19e5bd69480e9436cb5c7c (diff) | |
download | frameworks_base-e1628b7c6fc3822fa83cf02028ce8ad67abb0afe.zip frameworks_base-e1628b7c6fc3822fa83cf02028ce8ad67abb0afe.tar.gz frameworks_base-e1628b7c6fc3822fa83cf02028ce8ad67abb0afe.tar.bz2 |
Implement FlushCaches TODO
Change-Id: Id05429e98ffe0858275b32c41fb215c1d8d930b2
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/view/ThreadedRenderer.java | 6 | ||||
-rw-r--r-- | core/jni/android_view_ThreadedRenderer.cpp | 7 |
2 files changed, 10 insertions, 3 deletions
diff --git a/core/java/android/view/ThreadedRenderer.java b/core/java/android/view/ThreadedRenderer.java index 8417887..9c9a939 100644 --- a/core/java/android/view/ThreadedRenderer.java +++ b/core/java/android/view/ThreadedRenderer.java @@ -33,8 +33,6 @@ import java.io.PrintWriter; /** * Hardware renderer that proxies the rendering to a render thread. Most calls * are currently synchronous. - * TODO: Make draw() async. - * TODO: Figure out how to share the DisplayList between two threads (global lock?) * * The UI thread can block on the RenderThread, but RenderThread must never * block on the UI thread. @@ -117,7 +115,7 @@ public class ThreadedRenderer extends HardwareRenderer { @Override void destroyHardwareResources(View view) { destroyResources(view); - // TODO: GLES20Canvas.flushCaches(GLES20Canvas.FLUSH_CACHES_LAYERS); + nFlushCaches(mNativeProxy, GLES20Canvas.FLUSH_CACHES_LAYERS); } private static void destroyResources(View view) { @@ -368,6 +366,8 @@ public class ThreadedRenderer extends HardwareRenderer { private static native boolean nCopyLayerInto(long nativeProxy, long layer, long bitmap); private static native void nDestroyLayer(long nativeProxy, long layer); + private static native void nFlushCaches(long nativeProxy, int flushMode); + private static native void nFence(long nativeProxy); private static native void nNotifyFramePending(long nativeProxy); } diff --git a/core/jni/android_view_ThreadedRenderer.cpp b/core/jni/android_view_ThreadedRenderer.cpp index 5bc0f62..6f256f0 100644 --- a/core/jni/android_view_ThreadedRenderer.cpp +++ b/core/jni/android_view_ThreadedRenderer.cpp @@ -293,6 +293,12 @@ static void android_view_ThreadedRenderer_destroyLayer(JNIEnv* env, jobject claz proxy->destroyLayer(layer); } +static void android_view_ThreadedRenderer_flushCaches(JNIEnv* env, jobject clazz, + jlong proxyPtr, jint flushMode) { + RenderProxy* proxy = reinterpret_cast<RenderProxy*>(proxyPtr); + proxy->flushCaches(static_cast<Caches::FlushMode>(flushMode)); +} + static void android_view_ThreadedRenderer_fence(JNIEnv* env, jobject clazz, jlong proxyPtr) { RenderProxy* proxy = reinterpret_cast<RenderProxy*>(proxyPtr); @@ -334,6 +340,7 @@ static JNINativeMethod gMethods[] = { { "nCreateTextureLayer", "(J)J", (void*) android_view_ThreadedRenderer_createTextureLayer }, { "nCopyLayerInto", "(JJJ)Z", (void*) android_view_ThreadedRenderer_copyLayerInto }, { "nDestroyLayer", "(JJ)V", (void*) android_view_ThreadedRenderer_destroyLayer }, + { "nFlushCaches", "(JI)V", (void*) android_view_ThreadedRenderer_flushCaches }, { "nFence", "(J)V", (void*) android_view_ThreadedRenderer_fence }, { "nNotifyFramePending", "(J)V", (void*) android_view_ThreadedRenderer_notifyFramePending }, #endif |