Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(524)

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 12649002: Refactor GPU code. Buffer* info to Buffer* buffer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 07d88ccbd296d92699b50973b6ca2d680cc021c2..32791f092f8feda76689d2128a85802af6f9d8d9 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -965,9 +965,8 @@ class GLES2DecoderImpl : public GLES2Decoder {
// Gets the buffer info for the given buffer.
Buffer* GetBuffer(GLuint client_id) {
- Buffer* info =
- buffer_manager()->GetBuffer(client_id);
- return info;
+ Buffer* buffer = buffer_manager()->GetBuffer(client_id);
+ return buffer;
}
// Removes any buffers in the VertexAtrribInfos and BufferInfos. This is used
@@ -3552,41 +3551,41 @@ void GLES2DecoderImpl::DoActiveTexture(GLenum texture_unit) {
}
void GLES2DecoderImpl::DoBindBuffer(GLenum target, GLuint client_id) {
- Buffer* info = NULL;
+ Buffer* buffer = NULL;
GLuint service_id = 0;
if (client_id != 0) {
- info = GetBuffer(client_id);
- if (!info) {
+ buffer = GetBuffer(client_id);
+ if (!buffer) {
if (!group_->bind_generates_resource()) {
LOG(ERROR) << "glBindBuffer: id not generated by glGenBuffers";
current_decoder_error_ = error::kGenericError;
return;
}
- // It's a new id so make a buffer info for it.
+ // It's a new id so make a buffer buffer for it.
glGenBuffersARB(1, &service_id);
CreateBuffer(client_id, service_id);
- info = GetBuffer(client_id);
+ buffer = GetBuffer(client_id);
IdAllocatorInterface* id_allocator =
group_->GetIdAllocator(id_namespaces::kBuffers);
id_allocator->MarkAsUsed(client_id);
}
}
- LogClientServiceForInfo(info, client_id, "glBindBuffer");
- if (info) {
- if (!buffer_manager()->SetTarget(info, target)) {
+ LogClientServiceForInfo(buffer, client_id, "glBindBuffer");
+ if (buffer) {
+ if (!buffer_manager()->SetTarget(buffer, target)) {
SetGLError(GL_INVALID_OPERATION,
"glBindBuffer", "buffer bound to more than 1 target");
return;
}
- service_id = info->service_id();
+ service_id = buffer->service_id();
}
switch (target) {
case GL_ARRAY_BUFFER:
- state_.bound_array_buffer = info;
+ state_.bound_array_buffer = buffer;
break;
case GL_ELEMENT_ARRAY_BUFFER:
- state_.vertex_attrib_manager->SetElementArrayBuffer(info);
+ state_.vertex_attrib_manager->SetElementArrayBuffer(buffer);
break;
default:
NOTREACHED(); // Validation should prevent us getting here.
@@ -5831,8 +5830,8 @@ void GLES2DecoderImpl::RestoreStateForAttrib(GLuint attrib) {
const VertexAttrib* info =
state_.vertex_attrib_manager->GetVertexAttrib(attrib);
const void* ptr = reinterpret_cast<const void*>(info->offset());
- Buffer* buffer_info = info->buffer();
- glBindBuffer(GL_ARRAY_BUFFER, buffer_info ? buffer_info->service_id() : 0);
+ Buffer* buffer = info->buffer();
+ glBindBuffer(GL_ARRAY_BUFFER, buffer ? buffer->service_id() : 0);
glVertexAttribPointer(
attrib, info->size(), info->type(), info->normalized(), info->gl_stride(),
ptr);
@@ -6207,13 +6206,14 @@ error::Error GLES2DecoderImpl::HandleDrawElementsInstancedANGLE(
GLuint GLES2DecoderImpl::DoGetMaxValueInBufferCHROMIUM(
GLuint buffer_id, GLsizei count, GLenum type, GLuint offset) {
GLuint max_vertex_accessed = 0;
- Buffer* info = GetBuffer(buffer_id);
- if (!info) {
+ Buffer* buffer = GetBuffer(buffer_id);
+ if (!buffer) {
// TODO(gman): Should this be a GL error or a command buffer error?
SetGLError(GL_INVALID_VALUE,
"GetMaxValueInBufferCHROMIUM", "unknown buffer");
} else {
- if (!info->GetMaxValueForRange(offset, count, type, &max_vertex_accessed)) {
+ if (!buffer->GetMaxValueForRange(
+ offset, count, type, &max_vertex_accessed)) {
// TODO(gman): Should this be a GL error or a command buffer error?
SetGLError(
GL_INVALID_OPERATION,
« no previous file with comments | « gpu/command_buffer/service/context_state.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698