1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30

gpu / ipc / common / shared_image_pool_id_mojom_traits.h [blame]

// Copyright 2024 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_SHARED_IMAGE_POOL_ID_MOJOM_TRAITS_H_
#define GPU_IPC_COMMON_SHARED_IMAGE_POOL_ID_MOJOM_TRAITS_H_

#include "gpu/command_buffer/common/shared_image_pool_id.h"
#include "gpu/gpu_export.h"
#include "gpu/ipc/common/shared_image_pool_id.mojom.h"
#include "mojo/public/cpp/base/unguessable_token_mojom_traits.h"
#include "mojo/public/cpp/bindings/struct_traits.h"

namespace mojo {

template <>
struct GPU_EXPORT StructTraits<gpu::mojom::SharedImagePoolIdDataView,
                               gpu::SharedImagePoolId> {
  static const base::UnguessableToken& value(
      const gpu::SharedImagePoolId& input) {
    return input.GetToken();
  }

  static bool Read(gpu::mojom::SharedImagePoolIdDataView& input,
                   gpu::SharedImagePoolId* output);
};

}  // namespace mojo

#endif  // GPU_IPC_COMMON_SHARED_IMAGE_POOL_ID_MOJOM_TRAITS_H_