Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(378)

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 1759433002: Update GL_IMPLEMENTATION_COLOR_READ_FORMAT for BGRA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove no longer needed check from GLHelperReadbackSupport::SupportsFormat Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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());
}
« gpu/command_buffer/common/gles2_cmd_utils.cc ('K') | « gpu/command_buffer/common/gles2_cmd_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698