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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 << "the context does not fit with the group."; | 99 << "the context does not fit with the group."; |
100 return false; | 100 return false; |
101 } | 101 } |
102 | 102 |
103 // If we've already initialized the group just add the context. | 103 // If we've already initialized the group just add the context. |
104 if (HaveContexts()) { | 104 if (HaveContexts()) { |
105 decoders_.push_back(base::AsWeakPtr<GLES2Decoder>(decoder)); | 105 decoders_.push_back(base::AsWeakPtr<GLES2Decoder>(decoder)); |
106 return true; | 106 return true; |
107 } | 107 } |
108 | 108 |
109 if (!feature_info_->Initialize(disallowed_features)) { | 109 if (!feature_info_->Initialize(context_type, disallowed_features)) { |
110 LOG(ERROR) << "ContextGroup::Initialize failed because FeatureInfo " | 110 LOG(ERROR) << "ContextGroup::Initialize failed because FeatureInfo " |
111 << "initialization failed."; | 111 << "initialization failed."; |
112 return false; | 112 return false; |
113 } | 113 } |
114 | 114 |
115 transfer_buffer_manager_->Initialize(); | 115 transfer_buffer_manager_->Initialize(); |
116 | 116 |
117 const GLint kMinRenderbufferSize = 512; // GL says 1 pixel! | 117 const GLint kMinRenderbufferSize = 512; // GL says 1 pixel! |
118 GLint max_renderbuffer_size = 0; | 118 GLint max_renderbuffer_size = 0; |
119 if (!QueryGLFeature( | 119 if (!QueryGLFeature( |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 GLuint client_id, GLuint* service_id) const { | 445 GLuint client_id, GLuint* service_id) const { |
446 Buffer* buffer = buffer_manager_->GetBuffer(client_id); | 446 Buffer* buffer = buffer_manager_->GetBuffer(client_id); |
447 if (!buffer) | 447 if (!buffer) |
448 return false; | 448 return false; |
449 *service_id = buffer->service_id(); | 449 *service_id = buffer->service_id(); |
450 return true; | 450 return true; |
451 } | 451 } |
452 | 452 |
453 } // namespace gles2 | 453 } // namespace gles2 |
454 } // namespace gpu | 454 } // namespace gpu |
OLD | NEW |