From 87e2f757be9b24d369bab354e37c276e851b1fc7 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Mon, 24 Sep 2012 11:37:12 -0700 Subject: Add a property to disable libhwui's scissor optimization Bug #7158326 When scissor optimization is enabled, OpenGLRenderer will attempt to minimize the use of scissor by selectively enabling and disabling the GL scissor test. When the optimization is disabled, OpenGLRenderer will keep the GL scissor test enabled and change the scissor rect as needed. Some GPUs (for instance the SGX 540) perform better when changing the scissor rect often than when enabling/disabling the scissor test often. Change-Id: Idb68862e287a23358f9188d577ae0f86161902fd --- core/jni/android_view_GLES20Canvas.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'core') diff --git a/core/jni/android_view_GLES20Canvas.cpp b/core/jni/android_view_GLES20Canvas.cpp index b91eb28..a3834ac 100644 --- a/core/jni/android_view_GLES20Canvas.cpp +++ b/core/jni/android_view_GLES20Canvas.cpp @@ -116,7 +116,9 @@ static void android_view_GLES20Canvas_terminateCaches(JNIEnv* env, jobject clazz static OpenGLRenderer* android_view_GLES20Canvas_createRenderer(JNIEnv* env, jobject clazz) { RENDERER_LOGD("Create OpenGLRenderer"); - return new OpenGLRenderer; + OpenGLRenderer* renderer = new OpenGLRenderer(); + renderer->initProperties(); + return renderer; } static void android_view_GLES20Canvas_destroyRenderer(JNIEnv* env, jobject clazz, @@ -734,7 +736,9 @@ static void android_view_GLES20Canvas_resume(JNIEnv* env, jobject clazz, static OpenGLRenderer* android_view_GLES20Canvas_createLayerRenderer(JNIEnv* env, jobject clazz, Layer* layer) { if (layer) { - return new LayerRenderer(layer); + OpenGLRenderer* renderer = new LayerRenderer(layer); + renderer->initProperties(); + return renderer; } return NULL; } -- cgit v1.1