diff options
author | Chet Haase <chet@google.com> | 2012-03-21 18:54:18 -0700 |
---|---|---|
committer | Chet Haase <chet@google.com> | 2012-04-03 14:02:17 -0700 |
commit | db8c9a6a4d9bf8c39f834b25611926caf21380f6 (patch) | |
tree | 5a1ef2e49ea05c5a28477fcf8525ca66e8e31890 /core/jni/android_view_GLES20DisplayList.cpp | |
parent | b3fa3960a03ef553e58bf1add88029a6c072c6b6 (diff) | |
download | frameworks_base-db8c9a6a4d9bf8c39f834b25611926caf21380f6.zip frameworks_base-db8c9a6a4d9bf8c39f834b25611926caf21380f6.tar.gz frameworks_base-db8c9a6a4d9bf8c39f834b25611926caf21380f6.tar.bz2 |
Optimization of alpha with DisplayList properties
Some views (such as ImageView and TextView) handle non-opaque alpha
values directly. This was originally an optimization, but we can handle it faster
in many cases without this optimization when DisplayList properties are enabled.
Basically, if a view has non-overlapping rendering, we set the alpha value directly
on the renderer (the equivalent of setting it on the Paint object) and draw each
primitive with that alpha value. Doing it this way avoids re-creating DisplayLists
while getting the same speedup that onSetAlpha() used to get pre-DisplayList properties.
Change-Id: I0f7827f075d3b35093a882d4adbb300a1063c288
Diffstat (limited to 'core/jni/android_view_GLES20DisplayList.cpp')
-rw-r--r-- | core/jni/android_view_GLES20DisplayList.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/jni/android_view_GLES20DisplayList.cpp b/core/jni/android_view_GLES20DisplayList.cpp index 60fb6d4..b307a2f 100644 --- a/core/jni/android_view_GLES20DisplayList.cpp +++ b/core/jni/android_view_GLES20DisplayList.cpp @@ -65,6 +65,11 @@ static void android_view_GLES20DisplayList_setAlpha(JNIEnv* env, displayList->setAlpha(alpha); } +static void android_view_GLES20DisplayList_setHasOverlappingRendering(JNIEnv* env, + jobject clazz, DisplayList* displayList, bool hasOverlappingRendering) { + displayList->setHasOverlappingRendering(hasOverlappingRendering); +} + static void android_view_GLES20DisplayList_setTranslationX(JNIEnv* env, jobject clazz, DisplayList* displayList, float tx) { displayList->setTranslationX(tx); @@ -185,6 +190,8 @@ static JNINativeMethod gMethods[] = { { "nSetAnimationMatrix", "(II)V", (void*) android_view_GLES20DisplayList_setAnimationMatrix }, { "nSetClipChildren", "(IZ)V", (void*) android_view_GLES20DisplayList_setClipChildren }, { "nSetAlpha", "(IF)V", (void*) android_view_GLES20DisplayList_setAlpha }, + { "nSetHasOverlappingRendering", "(IZ)V", + (void*) android_view_GLES20DisplayList_setHasOverlappingRendering }, { "nSetTranslationX", "(IF)V", (void*) android_view_GLES20DisplayList_setTranslationX }, { "nSetTranslationY", "(IF)V", (void*) android_view_GLES20DisplayList_setTranslationY }, { "nSetRotation", "(IF)V", (void*) android_view_GLES20DisplayList_setRotation }, |