OLD | NEW |
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_array_manager.h" | 5 #include "gpu/command_buffer/service/vertex_array_manager.h" |
6 #include "base/debug/trace_event.h" | 6 #include "base/debug/trace_event.h" |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 8 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
9 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 9 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
10 #include "gpu/command_buffer/service/vertex_attrib_manager.h" | 10 #include "gpu/command_buffer/service/vertex_attrib_manager.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 new VertexAttribManager(this, service_id, num_vertex_attribs)); | 33 new VertexAttribManager(this, service_id, num_vertex_attribs)); |
34 std::pair<VertexAttribManagerMap::iterator, bool> result = | 34 std::pair<VertexAttribManagerMap::iterator, bool> result = |
35 vertex_attrib_managers_.insert( | 35 vertex_attrib_managers_.insert( |
36 std::make_pair(client_id, vertex_attrib_manager)); | 36 std::make_pair(client_id, vertex_attrib_manager)); |
37 DCHECK(result.second); | 37 DCHECK(result.second); |
38 } | 38 } |
39 | 39 |
40 VertexAttribManager* VertexArrayManager::GetVertexAttribManager( | 40 VertexAttribManager* VertexArrayManager::GetVertexAttribManager( |
41 GLuint client_id) { | 41 GLuint client_id) { |
42 VertexAttribManagerMap::iterator it = vertex_attrib_managers_.find(client_id); | 42 VertexAttribManagerMap::iterator it = vertex_attrib_managers_.find(client_id); |
43 return it != vertex_attrib_managers_.end() ? it->second : NULL; | 43 return .get()p::iterator it = vertex_attrib_managers_.find(client_id); |
44 } | |
45 | |
46 void VertexArrayManager::RemoveVertexAttribManager(GLuint client_id) { | |
47 VertexAttribManagerMap::iterator it = vertex_attrib_managers_.find(client_id); | |
48 if (it != vertex_attrib_managers_.end()) { | 44 if (it != vertex_attrib_managers_.end()) { |
49 VertexAttribManager* vertex_attrib_manager = it->second; | 45 VertexAttribManager* vertex_attrib_manager = it->second.get(); |
50 vertex_attrib_manager->MarkAsDeleted(); | 46 vertex_attrib_manager->MarkAsDeleted(); |
51 vertex_attrib_managers_.erase(it); | 47 vertex_attrib_managers_.erase(it); |
52 } | 48 } |
53 } | 49 } |
54 | 50 |
55 void VertexArrayManager::StartTracking( | 51 void VertexArrayManager::StartTracking( |
56 VertexAttribManager* /* vertex_attrib_manager */) { | 52 VertexAttribManager* /* vertex_attrib_manager */) { |
57 ++vertex_attrib_manager_count_; | 53 ++vertex_attrib_manager_count_; |
58 } | 54 } |
59 | 55 |
(...skipping 13 matching lines...) Expand all Loading... |
73 return true; | 69 return true; |
74 } | 70 } |
75 } | 71 } |
76 return false; | 72 return false; |
77 } | 73 } |
78 | 74 |
79 } // namespace gles2 | 75 } // namespace gles2 |
80 } // namespace gpu | 76 } // namespace gpu |
81 | 77 |
82 | 78 |
OLD | NEW |