| 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 7a1628fc6b835178865826192bd7a0a85530230e..53ce95e3fa80d6c18415d22765a5f80744535f45 100644
|
| --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| @@ -8857,6 +8857,7 @@ error::Error GLES2DecoderImpl::HandleVertexAttribIPointer(
|
| const gles2::cmds::VertexAttribIPointer& c =
|
| *static_cast<const gles2::cmds::VertexAttribIPointer*>(cmd_data);
|
|
|
| + GLsizei offset = c.offset;
|
| if (!state_.bound_array_buffer.get() ||
|
| state_.bound_array_buffer->IsDeleted()) {
|
| if (state_.vertex_attrib_manager.get() ==
|
| @@ -8865,7 +8866,7 @@ error::Error GLES2DecoderImpl::HandleVertexAttribIPointer(
|
| GL_INVALID_OPERATION,
|
| "glVertexAttribIPointer", "no array buffer bound");
|
| return error::kNoError;
|
| - } else if (c.offset != 0) {
|
| + } else if (offset != 0) {
|
| LOCAL_SET_GL_ERROR(
|
| GL_INVALID_OPERATION,
|
| "glVertexAttribIPointer", "client side arrays are not allowed");
|
| @@ -8877,7 +8878,6 @@ error::Error GLES2DecoderImpl::HandleVertexAttribIPointer(
|
| GLint size = c.size;
|
| GLenum type = c.type;
|
| GLsizei stride = c.stride;
|
| - GLsizei offset = c.offset;
|
| const void* ptr = reinterpret_cast<const void*>(offset);
|
| if (!validators_->vertex_attrib_i_type.IsValid(type)) {
|
| LOCAL_SET_GL_ERROR_INVALID_ENUM("glVertexAttribIPointer", type, "type");
|
| @@ -12835,11 +12835,12 @@ error::Error GLES2DecoderImpl::HandleWaitSyncTokenCHROMIUM(
|
| const gpu::CommandBufferNamespace kMaxNamespaceId =
|
| gpu::CommandBufferNamespace::NUM_COMMAND_BUFFER_NAMESPACES;
|
|
|
| - const gpu::CommandBufferNamespace namespace_id =
|
| - ((c.namespace_id >= static_cast<int32_t>(kMinNamespaceId)) &&
|
| - (c.namespace_id < static_cast<int32_t>(kMaxNamespaceId)))
|
| - ? static_cast<gpu::CommandBufferNamespace>(c.namespace_id)
|
| - : gpu::CommandBufferNamespace::INVALID;
|
| + gpu::CommandBufferNamespace namespace_id =
|
| + static_cast<gpu::CommandBufferNamespace>(c.namespace_id);
|
| + if ((namespace_id < static_cast<int32_t>(kMinNamespaceId)) &&
|
| + (namespace_id >= static_cast<int32_t>(kMaxNamespaceId))) {
|
| + namespace_id = gpu::CommandBufferNamespace::INVALID;
|
| + }
|
| const CommandBufferId command_buffer_id =
|
| CommandBufferId::FromUnsafeValue(c.command_buffer_id());
|
| const uint64_t release = c.release_count();
|
| @@ -14172,7 +14173,7 @@ void GLES2DecoderImpl::ProduceTextureRef(const char* func_name,
|
| TextureRef* texture_ref,
|
| GLenum target,
|
| const GLbyte* data) {
|
| - const Mailbox& mailbox = *reinterpret_cast<const Mailbox*>(data);
|
| + const Mailbox mailbox = *reinterpret_cast<const Mailbox*>(data);
|
| DLOG_IF(ERROR, !mailbox.Verify()) << func_name << " was passed a "
|
| "mailbox that was not generated by "
|
| "GenMailboxCHROMIUM.";
|
| @@ -14766,6 +14767,7 @@ error::Error GLES2DecoderImpl::HandleMapBufferRange(
|
| GLbitfield access = static_cast<GLbitfield>(c.access);
|
| GLintptr offset = static_cast<GLintptr>(c.offset);
|
| GLsizeiptr size = static_cast<GLsizeiptr>(c.size);
|
| + uint32_t data_shm_id = static_cast<uint32_t>(c.data_shm_id);
|
|
|
| typedef cmds::MapBufferRange::Result Result;
|
| Result* result = GetSharedMemoryAs<Result*>(
|
| @@ -14778,7 +14780,7 @@ error::Error GLES2DecoderImpl::HandleMapBufferRange(
|
| return error::kInvalidArguments;
|
| }
|
| int8_t* mem =
|
| - GetSharedMemoryAs<int8_t*>(c.data_shm_id, c.data_shm_offset, size);
|
| + GetSharedMemoryAs<int8_t*>(data_shm_id, c.data_shm_offset, size);
|
| if (!mem) {
|
| return error::kOutOfBounds;
|
| }
|
| @@ -14810,7 +14812,7 @@ error::Error GLES2DecoderImpl::HandleMapBufferRange(
|
| Buffer* buffer = buffer_manager()->GetBufferInfoForTarget(&state_, target);
|
| DCHECK(buffer);
|
| buffer->SetMappedRange(offset, size, access, ptr,
|
| - GetSharedMemoryBuffer(c.data_shm_id));
|
| + GetSharedMemoryBuffer(data_shm_id));
|
| if ((access & GL_MAP_INVALIDATE_RANGE_BIT) == 0) {
|
| memcpy(mem, ptr, size);
|
| }
|
|
|