| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 << "not available."; | 132 << "not available."; |
| 133 return false; | 133 return false; |
| 134 } | 134 } |
| 135 if (HaveContexts()) { | 135 if (HaveContexts()) { |
| 136 if (context_type != feature_info_->context_type()) { | 136 if (context_type != feature_info_->context_type()) { |
| 137 DLOG(ERROR) << "ContextGroup::Initialize failed because the type of " | 137 DLOG(ERROR) << "ContextGroup::Initialize failed because the type of " |
| 138 << "the context does not fit with the group."; | 138 << "the context does not fit with the group."; |
| 139 return false; | 139 return false; |
| 140 } | 140 } |
| 141 // If we've already initialized the group just add the context. | 141 // If we've already initialized the group just add the context. |
| 142 decoders_.push_back(base::AsWeakPtr<GLES2Decoder>(decoder)); | 142 decoders_.push_back(decoder->AsWeakPtr()); |
| 143 return true; | 143 return true; |
| 144 } | 144 } |
| 145 | 145 |
| 146 DisallowedFeatures adjusted_disallowed_features = | 146 DisallowedFeatures adjusted_disallowed_features = |
| 147 AdjustDisallowedFeatures(context_type, disallowed_features); | 147 AdjustDisallowedFeatures(context_type, disallowed_features); |
| 148 | 148 |
| 149 if (!feature_info_->Initialize(context_type, adjusted_disallowed_features)) { | 149 if (!feature_info_->Initialize(context_type, adjusted_disallowed_features)) { |
| 150 DLOG(ERROR) << "ContextGroup::Initialize failed because FeatureInfo " | 150 DLOG(ERROR) << "ContextGroup::Initialize failed because FeatureInfo " |
| 151 << "initialization failed."; | 151 << "initialization failed."; |
| 152 return false; | 152 return false; |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 program_cache_, max_varying_vectors_, max_draw_buffers_, | 447 program_cache_, max_varying_vectors_, max_draw_buffers_, |
| 448 max_dual_source_draw_buffers_, max_vertex_attribs_, gpu_preferences_, | 448 max_dual_source_draw_buffers_, max_vertex_attribs_, gpu_preferences_, |
| 449 feature_info_.get(), progress_reporter_)); | 449 feature_info_.get(), progress_reporter_)); |
| 450 | 450 |
| 451 if (!texture_manager_->Initialize()) { | 451 if (!texture_manager_->Initialize()) { |
| 452 DLOG(ERROR) << "Context::Group::Initialize failed because texture manager " | 452 DLOG(ERROR) << "Context::Group::Initialize failed because texture manager " |
| 453 << "failed to initialize."; | 453 << "failed to initialize."; |
| 454 return false; | 454 return false; |
| 455 } | 455 } |
| 456 | 456 |
| 457 decoders_.push_back(base::AsWeakPtr<GLES2Decoder>(decoder)); | 457 decoders_.push_back(decoder->AsWeakPtr()); |
| 458 return true; | 458 return true; |
| 459 } | 459 } |
| 460 | 460 |
| 461 namespace { | 461 namespace { |
| 462 | 462 |
| 463 bool IsNull(const base::WeakPtr<gles2::GLES2Decoder>& decoder) { | 463 bool IsNull(const base::WeakPtr<gles2::GLES2Decoder>& decoder) { |
| 464 return !decoder.get(); | 464 return !decoder.get(); |
| 465 } | 465 } |
| 466 | 466 |
| 467 template <typename T> | 467 template <typename T> |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 GLuint client_id, GLuint* service_id) const { | 619 GLuint client_id, GLuint* service_id) const { |
| 620 Buffer* buffer = buffer_manager_->GetBuffer(client_id); | 620 Buffer* buffer = buffer_manager_->GetBuffer(client_id); |
| 621 if (!buffer) | 621 if (!buffer) |
| 622 return false; | 622 return false; |
| 623 *service_id = buffer->service_id(); | 623 *service_id = buffer->service_id(); |
| 624 return true; | 624 return true; |
| 625 } | 625 } |
| 626 | 626 |
| 627 } // namespace gles2 | 627 } // namespace gles2 |
| 628 } // namespace gpu | 628 } // namespace gpu |
| OLD | NEW |