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

Side by Side Diff: gpu/command_buffer/service/vertex_attrib_manager.cc

Issue 11275088: Remove implicit scoped_refptr operator T* Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/command_buffer/service/vertex_attrib_manager.h" 5 #include "gpu/command_buffer/service/vertex_attrib_manager.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 27 matching lines...) Expand all
38 } 38 }
39 39
40 VertexAttribManager::VertexAttribInfo::~VertexAttribInfo() { 40 VertexAttribManager::VertexAttribInfo::~VertexAttribInfo() {
41 } 41 }
42 42
43 bool VertexAttribManager::VertexAttribInfo::CanAccess(GLuint index) const { 43 bool VertexAttribManager::VertexAttribInfo::CanAccess(GLuint index) const {
44 if (!enabled_) { 44 if (!enabled_) {
45 return true; 45 return true;
46 } 46 }
47 47
48 if (!buffer_ || buffer_->IsDeleted()) { 48 if (!buffer_.get() || buffer_->IsDeleted()) {
49 return false; 49 return false;
50 } 50 }
51 51
52 // The number of elements that can be accessed. 52 // The number of elements that can be accessed.
53 GLsizeiptr buffer_size = buffer_->size(); 53 GLsizeiptr buffer_size = buffer_->size();
54 if (offset_ > buffer_size || real_stride_ == 0) { 54 if (offset_ > buffer_size || real_stride_ == 0) {
55 return false; 55 return false;
56 } 56 }
57 57
58 uint32 usable_size = buffer_size - offset_; 58 uint32 usable_size = buffer_size - offset_;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 } 118 }
119 VertexAttribInfo& info = vertex_attrib_infos_[index]; 119 VertexAttribInfo& info = vertex_attrib_infos_[index];
120 if (info.enabled() != enable) { 120 if (info.enabled() != enable) {
121 info.set_enabled(enable); 121 info.set_enabled(enable);
122 info.SetList(enable ? &enabled_vertex_attribs_ : &disabled_vertex_attribs_); 122 info.SetList(enable ? &enabled_vertex_attribs_ : &disabled_vertex_attribs_);
123 } 123 }
124 return true; 124 return true;
125 } 125 }
126 126
127 void VertexAttribManager::Unbind(BufferManager::BufferInfo* buffer) { 127 void VertexAttribManager::Unbind(BufferManager::BufferInfo* buffer) {
128 if (element_array_buffer_ == buffer) { 128 if (element_array_buffer_.get() == buffer) {
129 element_array_buffer_ = NULL; 129 element_array_buffer_ = NULL;
130 } 130 }
131 for (uint32 vv = 0; vv < max_vertex_attribs_; ++vv) { 131 for (uint32 vv = 0; vv < max_vertex_attribs_; ++vv) {
132 vertex_attrib_infos_[vv].Unbind(buffer); 132 vertex_attrib_infos_[vv].Unbind(buffer);
133 } 133 }
134 } 134 }
135 135
136 } // namespace gles2 136 } // namespace gles2
137 } // namespace gpu 137 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/vertex_attrib_manager.h ('k') | gpu/gles2_conform_support/egl/display.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698