diff options
author | Chet Haase <chet@google.com> | 2011-01-05 18:01:22 -0800 |
---|---|---|
committer | Chet Haase <chet@google.com> | 2011-01-06 12:50:30 -0800 |
commit | 5977baa1fa24125c148a72699b53e62abaf08960 (patch) | |
tree | 17d30311c2db05787275345e132fb42692e9a08f /core/jni | |
parent | 42edf0f8cf8ca85dd5010558ff399e2c9a4c779c (diff) | |
download | frameworks_base-5977baa1fa24125c148a72699b53e62abaf08960.zip frameworks_base-5977baa1fa24125c148a72699b53e62abaf08960.tar.gz frameworks_base-5977baa1fa24125c148a72699b53e62abaf08960.tar.bz2 |
Reuse of native display list objects
Change-Id: Ia4553e23930ad20e56c11faa7809be788a1ad4bb
Diffstat (limited to 'core/jni')
-rw-r--r-- | core/jni/android_view_GLES20Canvas.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/core/jni/android_view_GLES20Canvas.cpp b/core/jni/android_view_GLES20Canvas.cpp index c3d3572..b4c868f 100644 --- a/core/jni/android_view_GLES20Canvas.cpp +++ b/core/jni/android_view_GLES20Canvas.cpp @@ -417,16 +417,21 @@ static void android_view_GLES20Canvas_drawTextRun(JNIEnv* env, jobject canvas, // Display lists // ---------------------------------------------------------------------------- -static OpenGLRenderer* android_view_GLES20Canvas_createDisplayListRenderer( - JNIEnv* env, jobject canvas) { - return new DisplayListRenderer; -} - -static DisplayList* android_view_GLES20Canvas_createDisplayList(JNIEnv* env, +static DisplayList* android_view_GLES20Canvas_getDisplayList(JNIEnv* env, jobject canvas, DisplayListRenderer* renderer) { return renderer->getDisplayList(); } +static OpenGLRenderer* android_view_GLES20Canvas_getDisplayListRenderer(JNIEnv* env, + jobject clazz, DisplayListRenderer* renderer) { + if (renderer == NULL) { + renderer = new DisplayListRenderer; + } else { + renderer->reset(); + } + return renderer; +} + static void android_view_GLES20Canvas_destroyDisplayList(JNIEnv* env, jobject clazz, DisplayList* displayList) { delete displayList; @@ -517,9 +522,9 @@ static JNINativeMethod gMethods[] = { { "nGetClipBounds", "(ILandroid/graphics/Rect;)Z", (void*) android_view_GLES20Canvas_getClipBounds }, - { "nCreateDisplayListRenderer", "()I", (void*) android_view_GLES20Canvas_createDisplayListRenderer }, - { "nCreateDisplayList", "(I)I", (void*) android_view_GLES20Canvas_createDisplayList }, + { "nGetDisplayList", "(I)I", (void*) android_view_GLES20Canvas_getDisplayList }, { "nDestroyDisplayList", "(I)V", (void*) android_view_GLES20Canvas_destroyDisplayList }, + { "nGetDisplayListRenderer", "(I)I", (void*) android_view_GLES20Canvas_getDisplayListRenderer }, { "nDrawDisplayList", "(II)V", (void*) android_view_GLES20Canvas_drawDisplayList }, #endif |