summaryrefslogtreecommitdiffstats
path: root/android_webview/browser
diff options
context:
space:
mode:
authorpenghuang <penghuang@chromium.org>2016-03-09 19:32:57 -0800
committerCommit bot <commit-bot@chromium.org>2016-03-10 03:34:55 +0000
commit2084d99587adfa5eeb4025d5a12c8856fe8d2f3a (patch)
tree96e83484ba4d689df1830b76db0fd9224ff3891c /android_webview/browser
parent7271d8b2d16634d1062a1f9b94536f6d2956aef6 (diff)
downloadchromium_src-2084d99587adfa5eeb4025d5a12c8856fe8d2f3a.zip
chromium_src-2084d99587adfa5eeb4025d5a12c8856fe8d2f3a.tar.gz
chromium_src-2084d99587adfa5eeb4025d5a12c8856fe8d2f3a.tar.bz2
Get rid of gpu related switches by passing gpu::GpuPreferences via IPC.
BUG=590825 CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel;tryserver.chromium.mac:mac_optional_gpu_tests_rel Committed: https://crrev.com/248b114c9d3034964c7259222712dfcccfad8f48 Cr-Commit-Position: refs/heads/master@{#379651} Review URL: https://codereview.chromium.org/1753383003 Cr-Commit-Position: refs/heads/master@{#380320}
Diffstat (limited to 'android_webview/browser')
-rw-r--r--android_webview/browser/deferred_gpu_command_service.cc73
1 files changed, 3 insertions, 70 deletions
diff --git a/android_webview/browser/deferred_gpu_command_service.cc b/android_webview/browser/deferred_gpu_command_service.cc
index d2a19f6..9021deb 100644
--- a/android_webview/browser/deferred_gpu_command_service.cc
+++ b/android_webview/browser/deferred_gpu_command_service.cc
@@ -12,6 +12,7 @@
#include "base/synchronization/lock.h"
#include "base/trace_event/trace_event.h"
#include "content/public/browser/android/synchronous_compositor.h"
+#include "content/public/browser/gpu_utils.h"
#include "content/public/common/content_switches.h"
#include "gpu/command_buffer/service/framebuffer_completeness_cache.h"
#include "gpu/command_buffer/service/gpu_preferences.h"
@@ -27,75 +28,6 @@ namespace {
base::LazyInstance<scoped_refptr<DeferredGpuCommandService> >
g_service = LAZY_INSTANCE_INITIALIZER;
-bool GetSizeTFromSwitch(const base::CommandLine* command_line,
- const base::StringPiece& switch_string,
- size_t* value) {
- if (!command_line->HasSwitch(switch_string))
- return false;
- std::string switch_value(command_line->GetSwitchValueASCII(switch_string));
- return base::StringToSizeT(switch_value, value);
-}
-
-gpu::GpuPreferences GetGpuPreferencesFromCommandLine() {
- // TODO(penghuang): share below code with content/gpu/gpu_child_thread.cc
- // http://crbug.com/590825
- DCHECK(base::CommandLine::InitializedForCurrentProcess());
- const base::CommandLine* command_line =
- base::CommandLine::ForCurrentProcess();
- gpu::GpuPreferences gpu_preferences;
- gpu_preferences.single_process =
- command_line->HasSwitch(switches::kSingleProcess);
- gpu_preferences.in_process_gpu =
- command_line->HasSwitch(switches::kInProcessGPU);
- gpu_preferences.ui_prioritize_in_gpu_process =
- command_line->HasSwitch(switches::kUIPrioritizeInGpuProcess);
- gpu_preferences.compile_shader_always_succeeds =
- command_line->HasSwitch(switches::kCompileShaderAlwaysSucceeds);
- gpu_preferences.disable_gl_error_limit =
- command_line->HasSwitch(switches::kDisableGLErrorLimit);
- gpu_preferences.disable_glsl_translator =
- command_line->HasSwitch(switches::kDisableGLSLTranslator);
- gpu_preferences.disable_gpu_driver_bug_workarounds =
- command_line->HasSwitch(switches::kDisableGpuDriverBugWorkarounds);
- gpu_preferences.disable_shader_name_hashing =
- command_line->HasSwitch(switches::kDisableShaderNameHashing);
- gpu_preferences.enable_gpu_command_logging =
- command_line->HasSwitch(switches::kEnableGPUCommandLogging);
- gpu_preferences.enable_gpu_debugging =
- command_line->HasSwitch(switches::kEnableGPUDebugging);
- gpu_preferences.enable_gpu_service_logging_gpu =
- command_line->HasSwitch(switches::kEnableGPUServiceLoggingGPU);
- gpu_preferences.disable_gpu_program_cache =
- command_line->HasSwitch(switches::kDisableGpuProgramCache);
- gpu_preferences.enforce_gl_minimums =
- command_line->HasSwitch(switches::kEnforceGLMinimums);
- if (GetSizeTFromSwitch(command_line, switches::kForceGpuMemAvailableMb,
- &gpu_preferences.force_gpu_mem_available)) {
- gpu_preferences.force_gpu_mem_available *= 1024 * 1024;
- }
- if (GetSizeTFromSwitch(command_line, switches::kGpuProgramCacheSizeKb,
- &gpu_preferences.gpu_program_cache_size)) {
- gpu_preferences.gpu_program_cache_size *= 1024;
- }
- gpu_preferences.enable_share_group_async_texture_upload =
- command_line->HasSwitch(switches::kEnableShareGroupAsyncTextureUpload);
- gpu_preferences.enable_subscribe_uniform_extension =
- command_line->HasSwitch(switches::kEnableSubscribeUniformExtension);
- gpu_preferences.enable_threaded_texture_mailboxes =
- command_line->HasSwitch(switches::kEnableThreadedTextureMailboxes);
- gpu_preferences.gl_shader_interm_output =
- command_line->HasSwitch(switches::kGLShaderIntermOutput);
- gpu_preferences.emulate_shader_precision =
- command_line->HasSwitch(switches::kEmulateShaderPrecision);
- gpu_preferences.enable_gpu_service_logging =
- command_line->HasSwitch(switches::kEnableGPUServiceLogging);
- gpu_preferences.enable_gpu_service_tracing =
- command_line->HasSwitch(switches::kEnableGPUServiceTracing);
- gpu_preferences.enable_unsafe_es3_apis =
- command_line->HasSwitch(switches::kEnableUnsafeES3APIs);
- return gpu_preferences;
-}
-
} // namespace
base::LazyInstance<base::ThreadLocalBoolean> ScopedAllowGL::allow_gl;
@@ -140,7 +72,8 @@ DeferredGpuCommandService* DeferredGpuCommandService::GetInstance() {
}
DeferredGpuCommandService::DeferredGpuCommandService()
- : gpu::InProcessCommandBuffer::Service(GetGpuPreferencesFromCommandLine()),
+ : gpu::InProcessCommandBuffer::Service(
+ content::GetGpuPreferencesFromCommandLine()),
sync_point_manager_(new gpu::SyncPointManager(true)) {
}