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

Unified Diff: gpu/command_buffer/service/gpu_preferences.h

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/gpu_preferences.h
diff --git a/gpu/command_buffer/service/gpu_preferences.h b/gpu/command_buffer/service/gpu_preferences.h
new file mode 100644
index 0000000000000000000000000000000000000000..765efbda89e5b86535cf2f1c0eb8cf62a815af0b
--- /dev/null
+++ b/gpu/command_buffer/service/gpu_preferences.h
@@ -0,0 +1,172 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef GPU_PREFERENCES_H_
+#define GPU_PREFERENCES_H_
+
+#include <stddef.h>
+
+#include <set>
+
+#include "base/macros.h"
+#include "build/build_config.h"
+#include "gpu/command_buffer/common/constants.h"
+
+namespace base {
+
+template <typename T>
+struct DefaultSingletonTraits;
+
+};
+
+namespace gpu {
+
+struct GpuPreferences {
+ // Prioritizes the UI's command stream in the GPU process
+ bool ui_prioritize_in_gpu_process = false;
+
+ // Turn off gpu program caching
+ bool disable_gpu_program_cahce = false;
+
+#if defined(OS_MACOSX) && !defined(OS_IOS)
+ // Fall back to using CAOpenGLLayers display content, instead of the IOSurface
+ // based overlay display path.
+ bool disable_mac_overlays = false;
+
+ // Disable use of cross-process CALayers to display content directly from the
+ // GPU process on Mac.
+ bool disable_remote_core_animation = false;
+
+ // Show borders around CALayers corresponding to overlays and partial damage.
+ bool show_mac_overlays_borders = false;
+#endif
+
+
+#if defined(OS_CHROMEOS)
+ // Disables VA-API accelerated video encode.
+ bool disable_vaapi_accelerated_video_encode = false;
+#endif
+
+ // Disables use of D3D11.
+ bool disable_d3d11 = false;
+
+ // Stop the GPU from synchronizing on the vsync before presenting.
+ // We can select from the options below:
+ // beginframe : Next frame can start without any delay on cc::scheduler.
+ // gpu : Disable gpu vsync.
+ // default: Set both flags.
+ bool disable_gpu_vsync = false;
+
+ // Turns on GPU logging (debug build only).
+ bool enable_gpu_service_logging = false;
+
+ // Turns on calling TRACE for every GL call.
+ bool enable_gpu_service_tracing = false;
+
+ // Runs the renderer and plugins in the same process as the browser.
+ bool single_process = false;
+
+ // Run the GPU process as a thread in the browser process.
+ bool in_process_gpu = false;
+
+ // Ignores GPU blacklist.
+ bool ignore_gpu_black_list = false;
+
+ // Disable hardware acceleration of mjpeg decode for captured frame, where
+ // available.
+ bool disable_accelerated_mjpeg_decode = false;
+
+ // Disables hardware acceleration of video decode, where available.
+ bool disable_accelerated_video_decode = false;
+
+ // Enables experimental hardware acceleration for VP8/VP9 video decoding.
+ bool enable_accelerated_vpx_decode = false;
+
+ // ===================================
+ // settings from //gpu/config/gpu_switches.h
+ std::set<int> gpu_driver_bug_workarounds;
+
+ // ===================================
+ // settings from //gpu/command_buffer/service/gpu_switches.cc
+
+ // Always return success when compiling a shader. Linking will still fail.
+ bool compile_shader_always_succeeds = false;
+
+ // Disable the GL error log limit.
+ bool disable_gl_error_limit = false;
+
+ // Disable the GLSL translator.
+ bool disable_glsl_translator = false;
+
+ // Disable workarounds for various GPU driver bugs.
+ bool disable_gpu_driver_bug_workarounds = false;
+
+ // Turn off user-defined name hashing in shaders.
+ bool disable_shader_name_hashing = false;
+
+ // Turn on Logging GPU commands.
+ bool enable_gpu_command_logging = false;
+
+ // Turn on Calling GL Error after every command.
+ bool enable_gpu_debugging = false;
+
+ // Enable GPU service logging.
+ bool enable_gpu_service_logging_gpu = false;
+
+ // Turn off gpu program caching
+ bool disable_gpu_program_cache = false;
+
+ // Enforce GL minimums.
+ bool enforce_gl_minimums = false;
+
+ // Sets the total amount of memory that may be allocated for GPU resources
+ size_t force_gpu_mem_available = 0;
+
+ // Sets the maximum size of the in-memory gpu program cache, in kb
+ size_t gpu_program_cache_size = kDefaultMaxProgramCacheMemoryBytes;
+
+ // Disables the GPU shader on disk cache.
+ bool disable_gpu_shader_disk_cache = false;
+
+ // Allows async texture uploads (off main thread) via GL context sharing.
+ bool enable_share_group_async_texture_upload = false;
+
+ // Enable WebGL subscribe uniform extension.
+ bool enable_subscribe_uniform_extension = false;
+
+ // Simulates shared textures when share groups are not available.
+ // Not available everywhere.
+ bool enable_threaded_texture_mailboxes = false;
+
+ // Include ANGLE's intermediate representation (AST) output in shader
+ // compilation info logs.
+ bool gl_shader_interm_output = false;
+
+ // Emulate ESSL lowp and mediump float precisions by mutating the shaders to
+ // round intermediate values in ANGLE.
+ bool emulate_shader_precision = false;
+
+ // Enables using path rendering implementation implemented currently
+ // in NV_path_rendering OpenGL extension. Requires compatible hardware
+ // and driver. This is used in GPU rasterization.
+ bool enable_gl_path_rendering = false;
+
+ // ===================================
+ // settings from //ui/gl/gl_switches.h
+ bool enable_unsafe_es3_apis = false;
+
+ static GpuPreferences* GetInstance();
+
+ private:
+ friend struct base::DefaultSingletonTraits<GpuPreferences>;
+
+ GpuPreferences();
+ ~GpuPreferences();
+
+ DISALLOW_COPY_AND_ASSIGN(GpuPreferences);
+};
+
+} // namespace gpu
+
+#endif // GPU_PREFERENCES_H_

Powered by Google App Engine
This is Rietveld 408576698