Index: gpu/command_buffer/service/texture_manager.cc |
diff --git a/gpu/command_buffer/service/texture_manager.cc b/gpu/command_buffer/service/texture_manager.cc |
index 68cd6bf3e182ae549100085bb16a2ca101962ac9..3a655827f75efa7ac3312f866295dc400fda5642 100644 |
--- a/gpu/command_buffer/service/texture_manager.cc |
+++ b/gpu/command_buffer/service/texture_manager.cc |
@@ -395,6 +395,24 @@ class ScopedResetPixelUnpackBuffer{ |
} // namespace anonymous |
+DecoderTextureState::DecoderTextureState( |
+ const GpuDriverBugWorkarounds& workarounds) |
+ : tex_image_failed(false), |
+ texture_upload_count(0), |
+ texsubimage_faster_than_teximage( |
+ workarounds.texsubimage_faster_than_teximage), |
+ force_cube_map_positive_x_allocation( |
+ workarounds.force_cube_map_positive_x_allocation), |
+ force_cube_complete(workarounds.force_cube_complete), |
+ force_int_or_srgb_cube_texture_complete( |
+ workarounds.force_int_or_srgb_cube_texture_complete), |
+ unpack_alignment_workaround_with_unpack_buffer( |
+ workarounds.unpack_alignment_workaround_with_unpack_buffer), |
+ unpack_overlapping_rows_separately_unpack_buffer( |
+ workarounds.unpack_overlapping_rows_separately_unpack_buffer), |
+ unpack_image_height_workaround_with_unpack_buffer( |
+ workarounds.unpack_image_height_workaround_with_unpack_buffer) {} |
+ |
TextureManager::DestructionObserver::DestructionObserver() {} |
TextureManager::DestructionObserver::~DestructionObserver() {} |
@@ -2527,7 +2545,8 @@ void TextureManager::DoCubeMapWorkaround( |
std::vector<GLenum> undefined_faces; |
Texture* texture = texture_ref->texture(); |
- if (texture_state->force_cube_complete) { |
+ if (texture_state->force_cube_complete || |
+ texture_state->force_int_or_srgb_cube_texture_complete) { |
int width = 0; |
int height = 0; |
for (unsigned i = 0; i < 6; i++) { |
@@ -2585,6 +2604,15 @@ void TextureManager::ValidateAndDoTexImage( |
(texture_state->force_cube_complete || |
(texture_state->force_cube_map_positive_x_allocation && |
args.target != GL_TEXTURE_CUBE_MAP_POSITIVE_X)); |
+ // Force integer or srgb cube map texture complete, see crbug.com/712117. |
+ need_cube_map_workaround = |
+ need_cube_map_workaround || |
+ (texture->target() == GL_TEXTURE_CUBE_MAP && |
+ texture_state->force_int_or_srgb_cube_texture_complete && |
+ (GLES2Util::IsIntegerFormat(args.internal_format) || |
+ GLES2Util::GetColorEncodingFromInternalFormat(args.internal_format) == |
+ GL_SRGB)); |
+ |
if (need_cube_map_workaround && !buffer) { |
DoCubeMapWorkaround(texture_state, state, framebuffer_state, |
texture_ref, function_name, args); |