chromium/gpu/ipc/common/device_perf_info_mojom_traits.h

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef GPU_IPC_COMMON_DEVICE_PERF_INFO_MOJOM_TRAITS_H_
#define GPU_IPC_COMMON_DEVICE_PERF_INFO_MOJOM_TRAITS_H_

#include "gpu/ipc/common/device_perf_info.mojom-shared.h"

#include "build/build_config.h"
#include "gpu/config/device_perf_info.h"
#include "gpu/gpu_export.h"

namespace mojo {

#if BUILDFLAG(IS_WIN)
template <>
struct GPU_EXPORT
    EnumTraits<gpu::mojom::Direct3DFeatureLevel, D3D_FEATURE_LEVEL> {
  static gpu::mojom::Direct3DFeatureLevel ToMojom(
      D3D_FEATURE_LEVEL d3d_feature_level);
  static bool FromMojom(gpu::mojom::Direct3DFeatureLevel input,
                        D3D_FEATURE_LEVEL* out);
};
#endif  // BUILDFLAG(IS_WIN)

template <>
struct GPU_EXPORT EnumTraits<gpu::mojom::HasDiscreteGpu, gpu::HasDiscreteGpu> {};

template <>
struct GPU_EXPORT
    StructTraits<gpu::mojom::DevicePerfInfoDataView, gpu::DevicePerfInfo> {};

}  // namespace mojo

#endif  // GPU_IPC_COMMON_DEVICE_PERF_INFO_MOJOM_TRAITS_H_