diff options
author | Mathias Agopian <mathias@google.com> | 2010-10-20 21:28:29 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-10-20 21:28:29 -0700 |
commit | 4ceee5a6b0089ffbec75690b7284f80d481ab212 (patch) | |
tree | a78e3fcb15f5aa8170e6b937049840dcb0cdde7c /libs/rs | |
parent | fb31036fd844444c395a2ae9c97439eec9f774e4 (diff) | |
parent | 73655bd2d303f8b3fe5c4bb0d8e4824361647381 (diff) | |
download | frameworks_base-4ceee5a6b0089ffbec75690b7284f80d481ab212.zip frameworks_base-4ceee5a6b0089ffbec75690b7284f80d481ab212.tar.gz frameworks_base-4ceee5a6b0089ffbec75690b7284f80d481ab212.tar.bz2 |
am 73655bd2: Merge "propagate RS context priority to EGLContext when possible. DO NOT MERGE." into gingerbread
Merge commit '73655bd2d303f8b3fe5c4bb0d8e4824361647381' into gingerbread-plus-aosp
* commit '73655bd2d303f8b3fe5c4bb0d8e4824361647381':
propagate RS context priority to EGLContext when possible. DO NOT MERGE.
Diffstat (limited to 'libs/rs')
-rw-r--r-- | libs/rs/Android.mk | 3 | ||||
-rw-r--r-- | libs/rs/rsContext.cpp | 14 |
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)); |