OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/renderbuffer_manager.h" | 5 #include "gpu/command_buffer/service/renderbuffer_manager.h" |
6 #include "base/logging.h" | 6 #include "base/logging.h" |
7 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 7 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
8 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 8 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
9 | 9 |
10 namespace gpu { | 10 namespace gpu { |
11 namespace gles2 { | 11 namespace gles2 { |
12 | 12 |
13 void RenderbufferManager::CreateRenderbufferInfo(GLuint renderbuffer_id) { | 13 void RenderbufferManager::CreateRenderbufferInfo( |
| 14 GLuint client_id, GLuint service_id) { |
14 std::pair<RenderbufferInfoMap::iterator, bool> result = | 15 std::pair<RenderbufferInfoMap::iterator, bool> result = |
15 renderbuffer_infos_.insert( | 16 renderbuffer_infos_.insert( |
16 std::make_pair( | 17 std::make_pair( |
17 renderbuffer_id, | 18 client_id, |
18 RenderbufferInfo::Ref(new RenderbufferInfo(renderbuffer_id)))); | 19 RenderbufferInfo::Ref(new RenderbufferInfo(service_id)))); |
19 DCHECK(result.second); | 20 DCHECK(result.second); |
20 } | 21 } |
21 | 22 |
22 RenderbufferManager::RenderbufferInfo* RenderbufferManager::GetRenderbufferInfo( | 23 RenderbufferManager::RenderbufferInfo* RenderbufferManager::GetRenderbufferInfo( |
23 GLuint renderbuffer_id) { | 24 GLuint client_id) { |
24 RenderbufferInfoMap::iterator it = renderbuffer_infos_.find(renderbuffer_id); | 25 RenderbufferInfoMap::iterator it = renderbuffer_infos_.find(client_id); |
25 return it != renderbuffer_infos_.end() ? it->second : NULL; | 26 return it != renderbuffer_infos_.end() ? it->second : NULL; |
26 } | 27 } |
27 | 28 |
28 void RenderbufferManager::RemoveRenderbufferInfo(GLuint renderbuffer_id) { | 29 void RenderbufferManager::RemoveRenderbufferInfo(GLuint client_id) { |
29 RenderbufferInfoMap::iterator it = renderbuffer_infos_.find(renderbuffer_id); | 30 RenderbufferInfoMap::iterator it = renderbuffer_infos_.find(client_id); |
30 if (it != renderbuffer_infos_.end()) { | 31 if (it != renderbuffer_infos_.end()) { |
31 it->second->MarkAsDeleted(); | 32 it->second->MarkAsDeleted(); |
32 renderbuffer_infos_.erase(renderbuffer_id); | 33 renderbuffer_infos_.erase(it); |
33 } | 34 } |
34 } | 35 } |
35 | 36 |
36 } // namespace gles2 | 37 } // namespace gles2 |
37 } // namespace gpu | 38 } // namespace gpu |
38 | 39 |
39 | 40 |
OLD | NEW |