Chromium Code Reviews| 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 bd7bed5278f045b9e79c7fbbed2eba291918d3fc..e4d664d01b0d94bfb0e3b3ce1db0fc9b39d5f7a2 100644 |
| --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc |
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
| @@ -15278,6 +15278,7 @@ error::Error GLES2DecoderImpl::HandleGetTransformFeedbackVarying( |
| Program* program = GetProgramInfoNotShader( |
| program_id, "glGetTransformFeedbackVarying"); |
| if (!program) { |
| + // An error is already set. |
| return error::kNoError; |
| } |
| GLuint service_id = program->service_id(); |
| @@ -17212,6 +17213,7 @@ error::Error GLES2DecoderImpl::HandleClientWaitSync( |
| case GL_CONDITION_SATISFIED: |
| break; |
| case GL_WAIT_FAILED: |
| + NOTREACHED(); |
|
Zhenyao Mo
2016/11/01 02:27:48
This could happen in context lost.
Kai Ninomiya
2016/11/01 03:16:01
Ah, okay. Is it okay that it returns kNoError in t
Zhenyao Mo
2016/11/01 04:49:44
I think the LOSE_CONTEXT gl error will be handled
Kai Ninomiya
2016/11/01 20:28:42
Done.
|
| // Avoid leaking GL errors when using virtual contexts. |
| LOCAL_PEEK_GL_ERROR(function_name); |
| break; |
| @@ -17389,12 +17391,13 @@ error::Error GLES2DecoderImpl::HandleMapBufferRange( |
| return error::kNoError; |
| } |
| if (size == 0) { |
| - LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, func_name, "size is zero"); |
| + LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, func_name, "length is zero"); |
| return error::kNoError; |
| } |
| Buffer* buffer = buffer_manager()->RequestBufferAccess( |
| &state_, target, offset, size, func_name); |
| if (!buffer) { |
| + // An error is already set. |
| return error::kNoError; |
| } |
| if (state_.bound_transform_feedback->active() && |
| @@ -17425,7 +17428,7 @@ error::Error GLES2DecoderImpl::HandleMapBufferRange( |
| } |
| if (!AnyBitsSet(access, GL_MAP_READ_BIT | GL_MAP_WRITE_BIT)) { |
| LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, func_name, |
| - "neither MAP_READ_BIT nore MAP_WRITE_BIT is set"); |
| + "neither MAP_READ_BIT nor MAP_WRITE_BIT is set"); |
| return error::kNoError; |
| } |
| if (AllBitsSet(access, GL_MAP_READ_BIT) && |
| @@ -17433,7 +17436,7 @@ error::Error GLES2DecoderImpl::HandleMapBufferRange( |
| GL_MAP_INVALIDATE_BUFFER_BIT | |
| GL_MAP_UNSYNCHRONIZED_BIT))) { |
| LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, func_name, |
| - "Incompatible access bits with MAP_READ_BIT"); |
| + "incompatible access bits with MAP_READ_BIT"); |
| return error::kNoError; |
| } |
| if (AllBitsSet(access, GL_MAP_FLUSH_EXPLICIT_BIT) && |
| @@ -17457,6 +17460,8 @@ error::Error GLES2DecoderImpl::HandleMapBufferRange( |
| } |
| void* ptr = glMapBufferRange(target, offset, size, access); |
| if (ptr == nullptr) { |
| + // This should mean GL_OUT_OF_MEMORY. |
|
Kai Ninomiya
2016/11/01 03:16:01
Can context loss (or anything else) trigger this?
Zhenyao Mo
2016/11/01 04:49:44
In context lost, the behavior (returned value) is
Kai Ninomiya
2016/11/01 20:28:41
Done.
|
| + LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER(func_name); |
| return error::kNoError; |
| } |
| buffer->SetMappedRange(offset, size, access, ptr, |