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

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

Issue 11275120: Virtual GL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 | « gpu/command_buffer/service/vertex_attrib_manager.h ('k') | gpu/command_buffer/tests/gl_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/vertex_attrib_manager.cc
diff --git a/gpu/command_buffer/service/vertex_attrib_manager.cc b/gpu/command_buffer/service/vertex_attrib_manager.cc
index f8bc061b9689043796bba96c178cd50c7a7ad065..a70d94fb2fb029e126ed2eb81b1b0f45228c3ec4 100644
--- a/gpu/command_buffer/service/vertex_attrib_manager.cc
+++ b/gpu/command_buffer/service/vertex_attrib_manager.cc
@@ -63,8 +63,7 @@ bool VertexAttribManager::VertexAttribInfo::CanAccess(GLuint index) const {
}
VertexAttribManager::VertexAttribManager()
- : max_vertex_attribs_(0),
- num_fixed_attribs_(0),
+ : num_fixed_attribs_(0),
element_array_buffer_(NULL),
manager_(NULL),
deleted_(false),
@@ -73,8 +72,7 @@ VertexAttribManager::VertexAttribManager()
VertexAttribManager::VertexAttribManager(
VertexArrayManager* manager, GLuint service_id, uint32 num_vertex_attribs)
- : max_vertex_attribs_(0),
- num_fixed_attribs_(0),
+ : num_fixed_attribs_(0),
element_array_buffer_(NULL),
manager_(manager),
deleted_(false),
@@ -96,13 +94,11 @@ VertexAttribManager::~VertexAttribManager() {
void VertexAttribManager::Initialize(
uint32 max_vertex_attribs, bool init_attribs) {
- max_vertex_attribs_ = max_vertex_attribs;
- vertex_attrib_infos_.reset(
- new VertexAttribInfo[max_vertex_attribs]);
+ vertex_attrib_infos_.resize(max_vertex_attribs);
bool disable_workarounds = CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableGpuDriverBugWorkarounds);
- for (uint32 vv = 0; vv < max_vertex_attribs; ++vv) {
+ for (uint32 vv = 0; vv < vertex_attrib_infos_.size(); ++vv) {
vertex_attrib_infos_[vv].set_index(vv);
vertex_attrib_infos_[vv].SetList(&disabled_vertex_attribs_);
@@ -113,7 +109,7 @@ void VertexAttribManager::Initialize(
}
bool VertexAttribManager::Enable(GLuint index, bool enable) {
- if (index >= max_vertex_attribs_) {
+ if (index >= vertex_attrib_infos_.size()) {
return false;
}
VertexAttribInfo& info = vertex_attrib_infos_[index];
@@ -128,7 +124,7 @@ void VertexAttribManager::Unbind(BufferManager::BufferInfo* buffer) {
if (element_array_buffer_ == buffer) {
element_array_buffer_ = NULL;
}
- for (uint32 vv = 0; vv < max_vertex_attribs_; ++vv) {
+ for (uint32 vv = 0; vv < vertex_attrib_infos_.size(); ++vv) {
vertex_attrib_infos_[vv].Unbind(buffer);
}
}
« no previous file with comments | « gpu/command_buffer/service/vertex_attrib_manager.h ('k') | gpu/command_buffer/tests/gl_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698