Index: gpu/command_buffer/service/gles2_cmd_decoder.cc |
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
index 2d1d90a1018105c240fa2caad90e4844cf0380c9..46fa6fe42d19e1e57f34e0d12757cce6d28ba1ad 100644 |
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc |
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
@@ -42,6 +42,7 @@ |
#include "gpu/command_buffer/service/gles2_cmd_clear_framebuffer.h" |
#include "gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h" |
#include "gpu/command_buffer/service/gles2_cmd_validation.h" |
+#include "gpu/command_buffer/service/gpu_preferences.h" |
#include "gpu/command_buffer/service/gpu_state_tracer.h" |
#include "gpu/command_buffer/service/gpu_switches.h" |
Fady Samuel
2016/02/25 16:26:33
No longer necessary?
Peng
2016/02/25 17:13:22
Done.
|
#include "gpu/command_buffer/service/gpu_tracer.h" |
@@ -2578,10 +2579,8 @@ GLES2DecoderImpl::GLES2DecoderImpl(ContextGroup* group) |
shader_texture_lod_explicitly_enabled_(false), |
compile_shader_always_succeeds_(false), |
lose_context_when_out_of_memory_(false), |
- service_logging_(base::CommandLine::InitializedForCurrentProcess() |
- ? base::CommandLine::ForCurrentProcess()->HasSwitch( |
- switches::kEnableGPUServiceLoggingGPU) |
- : false), |
+ service_logging_( |
+ group_->gpu_preferences().enable_gpu_service_logging_gpu), |
viewport_max_width_(0), |
viewport_max_height_(0), |
texture_state_(group_->feature_info()->workarounds()), |
@@ -2621,21 +2620,14 @@ bool GLES2DecoderImpl::Initialize(const scoped_refptr<gfx::GLSurface>& surface, |
set_initialized(); |
gpu_state_tracer_ = GPUStateTracer::Create(&state_); |
- if (base::CommandLine::InitializedForCurrentProcess()) { |
- if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
- switches::kEnableGPUDebugging)) { |
- set_debug(true); |
- } |
+ if (group_->gpu_preferences().enable_gpu_debugging) |
+ set_debug(true); |
- if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
- switches::kEnableGPUCommandLogging)) { |
- set_log_commands(true); |
- } |
+ if (group_->gpu_preferences().enable_gpu_command_logging) |
+ set_log_commands(true); |
- compile_shader_always_succeeds_ = |
- base::CommandLine::ForCurrentProcess()->HasSwitch( |
- switches::kCompileShaderAlwaysSucceeds); |
- } |
+ compile_shader_always_succeeds_ = |
+ group_->gpu_preferences().compile_shader_always_succeeds; |
// Take ownership of the context and surface. The surface can be replaced with |
// SetSurface. |
@@ -3306,10 +3298,8 @@ bool GLES2DecoderImpl::InitializeShaderTranslator() { |
if (workarounds().remove_pow_with_constant_exponent) |
driver_bug_workarounds |= SH_REMOVE_POW_WITH_CONSTANT_EXPONENT; |
- if (base::CommandLine::InitializedForCurrentProcess() && |
- base::CommandLine::ForCurrentProcess()->HasSwitch( |
- switches::kEmulateShaderPrecision)) |
- resources.WEBGL_debug_shader_precision = true; |
+ resources.WEBGL_debug_shader_precision = |
+ group_->gpu_preferences().emulate_shader_precision; |
ShShaderOutput shader_output_language = |
ShaderTranslator::GetShaderOutputLanguageForContext( |