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

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

Issue 1308313008: Fix ReadPixels implementation specific read format/type on desktop GL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@clear
Patch Set: Created 5 years, 4 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 aba7a6e415c929132f81b55b37fbacca115bb33e..d41bbeec5dd4a187c28c53bc48d66974d233b992 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -5068,7 +5068,7 @@ bool GLES2DecoderImpl::GetHelper(
if (glGetError() == GL_NO_ERROR)
return true;
}
- *params = GLES2Util::GetPreferredGLReadPixelsFormat(
+ *params = GLES2Util::GetGLReadPixelsImplementationFormat(
GetBoundReadFrameBufferInternalFormat());
}
return true;
@@ -5082,7 +5082,7 @@ bool GLES2DecoderImpl::GetHelper(
if (glGetError() == GL_NO_ERROR)
return true;
}
- *params = GLES2Util::GetPreferredGLReadPixelsType(
+ *params = GLES2Util::GetGLReadPixelsImplementationType(
GetBoundReadFrameBufferInternalFormat(),
GetBoundReadFrameBufferTextureType());
}
@@ -8754,9 +8754,6 @@ error::Error GLES2DecoderImpl::HandleReadPixels(uint32 immediate_data_size,
std::vector<GLenum> accepted_formats;
std::vector<GLenum> accepted_types;
switch (src_internal_format) {
- case GL_RGB10_A2UI:
- accepted_formats.push_back(GL_RGBA);
- accepted_types.push_back(GL_UNSIGNED_INT_2_10_10_10_REV);
case GL_R8UI:
case GL_R16UI:
case GL_R32UI:
@@ -8765,6 +8762,7 @@ error::Error GLES2DecoderImpl::HandleReadPixels(uint32 immediate_data_size,
case GL_RG32UI:
// All the RGB_INTEGER formats are not renderable.
case GL_RGBA8UI:
+ case GL_RGB10_A2UI:
case GL_RGBA16UI:
case GL_RGBA32UI:
accepted_formats.push_back(GL_RGBA_INTEGER);
@@ -8782,6 +8780,13 @@ error::Error GLES2DecoderImpl::HandleReadPixels(uint32 immediate_data_size,
accepted_formats.push_back(GL_RGBA_INTEGER);
accepted_types.push_back(GL_INT);
break;
+ case GL_RGB10_A2:
+ accepted_formats.push_back(GL_RGBA);
+ accepted_types.push_back(GL_UNSIGNED_BYTE);
+ // Special case with an extra supported format/type.
+ accepted_formats.push_back(GL_RGBA);
+ accepted_types.push_back(GL_UNSIGNED_INT_2_10_10_10_REV);
+ break;
default:
accepted_formats.push_back(GL_RGBA);
{
@@ -8791,7 +8796,11 @@ error::Error GLES2DecoderImpl::HandleReadPixels(uint32 immediate_data_size,
case GL_HALF_FLOAT_OES:
case GL_FLOAT:
case GL_UNSIGNED_INT_10F_11F_11F_REV:
- accepted_types.push_back(GL_FLOAT);
+ if (!feature_info_->IsES3Enabled()) {
+ accepted_types.push_back(GL_UNSIGNED_BYTE);
+ } else {
+ accepted_types.push_back(GL_FLOAT);
+ }
break;
default:
accepted_types.push_back(GL_UNSIGNED_BYTE);

Powered by Google App Engine
This is Rietveld 408576698