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

Side by Side Diff: gpu/ipc/common/gpu_info_struct_traits.h

Issue 2133833002: gpu::GPUInfo::GPUDevice struct traits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change according to comments Created 4 years, 5 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
« no previous file with comments | « gpu/ipc/common/gpu_info.typemap ('k') | gpu/ipc/common/gpu_info_struct_traits.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 CC_IPC_GPU_STRUCT_TRAITS_H_
6 #define CC_IPC_GPU_STRUCT_TRAITS_H_
7
8 #include "gpu/config/gpu_info.h"
9 #include "gpu/ipc/common/gpu_info.mojom.h"
10
11 namespace mojo {
12
13 template <>
14 struct StructTraits<gpu::mojom::GpuDevice, gpu::GPUInfo::GPUDevice> {
15 static bool Read(gpu::mojom::GpuDeviceDataView data,
16 gpu::GPUInfo::GPUDevice* out);
17
18 static uint32_t vendor_id(const gpu::GPUInfo::GPUDevice& input) {
19 return input.vendor_id;
20 }
21
22 static uint32_t device_id(const gpu::GPUInfo::GPUDevice& input) {
23 return input.device_id;
24 }
25
26 static bool active(const gpu::GPUInfo::GPUDevice& input) {
27 return input.active;
28 }
29
30 static const std::string& vendor_string(
31 const gpu::GPUInfo::GPUDevice& input) {
32 return input.vendor_string;
33 }
34
35 static const std::string& device_string(
36 const gpu::GPUInfo::GPUDevice& input) {
37 return input.device_string;
38 }
39 };
40
41 template <>
42 struct EnumTraits<gpu::mojom::CollectInfoResult, gpu::CollectInfoResult> {
43 static gpu::mojom::CollectInfoResult ToMojom(
44 gpu::CollectInfoResult collect_info_result);
45
46 static bool FromMojom(gpu::mojom::CollectInfoResult input,
47 gpu::CollectInfoResult* out);
48 };
49
50 } // namespace mojo
51 #endif // CC_IPC_GPU_STRUCT_TRAITS_H_
OLDNEW
« no previous file with comments | « gpu/ipc/common/gpu_info.typemap ('k') | gpu/ipc/common/gpu_info_struct_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698