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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef GPU_PREFERENCES_H_
6 #define GPU_PREFERENCES_H_
7
8 #include <stddef.h>
9
10 #include <set>
11
12 #include "base/macros.h"
13 #include "build/build_config.h"
14 #include "gpu/command_buffer/common/constants.h"
15
16 namespace base {
17
18 template <typename T>
19 struct DefaultSingletonTraits;
20
21 };
22
23 namespace gpu {
24
25 struct GpuPreferences {
26 // Prioritizes the UI's command stream in the GPU process
27 bool ui_prioritize_in_gpu_process = false;
28
29 // Turn off gpu program caching
30 bool disable_gpu_program_cahce = false;
31
32 #if defined(OS_MACOSX) && !defined(OS_IOS)
33 // Fall back to using CAOpenGLLayers display content, instead of the IOSurface
34 // based overlay display path.
35 bool disable_mac_overlays = false;
36
37 // Disable use of cross-process CALayers to display content directly from the
38 // GPU process on Mac.
39 bool disable_remote_core_animation = false;
40
41 // Show borders around CALayers corresponding to overlays and partial damage.
42 bool show_mac_overlays_borders = false;
43 #endif
44
45
46 #if defined(OS_CHROMEOS)
47 // Disables VA-API accelerated video encode.
48 bool disable_vaapi_accelerated_video_encode = false;
49 #endif
50
51 // Disables use of D3D11.
52 bool disable_d3d11 = false;
53
54 // Stop the GPU from synchronizing on the vsync before presenting.
55 // We can select from the options below:
56 // beginframe : Next frame can start without any delay on cc::scheduler.
57 // gpu : Disable gpu vsync.
58 // default: Set both flags.
59 bool disable_gpu_vsync = false;
60
61 // Turns on GPU logging (debug build only).
62 bool enable_gpu_service_logging = false;
63
64 // Turns on calling TRACE for every GL call.
65 bool enable_gpu_service_tracing = false;
66
67 // Runs the renderer and plugins in the same process as the browser.
68 bool single_process = false;
69
70 // Run the GPU process as a thread in the browser process.
71 bool in_process_gpu = false;
72
73 // Ignores GPU blacklist.
74 bool ignore_gpu_black_list = false;
75
76 // Disable hardware acceleration of mjpeg decode for captured frame, where
77 // available.
78 bool disable_accelerated_mjpeg_decode = false;
79
80 // Disables hardware acceleration of video decode, where available.
81 bool disable_accelerated_video_decode = false;
82
83 // Enables experimental hardware acceleration for VP8/VP9 video decoding.
84 bool enable_accelerated_vpx_decode = false;
85
86 // ===================================
87 // settings from //gpu/config/gpu_switches.h
88 std::set<int> gpu_driver_bug_workarounds;
89
90 // ===================================
91 // settings from //gpu/command_buffer/service/gpu_switches.cc
92
93 // Always return success when compiling a shader. Linking will still fail.
94 bool compile_shader_always_succeeds = false;
95
96 // Disable the GL error log limit.
97 bool disable_gl_error_limit = false;
98
99 // Disable the GLSL translator.
100 bool disable_glsl_translator = false;
101
102 // Disable workarounds for various GPU driver bugs.
103 bool disable_gpu_driver_bug_workarounds = false;
104
105 // Turn off user-defined name hashing in shaders.
106 bool disable_shader_name_hashing = false;
107
108 // Turn on Logging GPU commands.
109 bool enable_gpu_command_logging = false;
110
111 // Turn on Calling GL Error after every command.
112 bool enable_gpu_debugging = false;
113
114 // Enable GPU service logging.
115 bool enable_gpu_service_logging_gpu = false;
116
117 // Turn off gpu program caching
118 bool disable_gpu_program_cache = false;
119
120 // Enforce GL minimums.
121 bool enforce_gl_minimums = false;
122
123 // Sets the total amount of memory that may be allocated for GPU resources
124 size_t force_gpu_mem_available = 0;
125
126 // Sets the maximum size of the in-memory gpu program cache, in kb
127 size_t gpu_program_cache_size = kDefaultMaxProgramCacheMemoryBytes;
128
129 // Disables the GPU shader on disk cache.
130 bool disable_gpu_shader_disk_cache = false;
131
132 // Allows async texture uploads (off main thread) via GL context sharing.
133 bool enable_share_group_async_texture_upload = false;
134
135 // Enable WebGL subscribe uniform extension.
136 bool enable_subscribe_uniform_extension = false;
137
138 // Simulates shared textures when share groups are not available.
139 // Not available everywhere.
140 bool enable_threaded_texture_mailboxes = false;
141
142 // Include ANGLE's intermediate representation (AST) output in shader
143 // compilation info logs.
144 bool gl_shader_interm_output = false;
145
146 // Emulate ESSL lowp and mediump float precisions by mutating the shaders to
147 // round intermediate values in ANGLE.
148 bool emulate_shader_precision = false;
149
150 // Enables using path rendering implementation implemented currently
151 // in NV_path_rendering OpenGL extension. Requires compatible hardware
152 // and driver. This is used in GPU rasterization.
153 bool enable_gl_path_rendering = false;
154
155 // ===================================
156 // settings from //ui/gl/gl_switches.h
157 bool enable_unsafe_es3_apis = false;
158
159 static GpuPreferences* GetInstance();
160
161 private:
162 friend struct base::DefaultSingletonTraits<GpuPreferences>;
163
164 GpuPreferences();
165 ~GpuPreferences();
166
167 DISALLOW_COPY_AND_ASSIGN(GpuPreferences);
168 };
169
170 } // namespace gpu
171
172 #endif // GPU_PREFERENCES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698