| 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(); | |
| 59 out->disable_accelerated_video_decode = | 58 out->disable_accelerated_video_decode = |
| 60 prefs.disable_accelerated_video_decode(); | 59 prefs.disable_accelerated_video_decode(); |
| 61 | 60 |
| 62 #if defined(OS_CHROMEOS) | 61 #if defined(OS_CHROMEOS) |
| 63 out->disable_vaapi_accelerated_video_encode = | 62 out->disable_vaapi_accelerated_video_encode = |
| 64 prefs.disable_vaapi_accelerated_video_encode(); | 63 prefs.disable_vaapi_accelerated_video_encode(); |
| 65 #endif | 64 #endif |
| 66 | 65 |
| 67 #if BUILDFLAG(ENABLE_WEBRTC) | 66 #if BUILDFLAG(ENABLE_WEBRTC) |
| 68 out->disable_web_rtc_hw_encoding = prefs.disable_web_rtc_hw_encoding(); | 67 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... |
| 108 | 107 |
| 109 static bool single_process(const gpu::GpuPreferences& prefs) { | 108 static bool single_process(const gpu::GpuPreferences& prefs) { |
| 110 return prefs.single_process; | 109 return prefs.single_process; |
| 111 } | 110 } |
| 112 static bool in_process_gpu(const gpu::GpuPreferences& prefs) { | 111 static bool in_process_gpu(const gpu::GpuPreferences& prefs) { |
| 113 return prefs.in_process_gpu; | 112 return prefs.in_process_gpu; |
| 114 } | 113 } |
| 115 static bool ui_prioritize_in_gpu_process(const gpu::GpuPreferences& prefs) { | 114 static bool ui_prioritize_in_gpu_process(const gpu::GpuPreferences& prefs) { |
| 116 return prefs.ui_prioritize_in_gpu_process; | 115 return prefs.ui_prioritize_in_gpu_process; |
| 117 } | 116 } |
| 118 static bool enable_gpu_scheduler(const gpu::GpuPreferences& prefs) { | |
| 119 return prefs.enable_gpu_scheduler; | |
| 120 } | |
| 121 static bool disable_accelerated_video_decode( | 117 static bool disable_accelerated_video_decode( |
| 122 const gpu::GpuPreferences& prefs) { | 118 const gpu::GpuPreferences& prefs) { |
| 123 return prefs.disable_accelerated_video_decode; | 119 return prefs.disable_accelerated_video_decode; |
| 124 } | 120 } |
| 125 | 121 |
| 126 static bool disable_vaapi_accelerated_video_encode( | 122 static bool disable_vaapi_accelerated_video_encode( |
| 127 const gpu::GpuPreferences& prefs) { | 123 const gpu::GpuPreferences& prefs) { |
| 128 #if defined(OS_CHROMEOS) | 124 #if defined(OS_CHROMEOS) |
| 129 return prefs.disable_vaapi_accelerated_video_encode; | 125 return prefs.disable_vaapi_accelerated_video_encode; |
| 130 #else | 126 #else |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 return prefs.enable_es3_apis; | 229 return prefs.enable_es3_apis; |
| 234 } | 230 } |
| 235 static bool use_passthrough_cmd_decoder(const gpu::GpuPreferences& prefs) { | 231 static bool use_passthrough_cmd_decoder(const gpu::GpuPreferences& prefs) { |
| 236 return prefs.use_passthrough_cmd_decoder; | 232 return prefs.use_passthrough_cmd_decoder; |
| 237 } | 233 } |
| 238 }; | 234 }; |
| 239 | 235 |
| 240 } // namespace mojo | 236 } // namespace mojo |
| 241 | 237 |
| 242 #endif // GPU_IPC_COMMON_GPU_PREFERENCES_STRUCT_TRAITS_H_ | 238 #endif // GPU_IPC_COMMON_GPU_PREFERENCES_STRUCT_TRAITS_H_ |
| OLD | NEW |