| 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/texture_manager.h" | 5 #include "gpu/command_buffer/service/texture_manager.h" |
| 6 #include "base/bits.h" | 6 #include "base/bits.h" |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.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/error_state.h" | 9 #include "gpu/command_buffer/service/error_state.h" |
| 10 #include "gpu/command_buffer/service/feature_info.h" | 10 #include "gpu/command_buffer/service/feature_info.h" |
| (...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1094 this, client_id, service_id)); | 1094 this, client_id, service_id)); |
| 1095 std::pair<TextureMap::iterator, bool> result = | 1095 std::pair<TextureMap::iterator, bool> result = |
| 1096 textures_.insert(std::make_pair(client_id, ref)); | 1096 textures_.insert(std::make_pair(client_id, ref)); |
| 1097 DCHECK(result.second); | 1097 DCHECK(result.second); |
| 1098 return ref.get(); | 1098 return ref.get(); |
| 1099 } | 1099 } |
| 1100 | 1100 |
| 1101 TextureRef* TextureManager::GetTexture( | 1101 TextureRef* TextureManager::GetTexture( |
| 1102 GLuint client_id) const { | 1102 GLuint client_id) const { |
| 1103 TextureMap::const_iterator it = textures_.find(client_id); | 1103 TextureMap::const_iterator it = textures_.find(client_id); |
| 1104 return it != textures_.end() ? it->second : NULL; | 1104 return it != textures_.end() ? it->second.get() : NULL; |
| 1105 } | 1105 } |
| 1106 | 1106 |
| 1107 void TextureManager::RemoveTexture(GLuint client_id) { | 1107 void TextureManager::RemoveTexture(GLuint client_id) { |
| 1108 TextureMap::iterator it = textures_.find(client_id); | 1108 TextureMap::iterator it = textures_.find(client_id); |
| 1109 if (it != textures_.end()) { | 1109 if (it != textures_.end()) { |
| 1110 it->second->reset_client_id(); | 1110 it->second->reset_client_id(); |
| 1111 textures_.erase(it); | 1111 textures_.erase(it); |
| 1112 } | 1112 } |
| 1113 } | 1113 } |
| 1114 | 1114 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1215 } | 1215 } |
| 1216 | 1216 |
| 1217 void TextureManager::IncFramebufferStateChangeCount() { | 1217 void TextureManager::IncFramebufferStateChangeCount() { |
| 1218 if (framebuffer_manager_) | 1218 if (framebuffer_manager_) |
| 1219 framebuffer_manager_->IncFramebufferStateChangeCount(); | 1219 framebuffer_manager_->IncFramebufferStateChangeCount(); |
| 1220 | 1220 |
| 1221 } | 1221 } |
| 1222 | 1222 |
| 1223 } // namespace gles2 | 1223 } // namespace gles2 |
| 1224 } // namespace gpu | 1224 } // namespace gpu |
| OLD | NEW |