| 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..91beab1035da328ae5f5c2f23a09a7fa0d3cf22e 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();
|
| @@ -17214,7 +17215,9 @@ error::Error GLES2DecoderImpl::HandleClientWaitSync(
|
| case GL_WAIT_FAILED:
|
| // Avoid leaking GL errors when using virtual contexts.
|
| LOCAL_PEEK_GL_ERROR(function_name);
|
| - break;
|
| + *result_dst = status;
|
| + // If validation is complete, this only happens if the context is lost.
|
| + return error::kLostContext;
|
| default:
|
| NOTREACHED();
|
| break;
|
| @@ -17389,12 +17392,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 +17429,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 +17437,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 +17461,8 @@ error::Error GLES2DecoderImpl::HandleMapBufferRange(
|
| }
|
| void* ptr = glMapBufferRange(target, offset, size, access);
|
| if (ptr == nullptr) {
|
| + // This should mean GL_OUT_OF_MEMORY (or context loss).
|
| + LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER(func_name);
|
| return error::kNoError;
|
| }
|
| buffer->SetMappedRange(offset, size, access, ptr,
|
|
|