| 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" |
| 11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 12 #include "base/sys_info.h" | 12 #include "base/sys_info.h" |
| 13 #include "gpu/command_buffer/service/buffer_manager.h" | 13 #include "gpu/command_buffer/service/buffer_manager.h" |
| 14 #include "gpu/command_buffer/service/framebuffer_manager.h" | 14 #include "gpu/command_buffer/service/framebuffer_manager.h" |
| 15 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 15 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 16 #include "gpu/command_buffer/service/gpu_switches.h" | 16 #include "gpu/command_buffer/service/gpu_switches.h" |
| 17 #include "gpu/command_buffer/service/mailbox_manager_impl.h" | 17 #include "gpu/command_buffer/service/mailbox_manager_impl.h" |
| 18 #include "gpu/command_buffer/service/memory_tracking.h" | 18 #include "gpu/command_buffer/service/memory_tracking.h" |
| 19 #include "gpu/command_buffer/service/path_manager.h" |
| 19 #include "gpu/command_buffer/service/program_manager.h" | 20 #include "gpu/command_buffer/service/program_manager.h" |
| 20 #include "gpu/command_buffer/service/renderbuffer_manager.h" | 21 #include "gpu/command_buffer/service/renderbuffer_manager.h" |
| 21 #include "gpu/command_buffer/service/shader_manager.h" | 22 #include "gpu/command_buffer/service/shader_manager.h" |
| 22 #include "gpu/command_buffer/service/texture_manager.h" | 23 #include "gpu/command_buffer/service/texture_manager.h" |
| 23 #include "gpu/command_buffer/service/transfer_buffer_manager.h" | 24 #include "gpu/command_buffer/service/transfer_buffer_manager.h" |
| 24 #include "gpu/command_buffer/service/valuebuffer_manager.h" | 25 #include "gpu/command_buffer/service/valuebuffer_manager.h" |
| 25 #include "ui/gl/gl_implementation.h" | 26 #include "ui/gl/gl_implementation.h" |
| 26 | 27 |
| 27 namespace gpu { | 28 namespace gpu { |
| 28 namespace gles2 { | 29 namespace gles2 { |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 max_varying_vectors_, | 288 max_varying_vectors_, |
| 288 static_cast<uint32>(feature_info_->workarounds().max_varying_vectors)); | 289 static_cast<uint32>(feature_info_->workarounds().max_varying_vectors)); |
| 289 } | 290 } |
| 290 if (feature_info_->workarounds().max_vertex_uniform_vectors) { | 291 if (feature_info_->workarounds().max_vertex_uniform_vectors) { |
| 291 max_vertex_uniform_vectors_ = | 292 max_vertex_uniform_vectors_ = |
| 292 std::min(max_vertex_uniform_vectors_, | 293 std::min(max_vertex_uniform_vectors_, |
| 293 static_cast<uint32>( | 294 static_cast<uint32>( |
| 294 feature_info_->workarounds().max_vertex_uniform_vectors)); | 295 feature_info_->workarounds().max_vertex_uniform_vectors)); |
| 295 } | 296 } |
| 296 | 297 |
| 298 path_manager_.reset(new PathManager()); |
| 299 |
| 297 program_manager_.reset(new ProgramManager( | 300 program_manager_.reset(new ProgramManager( |
| 298 program_cache_, max_varying_vectors_)); | 301 program_cache_, max_varying_vectors_)); |
| 299 | 302 |
| 300 if (!texture_manager_->Initialize()) { | 303 if (!texture_manager_->Initialize()) { |
| 301 LOG(ERROR) << "Context::Group::Initialize failed because texture manager " | 304 LOG(ERROR) << "Context::Group::Initialize failed because texture manager " |
| 302 << "failed to initialize."; | 305 << "failed to initialize."; |
| 303 return false; | 306 return false; |
| 304 } | 307 } |
| 305 | 308 |
| 306 decoders_.push_back(base::AsWeakPtr<GLES2Decoder>(decoder)); | 309 decoders_.push_back(base::AsWeakPtr<GLES2Decoder>(decoder)); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 if (renderbuffer_manager_ != NULL) { | 361 if (renderbuffer_manager_ != NULL) { |
| 359 renderbuffer_manager_->Destroy(have_context); | 362 renderbuffer_manager_->Destroy(have_context); |
| 360 renderbuffer_manager_.reset(); | 363 renderbuffer_manager_.reset(); |
| 361 } | 364 } |
| 362 | 365 |
| 363 if (texture_manager_ != NULL) { | 366 if (texture_manager_ != NULL) { |
| 364 texture_manager_->Destroy(have_context); | 367 texture_manager_->Destroy(have_context); |
| 365 texture_manager_.reset(); | 368 texture_manager_.reset(); |
| 366 } | 369 } |
| 367 | 370 |
| 371 if (path_manager_ != NULL) { |
| 372 path_manager_->Destroy(have_context); |
| 373 path_manager_.reset(); |
| 374 } |
| 375 |
| 368 if (program_manager_ != NULL) { | 376 if (program_manager_ != NULL) { |
| 369 program_manager_->Destroy(have_context); | 377 program_manager_->Destroy(have_context); |
| 370 program_manager_.reset(); | 378 program_manager_.reset(); |
| 371 } | 379 } |
| 372 | 380 |
| 373 if (shader_manager_ != NULL) { | 381 if (shader_manager_ != NULL) { |
| 374 shader_manager_->Destroy(have_context); | 382 shader_manager_->Destroy(have_context); |
| 375 shader_manager_.reset(); | 383 shader_manager_.reset(); |
| 376 } | 384 } |
| 377 | 385 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 GLuint client_id, GLuint* service_id) const { | 453 GLuint client_id, GLuint* service_id) const { |
| 446 Buffer* buffer = buffer_manager_->GetBuffer(client_id); | 454 Buffer* buffer = buffer_manager_->GetBuffer(client_id); |
| 447 if (!buffer) | 455 if (!buffer) |
| 448 return false; | 456 return false; |
| 449 *service_id = buffer->service_id(); | 457 *service_id = buffer->service_id(); |
| 450 return true; | 458 return true; |
| 451 } | 459 } |
| 452 | 460 |
| 453 } // namespace gles2 | 461 } // namespace gles2 |
| 454 } // namespace gpu | 462 } // namespace gpu |
| OLD | NEW |