| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef GPU_IPC_COMMON_GPU_PREFERENCES_STRUCT_TRAITS_H_ | 5 #ifndef GPU_IPC_COMMON_GPU_PREFERENCES_STRUCT_TRAITS_H_ |
| 6 #define GPU_IPC_COMMON_GPU_PREFERENCES_STRUCT_TRAITS_H_ | 6 #define GPU_IPC_COMMON_GPU_PREFERENCES_STRUCT_TRAITS_H_ |
| 7 | 7 |
| 8 #include "gpu/ipc/common/gpu_preferences.mojom.h" | 8 #include "gpu/ipc/common/gpu_preferences.mojom.h" |
| 9 | 9 |
| 10 namespace mojo { | 10 namespace mojo { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 } | 48 } |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 template <> | 51 template <> |
| 52 struct StructTraits<gpu::mojom::GpuPreferencesDataView, gpu::GpuPreferences> { | 52 struct StructTraits<gpu::mojom::GpuPreferencesDataView, gpu::GpuPreferences> { |
| 53 static bool Read(gpu::mojom::GpuPreferencesDataView prefs, | 53 static bool Read(gpu::mojom::GpuPreferencesDataView prefs, |
| 54 gpu::GpuPreferences* out) { | 54 gpu::GpuPreferences* out) { |
| 55 out->single_process = prefs.single_process(); | 55 out->single_process = prefs.single_process(); |
| 56 out->in_process_gpu = prefs.in_process_gpu(); | 56 out->in_process_gpu = prefs.in_process_gpu(); |
| 57 out->ui_prioritize_in_gpu_process = prefs.ui_prioritize_in_gpu_process(); | 57 out->ui_prioritize_in_gpu_process = prefs.ui_prioritize_in_gpu_process(); |
| 58 out->enable_gpu_scheduler = prefs.enable_gpu_scheduler(); |
| 58 out->disable_accelerated_video_decode = | 59 out->disable_accelerated_video_decode = |
| 59 prefs.disable_accelerated_video_decode(); | 60 prefs.disable_accelerated_video_decode(); |
| 60 | 61 |
| 61 #if defined(OS_CHROMEOS) | 62 #if defined(OS_CHROMEOS) |
| 62 out->disable_vaapi_accelerated_video_encode = | 63 out->disable_vaapi_accelerated_video_encode = |
| 63 prefs.disable_vaapi_accelerated_video_encode(); | 64 prefs.disable_vaapi_accelerated_video_encode(); |
| 64 #endif | 65 #endif |
| 65 | 66 |
| 66 #if BUILDFLAG(ENABLE_WEBRTC) | 67 #if BUILDFLAG(ENABLE_WEBRTC) |
| 67 out->disable_web_rtc_hw_encoding = prefs.disable_web_rtc_hw_encoding(); | 68 out->disable_web_rtc_hw_encoding = prefs.disable_web_rtc_hw_encoding(); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 108 |
| 108 static bool single_process(const gpu::GpuPreferences& prefs) { | 109 static bool single_process(const gpu::GpuPreferences& prefs) { |
| 109 return prefs.single_process; | 110 return prefs.single_process; |
| 110 } | 111 } |
| 111 static bool in_process_gpu(const gpu::GpuPreferences& prefs) { | 112 static bool in_process_gpu(const gpu::GpuPreferences& prefs) { |
| 112 return prefs.in_process_gpu; | 113 return prefs.in_process_gpu; |
| 113 } | 114 } |
| 114 static bool ui_prioritize_in_gpu_process(const gpu::GpuPreferences& prefs) { | 115 static bool ui_prioritize_in_gpu_process(const gpu::GpuPreferences& prefs) { |
| 115 return prefs.ui_prioritize_in_gpu_process; | 116 return prefs.ui_prioritize_in_gpu_process; |
| 116 } | 117 } |
| 118 static bool enable_gpu_scheduler(const gpu::GpuPreferences& prefs) { |
| 119 return prefs.enable_gpu_scheduler; |
| 120 } |
| 117 static bool disable_accelerated_video_decode( | 121 static bool disable_accelerated_video_decode( |
| 118 const gpu::GpuPreferences& prefs) { | 122 const gpu::GpuPreferences& prefs) { |
| 119 return prefs.disable_accelerated_video_decode; | 123 return prefs.disable_accelerated_video_decode; |
| 120 } | 124 } |
| 121 | 125 |
| 122 static bool disable_vaapi_accelerated_video_encode( | 126 static bool disable_vaapi_accelerated_video_encode( |
| 123 const gpu::GpuPreferences& prefs) { | 127 const gpu::GpuPreferences& prefs) { |
| 124 #if defined(OS_CHROMEOS) | 128 #if defined(OS_CHROMEOS) |
| 125 return prefs.disable_vaapi_accelerated_video_encode; | 129 return prefs.disable_vaapi_accelerated_video_encode; |
| 126 #else | 130 #else |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 return prefs.enable_es3_apis; | 233 return prefs.enable_es3_apis; |
| 230 } | 234 } |
| 231 static bool use_passthrough_cmd_decoder(const gpu::GpuPreferences& prefs) { | 235 static bool use_passthrough_cmd_decoder(const gpu::GpuPreferences& prefs) { |
| 232 return prefs.use_passthrough_cmd_decoder; | 236 return prefs.use_passthrough_cmd_decoder; |
| 233 } | 237 } |
| 234 }; | 238 }; |
| 235 | 239 |
| 236 } // namespace mojo | 240 } // namespace mojo |
| 237 | 241 |
| 238 #endif // GPU_IPC_COMMON_GPU_PREFERENCES_STRUCT_TRAITS_H_ | 242 #endif // GPU_IPC_COMMON_GPU_PREFERENCES_STRUCT_TRAITS_H_ |
| OLD | NEW |