| Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| index 7a1628fc6b835178865826192bd7a0a85530230e..48e03942fe528fda810dc4f41ca3b981aa4ebc77 100644
|
| --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| @@ -5106,14 +5106,17 @@ bool GLES2DecoderImpl::GetHelper(
|
| switch (pname) {
|
| case GL_IMPLEMENTATION_COLOR_READ_FORMAT:
|
| *num_written = 1;
|
| - // Return the GL implementation's preferred format and (see below type)
|
| - // if we have the GL extension that exposes this. This allows the GPU
|
| - // client to use the implementation's preferred format for glReadPixels
|
| - // for optimisation.
|
| + // Return an additional (other than GL_RGBA) read format which the GL
|
| + // implementation supports. If no additional format is available, this
|
| + // function will return GL_RGBA.
|
| //
|
| - // A conflicting extension (GL_ARB_ES2_compatibility) specifies an error
|
| - // case when requested on integer/floating point buffers but which is
|
| - // acceptable on GLES2 and with the GL_OES_read_format extension.
|
| + // If the GL_OES_read_format extension is available, we query GL
|
| + // directly. Otherwise we use our internal implementation.
|
| + //
|
| + // A conflicting extension (GL_ARB_ES2_compatibility) specifies an
|
| + // error case when requested on integer/floating point buffers but
|
| + // which is acceptable on GLES2 and with the GL_OES_read_format
|
| + // extension.
|
| //
|
| // Therefore if an error occurs we swallow the error and use the
|
| // internal implementation.
|
| @@ -5125,8 +5128,9 @@ bool GLES2DecoderImpl::GetHelper(
|
| if (glGetError() == GL_NO_ERROR)
|
| return true;
|
| }
|
| - *params = GLES2Util::GetGLReadPixelsImplementationFormat(
|
| - GetBoundReadFrameBufferInternalFormat());
|
| + *params = GLES2Util::GetGLReadPixelsAdditionalFormat(
|
| + GetBoundReadFrameBufferInternalFormat(),
|
| + GetBoundReadFrameBufferTextureType());
|
| }
|
| return true;
|
| case GL_IMPLEMENTATION_COLOR_READ_TYPE:
|
| @@ -5139,7 +5143,7 @@ bool GLES2DecoderImpl::GetHelper(
|
| if (glGetError() == GL_NO_ERROR)
|
| return true;
|
| }
|
| - *params = GLES2Util::GetGLReadPixelsImplementationType(
|
| + *params = GLES2Util::GetGLReadPixelsTypeForAdditionalFormat(
|
| GetBoundReadFrameBufferInternalFormat(),
|
| GetBoundReadFrameBufferTextureType());
|
| }
|
|
|