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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 max_color_attachments_(1u), | 97 max_color_attachments_(1u), |
98 max_draw_buffers_(1u), | 98 max_draw_buffers_(1u), |
99 max_dual_source_draw_buffers_(0u), | 99 max_dual_source_draw_buffers_(0u), |
100 max_vertex_output_components_(0u), | 100 max_vertex_output_components_(0u), |
101 max_fragment_input_components_(0u), | 101 max_fragment_input_components_(0u), |
102 min_program_texel_offset_(0), | 102 min_program_texel_offset_(0), |
103 max_program_texel_offset_(0), | 103 max_program_texel_offset_(0), |
104 program_cache_(NULL), | 104 program_cache_(NULL), |
105 feature_info_(feature_info) { | 105 feature_info_(feature_info) { |
106 { | 106 { |
107 DCHECK(feature_info_); | |
108 if (!mailbox_manager_.get()) | 107 if (!mailbox_manager_.get()) |
109 mailbox_manager_ = new MailboxManagerImpl; | 108 mailbox_manager_ = new MailboxManagerImpl; |
110 if (!subscription_ref_set_.get()) | 109 if (!subscription_ref_set_.get()) |
111 subscription_ref_set_ = new SubscriptionRefSet(); | 110 subscription_ref_set_ = new SubscriptionRefSet(); |
112 if (!pending_valuebuffer_state_.get()) | 111 if (!pending_valuebuffer_state_.get()) |
113 pending_valuebuffer_state_ = new ValueStateMap(); | 112 pending_valuebuffer_state_ = new ValueStateMap(); |
| 113 if (!feature_info.get()) |
| 114 feature_info_ = new FeatureInfo; |
114 transfer_buffer_manager_ = new TransferBufferManager(memory_tracker_.get()); | 115 transfer_buffer_manager_ = new TransferBufferManager(memory_tracker_.get()); |
115 } | 116 } |
116 } | 117 } |
117 | 118 |
118 bool ContextGroup::Initialize(GLES2Decoder* decoder, | 119 bool ContextGroup::Initialize(GLES2Decoder* decoder, |
119 ContextType context_type, | 120 ContextType context_type, |
120 const DisallowedFeatures& disallowed_features) { | 121 const DisallowedFeatures& disallowed_features) { |
121 if (HaveContexts()) { | 122 if (HaveContexts()) { |
122 if (context_type != feature_info_->context_type()) { | 123 if (context_type != feature_info_->context_type()) { |
123 LOG(ERROR) << "ContextGroup::Initialize failed because the type of " | 124 LOG(ERROR) << "ContextGroup::Initialize failed because the type of " |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 GLuint client_id, GLuint* service_id) const { | 566 GLuint client_id, GLuint* service_id) const { |
566 Buffer* buffer = buffer_manager_->GetBuffer(client_id); | 567 Buffer* buffer = buffer_manager_->GetBuffer(client_id); |
567 if (!buffer) | 568 if (!buffer) |
568 return false; | 569 return false; |
569 *service_id = buffer->service_id(); | 570 *service_id = buffer->service_id(); |
570 return true; | 571 return true; |
571 } | 572 } |
572 | 573 |
573 } // namespace gles2 | 574 } // namespace gles2 |
574 } // namespace gpu | 575 } // namespace gpu |
OLD | NEW |