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

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

Issue 278653002: Reland r264914 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 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
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 956dee098ed19bb61453d53a4c8b55c9da61d0dd..65fc86d2493020f14544ba4461b4bbcb9f983928 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -1097,9 +1097,12 @@ class GLES2DecoderImpl : public GLES2Decoder,
}
// Creates a vertex attrib manager for the given vertex array.
- void CreateVertexAttribManager(GLuint client_id, GLuint service_id) {
- vertex_array_manager()->CreateVertexAttribManager(
- client_id, service_id, group_->max_vertex_attribs());
+ scoped_refptr<VertexAttribManager> CreateVertexAttribManager(
+ GLuint client_id,
+ GLuint service_id,
+ bool client_visible) {
+ return vertex_array_manager()->CreateVertexAttribManager(
+ client_id, service_id, group_->max_vertex_attribs(), client_visible);
}
void DoBindAttribLocation(GLuint client_id, GLuint index, const char* name);
@@ -2347,7 +2350,17 @@ bool GLES2DecoderImpl::Initialize(
disallowed_features_ = disallowed_features;
state_.attrib_values.resize(group_->max_vertex_attribs());
- state_.default_vertex_attrib_manager = new VertexAttribManager();
+ 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->Initialize(
group_->max_vertex_attribs(),
feature_info_->workarounds().init_vertex_attributes);
@@ -2356,7 +2369,6 @@ 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());
@@ -9684,14 +9696,14 @@ bool GLES2DecoderImpl::GenVertexArraysOESHelper(
if (!features().native_vertex_array_object) {
// Emulated VAO
for (GLsizei ii = 0; ii < n; ++ii) {
- CreateVertexAttribManager(client_ids[ii], 0);
+ CreateVertexAttribManager(client_ids[ii], 0, true);
}
} 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]);
+ CreateVertexAttribManager(client_ids[ii], service_ids[ii], true);
}
}
@@ -9714,7 +9726,6 @@ 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) {
@@ -9726,8 +9737,6 @@ 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();
@@ -9739,6 +9748,7 @@ void GLES2DecoderImpl::DoBindVertexArrayOES(GLuint client_id) {
if (!features().native_vertex_array_object) {
EmulateVertexArrayState();
} else {
+ GLuint service_id = vao->service_id();
glBindVertexArrayOES(service_id);
}
}
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698