summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2010-10-20 20:04:52 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-10-20 20:04:52 -0700
commit73655bd2d303f8b3fe5c4bb0d8e4824361647381 (patch)
treeb994cf8a574010ef0b51c58d9e1f6ffee941bf57 /libs
parent583fefc8dcadecc7fc933513d3569dd9c16c100c (diff)
parent2db76167b17262aa3e341cbc85c949d119a14aa6 (diff)
downloadframeworks_base-73655bd2d303f8b3fe5c4bb0d8e4824361647381.zip
frameworks_base-73655bd2d303f8b3fe5c4bb0d8e4824361647381.tar.gz
frameworks_base-73655bd2d303f8b3fe5c4bb0d8e4824361647381.tar.bz2
Merge "propagate RS context priority to EGLContext when possible. DO NOT MERGE." into gingerbread
Diffstat (limited to 'libs')
-rw-r--r--libs/rs/Android.mk3
-rw-r--r--libs/rs/rsContext.cpp14
2 files changed, 16 insertions, 1 deletions
diff --git a/libs/rs/Android.mk b/libs/rs/Android.mk
index 98464a0..6f2cd07 100644
--- a/libs/rs/Android.mk
+++ b/libs/rs/Android.mk
@@ -102,6 +102,9 @@ LOCAL_SRC_FILES:= \
rsType.cpp \
rsVertexArray.cpp
+ifeq ($(TARGET_BOARD_PLATFORM), s5pc110)
+ LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY
+endif
LOCAL_SHARED_LIBRARIES += libcutils libutils libEGL libGLESv1_CM libGLESv2 libui libacc
LOCAL_LDLIBS := -lpthread -ldl
diff --git a/libs/rs/rsContext.cpp b/libs/rs/rsContext.cpp
index 596f533..92c6619 100644
--- a/libs/rs/rsContext.cpp
+++ b/libs/rs/rsContext.cpp
@@ -26,6 +26,7 @@
#include <cutils/properties.h>
+#include <EGL/eglext.h>
#include <GLES/gl.h>
#include <GLES/glext.h>
#include <GLES2/gl2.h>
@@ -58,7 +59,18 @@ void Context::initEGL(bool useGL2)
mEGL.mNumConfigs = -1;
EGLint configAttribs[128];
EGLint *configAttribsPtr = configAttribs;
- EGLint context_attribs2[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE };
+ EGLint context_attribs2[] = { EGL_CONTEXT_CLIENT_VERSION, 2,
+ EGL_NONE, GL_NONE, EGL_NONE };
+
+#ifdef HAS_CONTEXT_PRIORITY
+#ifdef EGL_IMG_context_priority
+#warning "using EGL_IMG_context_priority"
+ if (mThreadPriority > 0) {
+ context_attribs2[2] = EGL_CONTEXT_PRIORITY_LEVEL_IMG;
+ context_attribs2[3] = EGL_CONTEXT_PRIORITY_LOW_IMG;
+ }
+#endif
+#endif
memset(configAttribs, 0, sizeof(configAttribs));