Index: gpu/command_buffer/service/context_group.cc |
diff --git a/gpu/command_buffer/service/context_group.cc b/gpu/command_buffer/service/context_group.cc |
index e5b4974a8f413573f6cad86219ee05520faacabe..e22459a7fcc26a2f6ba6db256ee7236dddf70f18 100644 |
--- a/gpu/command_buffer/service/context_group.cc |
+++ b/gpu/command_buffer/service/context_group.cc |
@@ -36,8 +36,7 @@ ContextGroup::ContextGroup( |
const scoped_refptr<SubscriptionRefSet>& subscription_ref_set, |
const scoped_refptr<ValueStateMap>& pending_valuebuffer_state, |
bool bind_generates_resource) |
- : context_type_(CONTEXT_TYPE_OPENGLES2), |
- mailbox_manager_(mailbox_manager), |
+ : mailbox_manager_(mailbox_manager), |
memory_tracker_(memory_tracker), |
shader_translator_cache_(shader_translator_cache), |
#if defined(OS_MACOSX) |
@@ -92,21 +91,18 @@ static void GetIntegerv(GLenum pname, uint32* var) { |
bool ContextGroup::Initialize(GLES2Decoder* decoder, |
ContextType context_type, |
const DisallowedFeatures& disallowed_features) { |
- if (!HaveContexts()) { |
- context_type_ = context_type; |
- } else if (context_type_ != context_type) { |
- LOG(ERROR) << "ContextGroup::Initialize failed because the type of " |
- << "the context does not fit with the group."; |
- return false; |
- } |
- |
- // If we've already initialized the group just add the context. |
if (HaveContexts()) { |
+ if (context_type != feature_info_->context_type()) { |
+ LOG(ERROR) << "ContextGroup::Initialize failed because the type of " |
+ << "the context does not fit with the group."; |
+ return false; |
+ } |
+ // If we've already initialized the group just add the context. |
decoders_.push_back(base::AsWeakPtr<GLES2Decoder>(decoder)); |
return true; |
} |
- if (!feature_info_->Initialize(disallowed_features)) { |
+ if (!feature_info_->Initialize(context_type, disallowed_features)) { |
LOG(ERROR) << "ContextGroup::Initialize failed because FeatureInfo " |
<< "initialization failed."; |
return false; |
@@ -146,9 +142,9 @@ bool ContextGroup::Initialize(GLES2Decoder* decoder, |
buffer_manager_.reset( |
new BufferManager(memory_tracker_.get(), feature_info_.get())); |
- framebuffer_manager_.reset( |
- new FramebufferManager(max_draw_buffers_, max_color_attachments_, |
- context_type, framebuffer_completeness_cache_)); |
+ framebuffer_manager_.reset(new FramebufferManager( |
+ max_draw_buffers_, max_color_attachments_, feature_info_->context_type(), |
+ framebuffer_completeness_cache_)); |
renderbuffer_manager_.reset(new RenderbufferManager( |
memory_tracker_.get(), max_renderbuffer_size, max_samples, |
feature_info_.get())); |