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

Unified 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: Removed unnecessary changes 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 side-by-side diff with in-line comments
Download patch
Index: gpu/ipc/common/gpu_info_struct_traits.h
diff --git a/gpu/ipc/common/gpu_info_struct_traits.h b/gpu/ipc/common/gpu_info_struct_traits.h
new file mode 100644
index 0000000000000000000000000000000000000000..bd7e0849c526dedded6bfb8def6d5648acfc142b
--- /dev/null
+++ b/gpu/ipc/common/gpu_info_struct_traits.h
@@ -0,0 +1,49 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_IPC_GPU_STRUCT_TRAITS_H_
+#define CC_IPC_GPU_STRUCT_TRAITS_H_
+
+#include "gpu/config/gpu_info.h"
+#include "gpu/ipc/common/gpu_info.mojom.h"
+
+namespace mojo {
+
+template <>
+struct StructTraits<gpu::mojom::GpuDevice, gpu::GPUInfo::GPUDevice> {
+ static bool Read(gpu::mojom::GpuDeviceDataView data,
+ gpu::GPUInfo::GPUDevice* out);
+
+ static uint32_t vendor_id(const gpu::GPUInfo::GPUDevice& input) {
+ return input.vendor_id;
+ }
+
+ static uint32_t device_id(const gpu::GPUInfo::GPUDevice& input) {
+ return input.device_id;
+ }
+
+ static bool active(const gpu::GPUInfo::GPUDevice& input) {
+ return input.active;
+ }
+
+ static std::string vendor_string(const gpu::GPUInfo::GPUDevice& input) {
+ return input.vendor_string;
+ }
+
+ static std::string device_string(const gpu::GPUInfo::GPUDevice& input) {
+ return input.device_string;
+ }
+};
+
+template <>
+struct EnumTraits<gpu::mojom::CollectInfoResult, gpu::CollectInfoResult> {
+ static gpu::mojom::CollectInfoResult ToMojom(
+ gpu::CollectInfoResult collect_info_result);
+
+ static bool FromMojom(gpu::mojom::CollectInfoResult input,
+ gpu::CollectInfoResult* out);
+};
+
+} // namespace mojo
+#endif // CC_IPC_GPU_STRUCT_TRAITS_H_

Powered by Google App Engine
This is Rietveld 408576698