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 4b75c2e1eb480c1ec4e55c6956e89324ffd78b84..18248470bab706b54b060907a36e703ce74f1af0 100644 |
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc |
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
@@ -1105,12 +1105,9 @@ class GLES2DecoderImpl : public GLES2Decoder, |
} |
// Creates a vertex attrib manager for the given vertex array. |
- scoped_refptr<VertexAttribManager> CreateVertexAttribManager( |
- GLuint client_id, |
- GLuint service_id, |
- bool client_visible) { |
+ void CreateVertexAttribManager(GLuint client_id, GLuint service_id) { |
return vertex_array_manager()->CreateVertexAttribManager( |
- client_id, service_id, group_->max_vertex_attribs(), client_visible); |
+ client_id, service_id, group_->max_vertex_attribs()); |
} |
void DoBindAttribLocation(GLuint client_id, GLuint index, const char* name); |
@@ -2358,17 +2355,7 @@ bool GLES2DecoderImpl::Initialize( |
disallowed_features_ = disallowed_features; |
state_.attrib_values.resize(group_->max_vertex_attribs()); |
- vertex_array_manager_.reset(new VertexArrayManager()); |
- |
- GLuint default_vertex_attrib_service_id = 0; |
- if (features().native_vertex_array_object) { |
- glGenVertexArraysOES(1, &default_vertex_attrib_service_id); |
- glBindVertexArrayOES(default_vertex_attrib_service_id); |
- } |
- |
- state_.default_vertex_attrib_manager = |
- CreateVertexAttribManager(0, default_vertex_attrib_service_id, false); |
- |
+ state_.default_vertex_attrib_manager = new VertexAttribManager(); |
vmiura
2014/05/08 20:21:22
Was there a reason for this change?
Using non zer
boliu
2014/05/08 20:23:25
Doh! Really sorry! I had your CL locally reverted
|
state_.default_vertex_attrib_manager->Initialize( |
group_->max_vertex_attribs(), |
feature_info_->workarounds().init_vertex_attributes); |
@@ -2377,6 +2364,7 @@ bool GLES2DecoderImpl::Initialize( |
DoBindVertexArrayOES(0); |
query_manager_.reset(new QueryManager(this, feature_info_.get())); |
+ vertex_array_manager_.reset(new VertexArrayManager()); |
util_.set_num_compressed_texture_formats( |
validators_->compressed_texture_format.GetValues().size()); |
@@ -2688,6 +2676,7 @@ Capabilities GLES2DecoderImpl::GetCapabilities() { |
#endif |
caps.post_sub_buffer = supports_post_sub_buffer_; |
+ caps.map_image = !!image_manager(); |
return caps; |
} |
@@ -9695,14 +9684,14 @@ bool GLES2DecoderImpl::GenVertexArraysOESHelper( |
if (!features().native_vertex_array_object) { |
// Emulated VAO |
for (GLsizei ii = 0; ii < n; ++ii) { |
- CreateVertexAttribManager(client_ids[ii], 0, true); |
+ CreateVertexAttribManager(client_ids[ii], 0); |
} |
} else { |
scoped_ptr<GLuint[]> service_ids(new GLuint[n]); |
glGenVertexArraysOES(n, service_ids.get()); |
for (GLsizei ii = 0; ii < n; ++ii) { |
- CreateVertexAttribManager(client_ids[ii], service_ids[ii], true); |
+ CreateVertexAttribManager(client_ids[ii], service_ids[ii]); |
} |
} |
@@ -9725,6 +9714,7 @@ void GLES2DecoderImpl::DeleteVertexArraysOESHelper( |
void GLES2DecoderImpl::DoBindVertexArrayOES(GLuint client_id) { |
VertexAttribManager* vao = NULL; |
+ GLuint service_id = 0; |
if (client_id != 0) { |
vao = GetVertexAttribManager(client_id); |
if (!vao) { |
@@ -9736,6 +9726,8 @@ void GLES2DecoderImpl::DoBindVertexArrayOES(GLuint client_id) { |
"glBindVertexArrayOES", "bad vertex array id."); |
current_decoder_error_ = error::kNoError; |
return; |
+ } else { |
+ service_id = vao->service_id(); |
} |
} else { |
vao = state_.default_vertex_attrib_manager.get(); |
@@ -9747,7 +9739,6 @@ void GLES2DecoderImpl::DoBindVertexArrayOES(GLuint client_id) { |
if (!features().native_vertex_array_object) { |
EmulateVertexArrayState(); |
} else { |
- GLuint service_id = vao->service_id(); |
glBindVertexArrayOES(service_id); |
} |
} |