| 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/context_group.h" | 5 #include "gpu/command_buffer/service/context_group.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 if (feature_info_->workarounds().max_cube_map_texture_size) { | 163 if (feature_info_->workarounds().max_cube_map_texture_size) { |
| 164 max_cube_map_texture_size = std::min( | 164 max_cube_map_texture_size = std::min( |
| 165 max_cube_map_texture_size, | 165 max_cube_map_texture_size, |
| 166 feature_info_->workarounds().max_cube_map_texture_size); | 166 feature_info_->workarounds().max_cube_map_texture_size); |
| 167 } | 167 } |
| 168 | 168 |
| 169 texture_manager_.reset(new TextureManager(memory_tracker_, | 169 texture_manager_.reset(new TextureManager(memory_tracker_, |
| 170 feature_info_.get(), | 170 feature_info_.get(), |
| 171 max_texture_size, | 171 max_texture_size, |
| 172 max_cube_map_texture_size)); | 172 max_cube_map_texture_size)); |
| 173 texture_manager_->set_framebuffer_manager(framebuffer_manager_.get()); |
| 173 | 174 |
| 174 const GLint kMinTextureImageUnits = 8; | 175 const GLint kMinTextureImageUnits = 8; |
| 175 const GLint kMinVertexTextureImageUnits = 0; | 176 const GLint kMinVertexTextureImageUnits = 0; |
| 176 if (!QueryGLFeatureU( | 177 if (!QueryGLFeatureU( |
| 177 GL_MAX_TEXTURE_IMAGE_UNITS, kMinTextureImageUnits, | 178 GL_MAX_TEXTURE_IMAGE_UNITS, kMinTextureImageUnits, |
| 178 &max_texture_image_units_) || | 179 &max_texture_image_units_) || |
| 179 !QueryGLFeatureU( | 180 !QueryGLFeatureU( |
| 180 GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, kMinVertexTextureImageUnits, | 181 GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, kMinVertexTextureImageUnits, |
| 181 &max_vertex_texture_image_units_)) { | 182 &max_vertex_texture_image_units_)) { |
| 182 LOG(ERROR) << "ContextGroup::Initialize failed because too few " | 183 LOG(ERROR) << "ContextGroup::Initialize failed because too few " |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 return; | 245 return; |
| 245 } | 246 } |
| 246 | 247 |
| 247 if (buffer_manager_ != NULL) { | 248 if (buffer_manager_ != NULL) { |
| 248 buffer_manager_->Destroy(have_context); | 249 buffer_manager_->Destroy(have_context); |
| 249 buffer_manager_.reset(); | 250 buffer_manager_.reset(); |
| 250 } | 251 } |
| 251 | 252 |
| 252 if (framebuffer_manager_ != NULL) { | 253 if (framebuffer_manager_ != NULL) { |
| 253 framebuffer_manager_->Destroy(have_context); | 254 framebuffer_manager_->Destroy(have_context); |
| 255 if (texture_manager_) |
| 256 texture_manager_->set_framebuffer_manager(NULL); |
| 254 framebuffer_manager_.reset(); | 257 framebuffer_manager_.reset(); |
| 255 } | 258 } |
| 256 | 259 |
| 257 if (renderbuffer_manager_ != NULL) { | 260 if (renderbuffer_manager_ != NULL) { |
| 258 renderbuffer_manager_->Destroy(have_context); | 261 renderbuffer_manager_->Destroy(have_context); |
| 259 renderbuffer_manager_.reset(); | 262 renderbuffer_manager_.reset(); |
| 260 } | 263 } |
| 261 | 264 |
| 262 if (texture_manager_ != NULL) { | 265 if (texture_manager_ != NULL) { |
| 263 mailbox_manager_->DestroyOwnedTextures(texture_manager_.get(), | 266 mailbox_manager_->DestroyOwnedTextures(texture_manager_.get(), |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 GLenum pname, GLint min_required, uint32* v) { | 342 GLenum pname, GLint min_required, uint32* v) { |
| 340 uint32 value = 0; | 343 uint32 value = 0; |
| 341 GetIntegerv(pname, &value); | 344 GetIntegerv(pname, &value); |
| 342 bool result = CheckGLFeatureU(min_required, &value); | 345 bool result = CheckGLFeatureU(min_required, &value); |
| 343 *v = value; | 346 *v = value; |
| 344 return result; | 347 return result; |
| 345 } | 348 } |
| 346 | 349 |
| 347 } // namespace gles2 | 350 } // namespace gles2 |
| 348 } // namespace gpu | 351 } // namespace gpu |
| OLD | NEW |