Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Unified Diff: gpu/command_buffer/service/context_group.cc

Issue 1716813002: Use GpuPreferences to avoid directly accessing switches in gpu related code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 a1dc17cc9d5d487ab6b0a0ef97be850e79d038b9..c16ca3bfbe8adb7f5e3a222eb45e3840d079c045 100644
--- a/gpu/command_buffer/service/context_group.cc
+++ b/gpu/command_buffer/service/context_group.cc
@@ -14,7 +14,7 @@
#include "gpu/command_buffer/common/value_state.h"
#include "gpu/command_buffer/service/buffer_manager.h"
#include "gpu/command_buffer/service/framebuffer_manager.h"
-#include "gpu/command_buffer/service/gpu_switches.h"
+#include "gpu/command_buffer/service/gpu_preferences.h"
#include "gpu/command_buffer/service/mailbox_manager_impl.h"
#include "gpu/command_buffer/service/path_manager.h"
#include "gpu/command_buffer/service/program_manager.h"
@@ -58,6 +58,7 @@ DisallowedFeatures AdjustDisallowedFeatures(
} // namespace anonymous
ContextGroup::ContextGroup(
+ const GpuPreferences& gpu_preferences,
const scoped_refptr<MailboxManager>& mailbox_manager,
const scoped_refptr<MemoryTracker>& memory_tracker,
const scoped_refptr<ShaderTranslatorCache>& shader_translator_cache,
@@ -67,7 +68,8 @@ ContextGroup::ContextGroup(
const scoped_refptr<SubscriptionRefSet>& subscription_ref_set,
const scoped_refptr<ValueStateMap>& pending_valuebuffer_state,
bool bind_generates_resource)
- : mailbox_manager_(mailbox_manager),
+ : gpu_preferences_(gpu_preferences),
+ mailbox_manager_(mailbox_manager),
memory_tracker_(memory_tracker),
shader_translator_cache_(shader_translator_cache),
#if defined(OS_MACOSX)
@@ -83,11 +85,7 @@ ContextGroup::ContextGroup(
#endif
subscription_ref_set_(subscription_ref_set),
pending_valuebuffer_state_(pending_valuebuffer_state),
- enforce_gl_minimums_(
- base::CommandLine::InitializedForCurrentProcess()
- ? base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnforceGLMinimums)
- : false),
+ enforce_gl_minimums_(gpu_preferences_.enforce_gl_minimums),
bind_generates_resource_(bind_generates_resource),
max_vertex_attribs_(0u),
max_texture_units_(0u),
@@ -347,7 +345,8 @@ bool ContextGroup::Initialize(GLES2Decoder* decoder,
program_manager_.reset(
new ProgramManager(program_cache_, max_varying_vectors_,
- max_dual_source_draw_buffers_, feature_info_.get()));
+ max_dual_source_draw_buffers_, gpu_preferences_,
+ feature_info_.get()));
if (!texture_manager_->Initialize()) {
LOG(ERROR) << "Context::Group::Initialize failed because texture manager "

Powered by Google App Engine
This is Rietveld 408576698