diff options
author | Jorim Jaggi <jjaggi@google.com> | 2016-07-21 18:03:14 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-07-21 18:03:14 +0000 |
commit | 90a714cad1dac6fd2cfe3d2d51882d26c32a8d94 (patch) | |
tree | 846f604a4003bba7c7f9f3f7c80e497462d98ed9 | |
parent | 031ae431ea736cd4e4e812dfedfc1cea3221db8a (diff) | |
parent | ee129dc3b72eea30b620b791a58071af1b0eb0da (diff) | |
download | libgdx-90a714cad1dac6fd2cfe3d2d51882d26c32a8d94.tar.gz |
Put GPU priority to low for all rendering contexts
am: ee129dc3b7
Change-Id: I13875fd155762e071d9f197d0a591c3648d96f79
3 files changed, 12 insertions, 3 deletions
diff --git a/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/surfaceview/GLSurfaceView20.java b/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/surfaceview/GLSurfaceView20.java index 32ba11f95..ce924e289 100644 --- a/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/surfaceview/GLSurfaceView20.java +++ b/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/surfaceview/GLSurfaceView20.java @@ -44,6 +44,9 @@ public class GLSurfaceView20 extends GLSurfaceView { static String TAG = "GL2JNIView";
private static final boolean DEBUG = false;
+ final static int EGL_CONTEXT_PRIORITY_LEVEL_IMG = 0x3100;
+ final static int EGL_CONTEXT_PRIORITY_LOW_IMG = 0x3103;
+
final ResolutionStrategy resolutionStrategy;
static int targetGLESVersion;
@@ -140,7 +143,8 @@ public class GLSurfaceView20 extends GLSurfaceView { public EGLContext createContext (EGL10 egl, EGLDisplay display, EGLConfig eglConfig) {
Log.w(TAG, "creating OpenGL ES " + GLSurfaceView20.targetGLESVersion + ".0 context");
checkEglError("Before eglCreateContext "+targetGLESVersion, egl);
- int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, GLSurfaceView20.targetGLESVersion, EGL10.EGL_NONE};
+ int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, GLSurfaceView20.targetGLESVersion,
+ EGL_CONTEXT_PRIORITY_LEVEL_IMG, EGL_CONTEXT_PRIORITY_LOW_IMG, EGL10.EGL_NONE};
EGLContext context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list);
boolean success = checkEglError("After eglCreateContext "+targetGLESVersion, egl);
diff --git a/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/surfaceview/GLSurfaceView20API18.java b/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/surfaceview/GLSurfaceView20API18.java index b1239cea8..84a456a2b 100644 --- a/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/surfaceview/GLSurfaceView20API18.java +++ b/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/surfaceview/GLSurfaceView20API18.java @@ -135,7 +135,9 @@ public class GLSurfaceView20API18 extends GLSurfaceViewAPI18 { public EGLContext createContext (EGL10 egl, EGLDisplay display, EGLConfig eglConfig) { Log.w(TAG, "creating OpenGL ES 2.0 context"); checkEglError("Before eglCreateContext", egl); - int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE}; + int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, + GLSurfaceView20.EGL_CONTEXT_PRIORITY_LEVEL_IMG, GLSurfaceView20.EGL_CONTEXT_PRIORITY_LOW_IMG, + EGL10.EGL_NONE}; EGLContext context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list); checkEglError("After eglCreateContext", egl); return context; diff --git a/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/surfaceview/GLSurfaceViewAPI18.java b/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/surfaceview/GLSurfaceViewAPI18.java index dfac62a15..58d130bd6 100644 --- a/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/surfaceview/GLSurfaceViewAPI18.java +++ b/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/surfaceview/GLSurfaceViewAPI18.java @@ -778,8 +778,11 @@ public class GLSurfaceViewAPI18 extends SurfaceView implements SurfaceHolder.Cal private int EGL_CONTEXT_CLIENT_VERSION = 0x3098; public EGLContext createContext(EGL10 egl, EGLDisplay display, EGLConfig config) { + final int EGL_CONTEXT_PRIORITY_LEVEL_IMG = 0x3100; + final int EGL_CONTEXT_PRIORITY_LOW_IMG = 0x3103; int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, mEGLContextClientVersion, - EGL10.EGL_NONE }; + GLSurfaceView20.EGL_CONTEXT_PRIORITY_LEVEL_IMG, GLSurfaceView20.EGL_CONTEXT_PRIORITY_LOW_IMG, + EGL10.EGL_NONE}; return egl.eglCreateContext(display, config, EGL10.EGL_NO_CONTEXT, mEGLContextClientVersion != 0 ? attrib_list : null); |