| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 DCHECK(feature_info_); | 111 DCHECK(feature_info_); |
| 112 if (!mailbox_manager_.get()) | 112 if (!mailbox_manager_.get()) |
| 113 mailbox_manager_ = new MailboxManagerImpl; | 113 mailbox_manager_ = new MailboxManagerImpl; |
| 114 transfer_buffer_manager_ = new TransferBufferManager(memory_tracker_.get()); | 114 transfer_buffer_manager_ = new TransferBufferManager(memory_tracker_.get()); |
| 115 } | 115 } |
| 116 } | 116 } |
| 117 | 117 |
| 118 bool ContextGroup::Initialize(GLES2Decoder* decoder, | 118 bool ContextGroup::Initialize(GLES2Decoder* decoder, |
| 119 ContextType context_type, | 119 ContextType context_type, |
| 120 const DisallowedFeatures& disallowed_features) { | 120 const DisallowedFeatures& disallowed_features) { |
| 121 if (!gpu_preferences_.enable_unsafe_es3_apis && |
| 122 (context_type == CONTEXT_TYPE_OPENGLES3 || |
| 123 context_type == CONTEXT_TYPE_WEBGL2)) { |
| 124 DLOG(ERROR) << "ContextGroup::Initialize failed because ES3 APIs are " |
| 125 << "not available."; |
| 126 return false; |
| 127 } |
| 121 if (HaveContexts()) { | 128 if (HaveContexts()) { |
| 122 if (context_type != feature_info_->context_type()) { | 129 if (context_type != feature_info_->context_type()) { |
| 123 DLOG(ERROR) << "ContextGroup::Initialize failed because the type of " | 130 DLOG(ERROR) << "ContextGroup::Initialize failed because the type of " |
| 124 << "the context does not fit with the group."; | 131 << "the context does not fit with the group."; |
| 125 return false; | 132 return false; |
| 126 } | 133 } |
| 127 // If we've already initialized the group just add the context. | 134 // If we've already initialized the group just add the context. |
| 128 decoders_.push_back(base::AsWeakPtr<GLES2Decoder>(decoder)); | 135 decoders_.push_back(base::AsWeakPtr<GLES2Decoder>(decoder)); |
| 129 return true; | 136 return true; |
| 130 } | 137 } |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 GLuint client_id, GLuint* service_id) const { | 624 GLuint client_id, GLuint* service_id) const { |
| 618 Buffer* buffer = buffer_manager_->GetBuffer(client_id); | 625 Buffer* buffer = buffer_manager_->GetBuffer(client_id); |
| 619 if (!buffer) | 626 if (!buffer) |
| 620 return false; | 627 return false; |
| 621 *service_id = buffer->service_id(); | 628 *service_id = buffer->service_id(); |
| 622 return true; | 629 return true; |
| 623 } | 630 } |
| 624 | 631 |
| 625 } // namespace gles2 | 632 } // namespace gles2 |
| 626 } // namespace gpu | 633 } // namespace gpu |
| OLD | NEW |