Chromium Code Reviews| OLD | NEW |
|---|---|
| (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_COMMAND_BUFFER_SERVICE_GPU_PREFERENCES_H_ | |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_GPU_PREFERENCES_H_ | |
| 7 | |
| 8 #include <stddef.h> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "build/build_config.h" | |
| 12 #include "gpu/command_buffer/common/constants.h" | |
| 13 #include "gpu/gpu_export.h" | |
| 14 | |
| 15 namespace gpu { | |
| 16 | |
| 17 struct GPU_EXPORT GpuPreferences { | |
| 18 public: | |
| 19 GpuPreferences(); | |
| 20 | |
| 21 ~GpuPreferences(); | |
| 22 | |
| 23 // =================================== | |
| 24 // Settings from //content/public/common/content_switches.h | |
| 25 | |
| 26 // Runs the renderer and plugins in the same process as the browser. | |
| 27 bool single_process = false; | |
| 28 | |
| 29 // Run the GPU process as a thread in the browser process. | |
| 30 bool in_process_gpu = false; | |
| 31 | |
| 32 // Prioritizes the UI's command stream in the GPU process. | |
| 33 bool ui_prioritize_in_gpu_process = false; | |
| 34 | |
| 35 // =================================== | |
| 36 // Settings from //gpu/command_buffer/service/gpu_switches.cc | |
| 37 | |
| 38 // Always return success when compiling a shader. Linking will still fail. | |
| 39 bool compile_shader_always_succeeds = false; | |
| 40 | |
| 41 // Disable the GL error log limit. | |
| 42 bool disable_gl_error_limit = false; | |
| 43 | |
| 44 // Disable the GLSL translator. | |
| 45 bool disable_glsl_translator = false; | |
| 46 | |
| 47 // Disable workarounds for various GPU driver bugs. | |
| 48 bool disable_gpu_driver_bug_workarounds = false; | |
| 49 | |
| 50 // Turn off user-defined name hashing in shaders. | |
| 51 bool disable_shader_name_hashing = false; | |
| 52 | |
| 53 // Turn on Logging GPU commands. | |
| 54 bool enable_gpu_command_logging = false; | |
| 55 | |
| 56 // Turn on Calling GL Error after every command. | |
| 57 bool enable_gpu_debugging = false; | |
| 58 | |
| 59 // Enable GPU service logging. | |
| 60 bool enable_gpu_service_logging_gpu = false; | |
| 61 | |
| 62 // Turn off gpu program caching | |
| 63 bool disable_gpu_program_cache = false; | |
| 64 | |
| 65 // Enforce GL minimums. | |
| 66 bool enforce_gl_minimums = false; | |
| 67 | |
| 68 // Sets the total amount of memory that may be allocated for GPU resources | |
| 69 size_t force_gpu_mem_available = 0; | |
|
boliu
2016/02/26 17:39:24
Just a note, not all switches are "hardcoded prefe
| |
| 70 | |
| 71 // Sets the maximum size of the in-memory gpu program cache, in kb | |
| 72 size_t gpu_program_cache_size = kDefaultMaxProgramCacheMemoryBytes; | |
| 73 | |
| 74 // Disables the GPU shader on disk cache. | |
| 75 bool disable_gpu_shader_disk_cache = false; | |
| 76 | |
| 77 // Allows async texture uploads (off main thread) via GL context sharing. | |
| 78 bool enable_share_group_async_texture_upload = false; | |
| 79 | |
| 80 // Enable WebGL subscribe uniform extension. | |
| 81 bool enable_subscribe_uniform_extension = false; | |
| 82 | |
| 83 // Simulates shared textures when share groups are not available. | |
| 84 // Not available everywhere. | |
| 85 bool enable_threaded_texture_mailboxes = false; | |
| 86 | |
| 87 // Include ANGLE's intermediate representation (AST) output in shader | |
| 88 // compilation info logs. | |
| 89 bool gl_shader_interm_output = false; | |
| 90 | |
| 91 // Emulate ESSL lowp and mediump float precisions by mutating the shaders to | |
| 92 // round intermediate values in ANGLE. | |
| 93 bool emulate_shader_precision = false; | |
| 94 | |
| 95 // Enables using path rendering implementation implemented currently | |
| 96 // in NV_path_rendering OpenGL extension. Requires compatible hardware | |
| 97 // and driver. This is used in GPU rasterization. | |
| 98 bool enable_gl_path_rendering = false; | |
| 99 | |
| 100 // =================================== | |
| 101 // Settings from //ui/gl/gl_switches.h | |
| 102 | |
| 103 // Turns on GPU logging (debug build only). | |
| 104 bool enable_gpu_service_logging = false; | |
| 105 | |
| 106 // Turns on calling TRACE for every GL call. | |
| 107 bool enable_gpu_service_tracing = false; | |
| 108 | |
| 109 // Enable OpenGL ES 3 APIs without proper service side validation. | |
| 110 bool enable_unsafe_es3_apis = false; | |
| 111 }; | |
| 112 | |
| 113 } // namespace gpu | |
| 114 | |
| 115 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_PREFERENCES_H_ | |
| OLD | NEW |