summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorsievers <sievers@chromium.org>2016-03-25 15:07:52 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-25 22:09:39 +0000
commitff5407f8d6d71116e01d6ea18db75a4f8d1e0692 (patch)
treee161f9480f042446a56681d50f73bf87fcc91d6c /gpu
parent521de10fba02c37a5221a70a29a9e53fe478733c (diff)
downloadchromium_src-ff5407f8d6d71116e01d6ea18db75a4f8d1e0692.zip
chromium_src-ff5407f8d6d71116e01d6ea18db75a4f8d1e0692.tar.gz
chromium_src-ff5407f8d6d71116e01d6ea18db75a4f8d1e0692.tar.bz2
gpu: Pull some variables onto the stack in the decoder
CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel BUG=597636,597625 Review URL: https://codereview.chromium.org/1836603002 Cr-Commit-Position: refs/heads/master@{#383379}
Diffstat (limited to 'gpu')
-rw-r--r--gpu/command_buffer/service/common_decoder.cc4
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc22
2 files changed, 14 insertions, 12 deletions
diff --git a/gpu/command_buffer/service/common_decoder.cc b/gpu/command_buffer/service/common_decoder.cc
index a15c496..27ba05b 100644
--- a/gpu/command_buffer/service/common_decoder.cc
+++ b/gpu/command_buffer/service/common_decoder.cc
@@ -281,8 +281,8 @@ error::Error CommonDecoder::HandleGetBucketStart(uint32_t immediate_data_size,
uint32_t data_memory_size = args.data_memory_size;
uint8_t* data = NULL;
if (data_memory_size != 0 || data_memory_id != 0 || data_memory_offset != 0) {
- data = GetSharedMemoryAs<uint8_t*>(
- args.data_memory_id, args.data_memory_offset, args.data_memory_size);
+ data = GetSharedMemoryAs<uint8_t*>(data_memory_id, data_memory_offset,
+ data_memory_size);
if (!data) {
return error::kInvalidArguments;
}
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 0e471a1..a3d69a5 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -8967,6 +8967,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() ==
@@ -8975,7 +8976,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");
@@ -8987,7 +8988,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");
@@ -13158,11 +13158,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();
@@ -14499,7 +14500,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.";
@@ -15093,6 +15094,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*>(
@@ -15105,7 +15107,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;
}
@@ -15137,7 +15139,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);
}