Index: gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc |
diff --git a/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc b/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc |
index 8b53d0f4c402449b60fab2c23a0e1b514bb7307d..e6e3035c9e868ccbd11a5107ad5e919d9d4fca64 100644 |
--- a/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc |
+++ b/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc |
@@ -473,6 +473,14 @@ void CopyTextureCHROMIUMResourceManager::DoCopySubTexture( |
bool flip_y, |
bool premultiply_alpha, |
bool unpremultiply_alpha) { |
+ bool use_gl_copy_tex_sub_image_2d = true; |
+#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) |
+ // glDrawArrays is faster than glCopyTexSubImage2D on IA Mesa driver, |
+ // although opposite in Android. |
+ // TODO(dshwang): After Mesa fixes this issue, remove this hack. |
+ // https://bugs.freedesktop.org/show_bug.cgi?id=98478 crbug.com/535198 |
+ use_gl_copy_tex_sub_image_2d = false; |
+#endif |
bool premultiply_alpha_change = premultiply_alpha ^ unpremultiply_alpha; |
// GL_INVALID_OPERATION is generated if the currently bound framebuffer's |
// format does not contain a superset of the components required by the base |
@@ -484,8 +492,8 @@ void CopyTextureCHROMIUMResourceManager::DoCopySubTexture( |
(source_internal_format == GL_RGBA && dest_internal_format == GL_RGB); |
// GL_TEXTURE_RECTANGLE_ARB on FBO is supported by OpenGL, not GLES2, |
// so restrict this to GL_TEXTURE_2D. |
- if (source_target == GL_TEXTURE_2D && dest_target == GL_TEXTURE_2D && |
- !flip_y && !premultiply_alpha_change && |
+ if (use_gl_copy_tex_sub_image_2d && source_target == GL_TEXTURE_2D && |
+ dest_target == GL_TEXTURE_2D && !flip_y && !premultiply_alpha_change && |
source_format_contain_superset_of_dest_format) { |
DoCopyTexSubImage2D(decoder, source_target, source_id, dest_target, dest_id, |
xoffset, yoffset, x, y, width, height, framebuffer_); |