Add glReadPixels with buffer-offset argument

- For reading into PBOs on GLES3, add an overloaded version of
  glReadPixels that takes an offset argument.

Bug 18878609

Change-Id: I744483deab6358a66b0dc5e87be1ae2b96560ac1
This commit is contained in:
Pablo Ceballos
2016-02-22 11:50:31 -08:00
parent de1eaab7f7
commit 68981ff03b
5 changed files with 31 additions and 0 deletions

View File

@@ -26851,6 +26851,7 @@ package android.opengl {
method public static void glProgramBinary(int, int, java.nio.Buffer, int);
method public static void glProgramParameteri(int, int, int);
method public static void glReadBuffer(int);
method public static void glReadPixels(int, int, int, int, int, int, int);
method public static void glRenderbufferStorageMultisample(int, int, int, int, int);
method public static void glResumeTransformFeedback();
method public static void glSamplerParameterf(int, int, float);

View File

@@ -29143,6 +29143,7 @@ package android.opengl {
method public static void glProgramBinary(int, int, java.nio.Buffer, int);
method public static void glProgramParameteri(int, int, int);
method public static void glReadBuffer(int);
method public static void glReadPixels(int, int, int, int, int, int, int);
method public static void glRenderbufferStorageMultisample(int, int, int, int, int);
method public static void glResumeTransformFeedback();
method public static void glSamplerParameterf(int, int, float);

View File

@@ -26860,6 +26860,7 @@ package android.opengl {
method public static void glProgramBinary(int, int, java.nio.Buffer, int);
method public static void glProgramParameteri(int, int, int);
method public static void glReadBuffer(int);
method public static void glReadPixels(int, int, int, int, int, int, int);
method public static void glRenderbufferStorageMultisample(int, int, int, int, int);
method public static void glResumeTransformFeedback();
method public static void glSamplerParameterf(int, int, float);

View File

@@ -5155,6 +5155,21 @@ android_glGetInternalformativ__IIIILjava_nio_IntBuffer_2
}
}
/* void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint offset ) */
static void
android_glReadPixels__IIIIIII
(JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height, jint format, jint type, jint offset) {
glReadPixels(
(GLint)x,
(GLint)y,
(GLsizei)width,
(GLsizei)height,
(GLenum)format,
(GLenum)type,
reinterpret_cast<GLvoid *>(offset)
);
}
static const char *classPathName = "android/opengl/GLES30";
static const JNINativeMethod methods[] = {
@@ -5320,6 +5335,7 @@ static const JNINativeMethod methods[] = {
{"glTexStorage3D", "(IIIIII)V", (void *) android_glTexStorage3D__IIIIII },
{"glGetInternalformativ", "(IIII[II)V", (void *) android_glGetInternalformativ__IIII_3II },
{"glGetInternalformativ", "(IIIILjava/nio/IntBuffer;)V", (void *) android_glGetInternalformativ__IIIILjava_nio_IntBuffer_2 },
{"glReadPixels", "(IIIIIII)V", (void *) android_glReadPixels__IIIIIII },
};
int register_android_opengl_jni_GLES30(JNIEnv *_env)

View File

@@ -1791,4 +1791,16 @@ public class GLES30 extends GLES20 {
java.nio.IntBuffer params
);
// C function void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint offset )
public static native void glReadPixels(
int x,
int y,
int width,
int height,
int format,
int type,
int offset
);
}