| 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 74abce022062a0e6a5d22c7e71e7e0d028c44717..046f304c63104d1b862438027d896e9de145e93f 100644
|
| --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| @@ -1329,6 +1329,9 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
|
| bool clear_uncleared_images, const char* func_name);
|
| // Generates |gl_error| if the bound read fbo is incomplete.
|
| bool CheckBoundReadFramebufferValid(const char* func_name, GLenum gl_error);
|
| + // This is only used by DoBlitFramebufferCHROMIUM which operates read/draw
|
| + // framebuffer at the same time.
|
| + bool CheckBoundFramebufferValid(const char* func_name);
|
|
|
| // Checks if the current program exists and is valid. If not generates the
|
| // appropriate GL error. Returns true if the current program is in a usable
|
| @@ -4016,6 +4019,31 @@ bool GLES2DecoderImpl::CheckBoundReadFramebufferValid(
|
| return valid;
|
| }
|
|
|
| +bool GLES2DecoderImpl::CheckBoundFramebufferValid(const char* func_name) {
|
| + GLenum target = features().chromium_framebuffer_multisample ?
|
| + GL_DRAW_FRAMEBUFFER : GL_FRAMEBUFFER;
|
| + Framebuffer* draw_framebuffer = GetFramebufferInfoForTarget(target);
|
| + bool valid = CheckFramebufferValid(
|
| + draw_framebuffer, target, true,
|
| + GL_INVALID_FRAMEBUFFER_OPERATION, func_name);
|
| +
|
| + target = features().chromium_framebuffer_multisample ?
|
| + GL_READ_FRAMEBUFFER : GL_FRAMEBUFFER;
|
| + Framebuffer* read_framebuffer = GetFramebufferInfoForTarget(target);
|
| + valid = valid && CheckFramebufferValid(
|
| + read_framebuffer, target, true,
|
| + GL_INVALID_FRAMEBUFFER_OPERATION, func_name);
|
| +
|
| + if (valid && feature_info_->feature_flags().desktop_srgb_support) {
|
| + bool enable_framebuffer_srgb =
|
| + (draw_framebuffer && draw_framebuffer->HasSRGBAttachments()) ||
|
| + (read_framebuffer && read_framebuffer->HasSRGBAttachments());
|
| + state_.EnableDisableFramebufferSRGB(enable_framebuffer_srgb);
|
| + }
|
| +
|
| + return valid;
|
| +}
|
| +
|
| GLint GLES2DecoderImpl::GetColorEncodingFromInternalFormat(
|
| GLenum internalformat) {
|
| switch (internalformat) {
|
| @@ -7168,9 +7196,7 @@ void GLES2DecoderImpl::DoBlitFramebufferCHROMIUM(
|
| const char* func_name = "glBlitFramebufferCHROMIUM";
|
| DCHECK(!ShouldDeferReads() && !ShouldDeferDraws());
|
|
|
| - if (!CheckBoundDrawFramebufferValid(true, func_name) ||
|
| - !CheckBoundReadFramebufferValid(func_name,
|
| - GL_INVALID_FRAMEBUFFER_OPERATION)) {
|
| + if (!CheckBoundFramebufferValid(func_name)) {
|
| return;
|
| }
|
|
|
|
|