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 992ad25f100b7d5cf2fd7f3381e741acfe19b34e..7ac9c6be8eb5e4aef868a5bc285871a3db346090 100644 |
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc |
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
@@ -16425,6 +16425,15 @@ CopyTextureMethod GLES2DecoderImpl::getCopyTextureCHROMIUMMethod( |
Texture::ColorRenderable(GetFeatureInfo(), dest_internal_format, false); |
std::string output_error_msg; |
+ // TODO(qiankun.miao@intel.com): remove this hacking once the issue in |
+ // https://codereview.chromium.org/2711903002/ is fixed. |
+ // Make sure source_type has value for unsized source internalformat. |
+ if (!GLES2Util::IsSizedColorFormat(source_internal_format) && !source_type) { |
+ source_type = |
+ TextureManager::ExtractTypeFromStorageFormat(source_internal_format); |
+ } |
+ DCHECK(GLES2Util::IsSizedColorFormat(source_internal_format) || source_type); |
+ |
// CopyTexImage* should not allow internalformat of GL_BGRA_EXT and |
// GL_BGRA8_EXT. crbug.com/663086. |
bool copy_tex_image_format_valid = |