| 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/buffer_manager.h" | 5 #include "gpu/command_buffer/service/buffer_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 { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 } | 47 } |
| 48 | 48 |
| 49 void BufferManager::RemoveBufferInfo(GLuint client_id) { | 49 void BufferManager::RemoveBufferInfo(GLuint client_id) { |
| 50 BufferInfoMap::iterator it = buffer_infos_.find(client_id); | 50 BufferInfoMap::iterator it = buffer_infos_.find(client_id); |
| 51 if (it != buffer_infos_.end()) { | 51 if (it != buffer_infos_.end()) { |
| 52 it->second->MarkAsDeleted(); | 52 it->second->MarkAsDeleted(); |
| 53 buffer_infos_.erase(it); | 53 buffer_infos_.erase(it); |
| 54 } | 54 } |
| 55 } | 55 } |
| 56 | 56 |
| 57 void BufferManager::BufferInfo::set_target(GLenum target) { | |
| 58 DCHECK_EQ(target_, 0u); // you can only set this once. | |
| 59 target_ = target; | |
| 60 } | |
| 61 | |
| 62 BufferManager::BufferInfo::BufferInfo(GLuint service_id) | 57 BufferManager::BufferInfo::BufferInfo(GLuint service_id) |
| 63 : service_id_(service_id), | 58 : service_id_(service_id), |
| 64 target_(0), | 59 target_(0), |
| 65 size_(0), | 60 size_(0), |
| 66 shadowed_(false) { | 61 shadowed_(false) { |
| 67 } | 62 } |
| 68 | 63 |
| 69 BufferManager::BufferInfo::~BufferInfo() { } | 64 BufferManager::BufferInfo::~BufferInfo() { } |
| 70 | 65 |
| 71 void BufferManager::BufferInfo::SetSize(GLsizeiptr size, bool shadow) { | 66 void BufferManager::BufferInfo::SetSize(GLsizeiptr size, bool shadow) { |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 return false; | 199 return false; |
| 205 } | 200 } |
| 206 if (info->target() == 0) { | 201 if (info->target() == 0) { |
| 207 info->set_target(target); | 202 info->set_target(target); |
| 208 } | 203 } |
| 209 return true; | 204 return true; |
| 210 } | 205 } |
| 211 | 206 |
| 212 } // namespace gles2 | 207 } // namespace gles2 |
| 213 } // namespace gpu | 208 } // namespace gpu |
| 209 |
| 210 |
| OLD | NEW |