diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2018-04-22 07:23:52 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2018-04-22 07:23:52 +0000 |
commit | 61313c3b6b8ed3bb31170f3cf7d9e1126c1bc791 (patch) | |
tree | 54aeda0b3c6e394ac3ebd2abb1860c024ee23aa4 | |
parent | 90ef09fe5571ff672118aefec982fed0b0f4669f (diff) | |
parent | 93eee36521f0e34a823faad4e5570662042baedd (diff) | |
download | goldfish-opengl-61313c3b6b8ed3bb31170f3cf7d9e1126c1bc791.tar.gz |
Snap for 4736748 from 93eee36521f0e34a823faad4e5570662042baedd to pi-release
Change-Id: I3b54649c84d71b5332defaff72e0aff52be31ac8
-rw-r--r-- | system/GLESv1/gl.cpp | 2 | ||||
-rw-r--r-- | system/GLESv2/gl2.cpp | 2 | ||||
-rwxr-xr-x | system/GLESv2_enc/GL2Encoder.cpp | 3 | ||||
-rw-r--r-- | system/egl/egl.cpp | 2 | ||||
-rw-r--r-- | system/gralloc/gralloc.cpp | 8 |
5 files changed, 12 insertions, 5 deletions
diff --git a/system/GLESv1/gl.cpp b/system/GLESv1/gl.cpp index e20b45d8..2020a725 100644 --- a/system/GLESv1/gl.cpp +++ b/system/GLESv1/gl.cpp @@ -94,7 +94,7 @@ void glEGLImageTargetRenderbufferStorageOES(void *self, GLenum target, GLeglImag DBG("glEGLImageTargetRenderbufferStorageOES v1 target=%#x image=%p", target, image); //TODO: check error - we don't have a way to set gl error - android_native_buffer_t* native_buffer = (android_native_buffer_t*)image; + android_native_buffer_t* native_buffer = ((EGLImage_t*)image)->native_buffer; if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC) { return; diff --git a/system/GLESv2/gl2.cpp b/system/GLESv2/gl2.cpp index b75f899d..283bd95f 100644 --- a/system/GLESv2/gl2.cpp +++ b/system/GLESv2/gl2.cpp @@ -95,7 +95,7 @@ void glEGLImageTargetRenderbufferStorageOES(void *self, GLenum target, GLeglImag DBG("glEGLImageTargetRenderbufferStorageOES v2 image=%p\n", image); //TODO: check error - we don't have a way to set gl error - android_native_buffer_t* native_buffer = (android_native_buffer_t*)image; + android_native_buffer_t* native_buffer = ((EGLImage_t*)image)->native_buffer; if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC) { return; diff --git a/system/GLESv2_enc/GL2Encoder.cpp b/system/GLESv2_enc/GL2Encoder.cpp index 614622c7..dd4f6580 100755 --- a/system/GLESv2_enc/GL2Encoder.cpp +++ b/system/GLESv2_enc/GL2Encoder.cpp @@ -4217,7 +4217,8 @@ void GL2Encoder::s_glGenerateMipmap(void* self, GLenum target) { SET_ERROR_IF(target != GL_TEXTURE_2D && target != GL_TEXTURE_3D && - target != GL_TEXTURE_CUBE_MAP, + target != GL_TEXTURE_CUBE_MAP && + target != GL_TEXTURE_2D_ARRAY, GL_INVALID_ENUM); GLuint tex = state->getBoundTexture(target); diff --git a/system/egl/egl.cpp b/system/egl/egl.cpp index 79831a3d..395deadc 100644 --- a/system/egl/egl.cpp +++ b/system/egl/egl.cpp @@ -1969,6 +1969,8 @@ EGLImageKHR eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, EG case HAL_PIXEL_FORMAT_RGB_565: case HAL_PIXEL_FORMAT_YV12: case HAL_PIXEL_FORMAT_BGRA_8888: + case HAL_PIXEL_FORMAT_RGBA_FP16: + case HAL_PIXEL_FORMAT_RGBA_1010102: break; default: setErrorReturn(EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR); diff --git a/system/gralloc/gralloc.cpp b/system/gralloc/gralloc.cpp index 9569d344..ddae86a4 100644 --- a/system/gralloc/gralloc.cpp +++ b/system/gralloc/gralloc.cpp @@ -510,12 +510,12 @@ static int gralloc_alloc(alloc_device_t* dev, int align = 1; switch (format) { case HAL_PIXEL_FORMAT_RGBA_8888: - case HAL_PIXEL_FORMAT_RGBX_8888: case HAL_PIXEL_FORMAT_BGRA_8888: bpp = 4; glFormat = GL_RGBA; glType = GL_UNSIGNED_BYTE; break; + case HAL_PIXEL_FORMAT_RGBX_8888: case HAL_PIXEL_FORMAT_RGB_888: bpp = 3; glFormat = GL_RGB; @@ -1174,8 +1174,12 @@ static int gralloc_lock(gralloc_module_t const* module, } D("gralloc_lock read back color buffer %d %d ashmem base %p sz %d\n", cb->width, cb->height, cb->ashmemBase, cb->ashmemSize); + GLenum readbackFormat = cb->glFormat; + if (cb->format == HAL_PIXEL_FORMAT_RGBX_8888) { + readbackFormat = GL_RGBA; + } rcEnc->rcReadColorBuffer(rcEnc, cb->hostHandle, - 0, 0, cb->width, cb->height, cb->glFormat, cb->glType, rgb_addr); + 0, 0, cb->width, cb->height, readbackFormat, cb->glType, rgb_addr); if (tmpBuf) { if (cb->frameworkFormat == HAL_PIXEL_FORMAT_YV12) { rgb888_to_yv12((char*)cpu_addr, tmpBuf, cb->width, cb->height, l, t, l+w-1, t+h-1); |