| // gpu/ipc/common/gpu_info.mojom-data-view.h is auto generated by mojom_bindings_generator.py, do not edit |
| |
| // Copyright 2025 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_GPU_INFO_MOJOM_DATA_VIEW_H_ |
| #define GPU_IPC_COMMON_GPU_INFO_MOJOM_DATA_VIEW_H_ |
| |
| #include <stdint.h> |
| |
| #include <functional> |
| #include <iosfwd> |
| #include <type_traits> |
| #include <utility> |
| #include "mojo/public/cpp/bindings/array_data_view.h" |
| #include "mojo/public/cpp/bindings/enum_traits.h" |
| #include "mojo/public/cpp/bindings/interface_data_view.h" |
| #include "mojo/public/cpp/bindings/map_data_view.h" |
| #include "mojo/public/cpp/bindings/string_data_view.h" |
| |
| #include "gpu/ipc/common/gpu_info.mojom-shared-internal.h" |
| #include "mojo/public/mojom/base/time.mojom-shared.h" |
| #include "ui/gfx/geometry/mojom/geometry.mojom-shared.h" |
| #include "ui/gl/mojom/gl_implementation.mojom-shared.h" |
| #include "ui/gl/mojom/gpu_preference.mojom-shared.h" |
| #include "gpu/ipc/common/vulkan_info.mojom-shared.h" |
| |
| |
| namespace gpu::mojom { |
| class GpuDeviceDataView; |
| |
| class VideoDecodeAcceleratorSupportedProfileDataView; |
| |
| class VideoDecodeAcceleratorCapabilitiesDataView; |
| |
| class VideoEncodeAcceleratorSupportedProfileDataView; |
| |
| class ImageDecodeAcceleratorSupportedProfileDataView; |
| |
| class GpuInfoDataView; |
| |
| |
| |
| } // gpu::mojom |
| |
| |
| namespace mojo { |
| namespace internal { |
| |
| template <> |
| struct MojomTypeTraits<::gpu::mojom::GpuDeviceDataView> { |
| using Data = ::gpu::mojom::internal::GpuDevice_Data; |
| using DataAsArrayElement = Pointer<Data>; |
| static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct; |
| }; |
| |
| template <> |
| struct MojomTypeTraits<::gpu::mojom::VideoDecodeAcceleratorSupportedProfileDataView> { |
| using Data = ::gpu::mojom::internal::VideoDecodeAcceleratorSupportedProfile_Data; |
| using DataAsArrayElement = Pointer<Data>; |
| static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct; |
| }; |
| |
| template <> |
| struct MojomTypeTraits<::gpu::mojom::VideoDecodeAcceleratorCapabilitiesDataView> { |
| using Data = ::gpu::mojom::internal::VideoDecodeAcceleratorCapabilities_Data; |
| using DataAsArrayElement = Pointer<Data>; |
| static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct; |
| }; |
| |
| template <> |
| struct MojomTypeTraits<::gpu::mojom::VideoEncodeAcceleratorSupportedProfileDataView> { |
| using Data = ::gpu::mojom::internal::VideoEncodeAcceleratorSupportedProfile_Data; |
| using DataAsArrayElement = Pointer<Data>; |
| static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct; |
| }; |
| |
| template <> |
| struct MojomTypeTraits<::gpu::mojom::ImageDecodeAcceleratorSupportedProfileDataView> { |
| using Data = ::gpu::mojom::internal::ImageDecodeAcceleratorSupportedProfile_Data; |
| using DataAsArrayElement = Pointer<Data>; |
| static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct; |
| }; |
| |
| template <> |
| struct MojomTypeTraits<::gpu::mojom::GpuInfoDataView> { |
| using Data = ::gpu::mojom::internal::GpuInfo_Data; |
| using DataAsArrayElement = Pointer<Data>; |
| static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct; |
| }; |
| |
| } // namespace internal |
| } // namespace mojo |
| |
| |
| namespace gpu::mojom { |
| |
| |
| // @generated_from: gpu.mojom.SkiaBackendType |
| enum class SkiaBackendType : int32_t { |
| |
| // @generated_from: gpu.mojom.SkiaBackendType.kUnknown |
| kUnknown = 0, |
| |
| // @generated_from: gpu.mojom.SkiaBackendType.kNone |
| kNone = 1, |
| |
| // @generated_from: gpu.mojom.SkiaBackendType.kGaneshGL |
| kGaneshGL = 2, |
| |
| // @generated_from: gpu.mojom.SkiaBackendType.kGaneshVulkan |
| kGaneshVulkan = 3, |
| |
| // @generated_from: gpu.mojom.SkiaBackendType.kGraphiteDawnVulkan |
| kGraphiteDawnVulkan = 4, |
| |
| // @generated_from: gpu.mojom.SkiaBackendType.kGraphiteDawnMetal |
| kGraphiteDawnMetal = 5, |
| |
| // @generated_from: gpu.mojom.SkiaBackendType.kGraphiteDawnD3D11 |
| kGraphiteDawnD3D11 = 6, |
| |
| // @generated_from: gpu.mojom.SkiaBackendType.kGraphiteDawnD3D12 |
| kGraphiteDawnD3D12 = 7, |
| |
| // @generated_from: gpu.mojom.SkiaBackendType.kGraphiteMetal |
| kGraphiteMetal = 8, |
| kMinValue = 0, |
| kMaxValue = 8, |
| }; |
| |
| COMPONENT_EXPORT(MOJOM_SHARED_GPU_EXPORT) std::ostream& operator<<(std::ostream& os, SkiaBackendType value); |
| inline bool IsKnownEnumValue(SkiaBackendType value) { |
| return internal::SkiaBackendType_Data::IsKnownValue( |
| static_cast<int32_t>(value)); |
| } |
| |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile |
| enum class VideoCodecProfile : int32_t { |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.VIDEO_CODEC_PROFILE_UNKNOWN |
| VIDEO_CODEC_PROFILE_UNKNOWN = -1, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.H264PROFILE_BASELINE |
| H264PROFILE_BASELINE = 0, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.H264PROFILE_MAIN |
| H264PROFILE_MAIN = 1, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.H264PROFILE_EXTENDED |
| H264PROFILE_EXTENDED = 2, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.H264PROFILE_HIGH |
| H264PROFILE_HIGH = 3, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.H264PROFILE_HIGH10PROFILE |
| H264PROFILE_HIGH10PROFILE = 4, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.H264PROFILE_HIGH422PROFILE |
| H264PROFILE_HIGH422PROFILE = 5, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.H264PROFILE_HIGH444PREDICTIVEPROFILE |
| H264PROFILE_HIGH444PREDICTIVEPROFILE = 6, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.H264PROFILE_SCALABLEBASELINE |
| H264PROFILE_SCALABLEBASELINE = 7, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.H264PROFILE_SCALABLEHIGH |
| H264PROFILE_SCALABLEHIGH = 8, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.H264PROFILE_STEREOHIGH |
| H264PROFILE_STEREOHIGH = 9, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.H264PROFILE_MULTIVIEWHIGH |
| H264PROFILE_MULTIVIEWHIGH = 10, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.VP8PROFILE_ANY |
| VP8PROFILE_ANY = 11, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.VP9PROFILE_PROFILE0 |
| VP9PROFILE_PROFILE0 = 12, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.VP9PROFILE_PROFILE1 |
| VP9PROFILE_PROFILE1 = 13, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.VP9PROFILE_PROFILE2 |
| VP9PROFILE_PROFILE2 = 14, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.VP9PROFILE_PROFILE3 |
| VP9PROFILE_PROFILE3 = 15, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.HEVCPROFILE_MAIN |
| HEVCPROFILE_MAIN = 16, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.HEVCPROFILE_MAIN10 |
| HEVCPROFILE_MAIN10 = 17, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.HEVCPROFILE_MAIN_STILL_PICTURE |
| HEVCPROFILE_MAIN_STILL_PICTURE = 18, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.DOLBYVISION_PROFILE0 |
| DOLBYVISION_PROFILE0 = 19, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.DOLBYVISION_PROFILE5 |
| DOLBYVISION_PROFILE5 = 21, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.DOLBYVISION_PROFILE7 |
| DOLBYVISION_PROFILE7 = 22, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.THEORAPROFILE_ANY |
| THEORAPROFILE_ANY = 23, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.AV1PROFILE_PROFILE_MAIN |
| AV1PROFILE_PROFILE_MAIN = 24, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.AV1PROFILE_PROFILE_HIGH |
| AV1PROFILE_PROFILE_HIGH = 25, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.AV1PROFILE_PROFILE_PRO |
| AV1PROFILE_PROFILE_PRO = 26, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.DOLBYVISION_PROFILE8 |
| DOLBYVISION_PROFILE8 = 27, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.DOLBYVISION_PROFILE9 |
| DOLBYVISION_PROFILE9 = 28, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.HEVCPROFILE_REXT |
| HEVCPROFILE_REXT = 29, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.HEVCPROFILE_HIGH_THROUGHPUT |
| HEVCPROFILE_HIGH_THROUGHPUT = 30, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.HEVCPROFILE_MULTIVIEW_MAIN |
| HEVCPROFILE_MULTIVIEW_MAIN = 31, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.HEVCPROFILE_SCALABLE_MAIN |
| HEVCPROFILE_SCALABLE_MAIN = 32, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.HEVCPROFILE_3D_MAIN |
| HEVCPROFILE_3D_MAIN = 33, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.HEVCPROFILE_SCREEN_EXTENDED |
| HEVCPROFILE_SCREEN_EXTENDED = 34, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.HEVCPROFILE_SCALABLE_REXT |
| HEVCPROFILE_SCALABLE_REXT = 35, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.HEVCPROFILE_HIGH_THROUGHPUT_SCREEN_EXTENDED |
| HEVCPROFILE_HIGH_THROUGHPUT_SCREEN_EXTENDED = 36, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.VVCPROFILE_MAIN10 |
| VVCPROFILE_MAIN10 = 37, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.VVCPROFILE_MAIN12 |
| VVCPROFILE_MAIN12 = 38, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.VVCPROFILE_MAIN12_INTRA |
| VVCPROFILE_MAIN12_INTRA = 39, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.VVCPROIFLE_MULTILAYER_MAIN10 |
| VVCPROIFLE_MULTILAYER_MAIN10 = 40, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.VVCPROFILE_MAIN10_444 |
| VVCPROFILE_MAIN10_444 = 41, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.VVCPROFILE_MAIN12_444 |
| VVCPROFILE_MAIN12_444 = 42, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.VVCPROFILE_MAIN16_444 |
| VVCPROFILE_MAIN16_444 = 43, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.VVCPROFILE_MAIN12_444_INTRA |
| VVCPROFILE_MAIN12_444_INTRA = 44, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.VVCPROFILE_MAIN16_444_INTRA |
| VVCPROFILE_MAIN16_444_INTRA = 45, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.VVCPROFILE_MULTILAYER_MAIN10_444 |
| VVCPROFILE_MULTILAYER_MAIN10_444 = 46, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.VVCPROFILE_MAIN10_STILL_PICTURE |
| VVCPROFILE_MAIN10_STILL_PICTURE = 47, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.VVCPROFILE_MAIN12_STILL_PICTURE |
| VVCPROFILE_MAIN12_STILL_PICTURE = 48, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.VVCPROFILE_MAIN10_444_STILL_PICTURE |
| VVCPROFILE_MAIN10_444_STILL_PICTURE = 49, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.VVCPROFILE_MAIN12_444_STILL_PICTURE |
| VVCPROFILE_MAIN12_444_STILL_PICTURE = 50, |
| |
| // @generated_from: gpu.mojom.VideoCodecProfile.VVCPROFILE_MAIN16_444_STILL_PICTURE |
| VVCPROFILE_MAIN16_444_STILL_PICTURE = 51, |
| kMinValue = -1, |
| kMaxValue = 51, |
| }; |
| |
| COMPONENT_EXPORT(MOJOM_SHARED_GPU_EXPORT) std::ostream& operator<<(std::ostream& os, VideoCodecProfile value); |
| inline bool IsKnownEnumValue(VideoCodecProfile value) { |
| return internal::VideoCodecProfile_Data::IsKnownValue( |
| static_cast<int32_t>(value)); |
| } |
| |
| |
| // @generated_from: gpu.mojom.ImageDecodeAcceleratorType |
| enum class ImageDecodeAcceleratorType : int32_t { |
| |
| // @generated_from: gpu.mojom.ImageDecodeAcceleratorType.kJpeg |
| kJpeg = 0, |
| |
| // @generated_from: gpu.mojom.ImageDecodeAcceleratorType.kWebP |
| kWebP = 1, |
| |
| // @generated_from: gpu.mojom.ImageDecodeAcceleratorType.kUnknown |
| kUnknown = 2, |
| kMinValue = 0, |
| kMaxValue = 2, |
| }; |
| |
| COMPONENT_EXPORT(MOJOM_SHARED_GPU_EXPORT) std::ostream& operator<<(std::ostream& os, ImageDecodeAcceleratorType value); |
| inline bool IsKnownEnumValue(ImageDecodeAcceleratorType value) { |
| return internal::ImageDecodeAcceleratorType_Data::IsKnownValue( |
| static_cast<int32_t>(value)); |
| } |
| |
| |
| // @generated_from: gpu.mojom.ImageDecodeAcceleratorSubsampling |
| enum class ImageDecodeAcceleratorSubsampling : int32_t { |
| |
| // @generated_from: gpu.mojom.ImageDecodeAcceleratorSubsampling.k420 |
| k420 = 0, |
| |
| // @generated_from: gpu.mojom.ImageDecodeAcceleratorSubsampling.k422 |
| k422 = 1, |
| |
| // @generated_from: gpu.mojom.ImageDecodeAcceleratorSubsampling.k444 |
| k444 = 2, |
| kMinValue = 0, |
| kMaxValue = 2, |
| }; |
| |
| COMPONENT_EXPORT(MOJOM_SHARED_GPU_EXPORT) std::ostream& operator<<(std::ostream& os, ImageDecodeAcceleratorSubsampling value); |
| inline bool IsKnownEnumValue(ImageDecodeAcceleratorSubsampling value) { |
| return internal::ImageDecodeAcceleratorSubsampling_Data::IsKnownValue( |
| static_cast<int32_t>(value)); |
| } |
| |
| |
| class GpuDeviceDataView { |
| public: |
| GpuDeviceDataView() = default; |
| |
| GpuDeviceDataView( |
| internal::GpuDevice_Data* data, |
| mojo::Message* message) |
| : data_(data), message_(message) {} |
| |
| bool is_null() const { return !data_; } |
| uint32_t vendor_id() const { |
| return data_->vendor_id; |
| } |
| uint32_t device_id() const { |
| return data_->device_id; |
| } |
| bool active() const { |
| return data_->active; |
| } |
| inline void GetVendorStringDataView( |
| mojo::StringDataView* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadVendorString(UserType* output) { |
| |
| auto* pointer = data_->vendor_string.Get(); |
| return mojo::internal::Deserialize<mojo::StringDataView>( |
| pointer, output, message_); |
| } |
| inline void GetDeviceStringDataView( |
| mojo::StringDataView* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadDeviceString(UserType* output) { |
| |
| auto* pointer = data_->device_string.Get(); |
| return mojo::internal::Deserialize<mojo::StringDataView>( |
| pointer, output, message_); |
| } |
| inline void GetDriverVendorDataView( |
| mojo::StringDataView* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadDriverVendor(UserType* output) { |
| |
| auto* pointer = data_->driver_vendor.Get(); |
| return mojo::internal::Deserialize<mojo::StringDataView>( |
| pointer, output, message_); |
| } |
| inline void GetDriverVersionDataView( |
| mojo::StringDataView* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadDriverVersion(UserType* output) { |
| |
| auto* pointer = data_->driver_version.Get(); |
| return mojo::internal::Deserialize<mojo::StringDataView>( |
| pointer, output, message_); |
| } |
| template <typename UserType> |
| [[nodiscard]] bool ReadGpuPreference(UserType* output) const { |
| auto data_value = data_->gpu_preference; |
| return mojo::internal::Deserialize<::gl::mojom::GpuPreference>( |
| data_value, output); |
| } |
| ::gl::mojom::GpuPreference gpu_preference() const { |
| return ::mojo::internal::ToKnownEnumValueHelper( |
| static_cast<::gl::mojom::GpuPreference>(data_->gpu_preference)); |
| } |
| private: |
| internal::GpuDevice_Data* data_ = nullptr; |
| mojo::Message* message_ = nullptr; |
| }; |
| |
| |
| class VideoDecodeAcceleratorSupportedProfileDataView { |
| public: |
| VideoDecodeAcceleratorSupportedProfileDataView() = default; |
| |
| VideoDecodeAcceleratorSupportedProfileDataView( |
| internal::VideoDecodeAcceleratorSupportedProfile_Data* data, |
| mojo::Message* message) |
| : data_(data), message_(message) {} |
| |
| bool is_null() const { return !data_; } |
| template <typename UserType> |
| [[nodiscard]] bool ReadProfile(UserType* output) const { |
| auto data_value = data_->profile; |
| return mojo::internal::Deserialize<::gpu::mojom::VideoCodecProfile>( |
| data_value, output); |
| } |
| VideoCodecProfile profile() const { |
| return ::mojo::internal::ToKnownEnumValueHelper( |
| static_cast<::gpu::mojom::VideoCodecProfile>(data_->profile)); |
| } |
| inline void GetMaxResolutionDataView( |
| ::gfx::mojom::SizeDataView* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadMaxResolution(UserType* output) { |
| |
| auto* pointer = data_->max_resolution.Get(); |
| return mojo::internal::Deserialize<::gfx::mojom::SizeDataView>( |
| pointer, output, message_); |
| } |
| inline void GetMinResolutionDataView( |
| ::gfx::mojom::SizeDataView* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadMinResolution(UserType* output) { |
| |
| auto* pointer = data_->min_resolution.Get(); |
| return mojo::internal::Deserialize<::gfx::mojom::SizeDataView>( |
| pointer, output, message_); |
| } |
| bool encrypted_only() const { |
| return data_->encrypted_only; |
| } |
| private: |
| internal::VideoDecodeAcceleratorSupportedProfile_Data* data_ = nullptr; |
| mojo::Message* message_ = nullptr; |
| }; |
| |
| |
| class VideoDecodeAcceleratorCapabilitiesDataView { |
| public: |
| VideoDecodeAcceleratorCapabilitiesDataView() = default; |
| |
| VideoDecodeAcceleratorCapabilitiesDataView( |
| internal::VideoDecodeAcceleratorCapabilities_Data* data, |
| mojo::Message* message) |
| : data_(data), message_(message) {} |
| |
| bool is_null() const { return !data_; } |
| inline void GetSupportedProfilesDataView( |
| mojo::ArrayDataView<VideoDecodeAcceleratorSupportedProfileDataView>* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadSupportedProfiles(UserType* output) { |
| |
| auto* pointer = data_->supported_profiles.Get(); |
| return mojo::internal::Deserialize<mojo::ArrayDataView<::gpu::mojom::VideoDecodeAcceleratorSupportedProfileDataView>>( |
| pointer, output, message_); |
| } |
| uint32_t flags() const { |
| return data_->flags; |
| } |
| private: |
| internal::VideoDecodeAcceleratorCapabilities_Data* data_ = nullptr; |
| mojo::Message* message_ = nullptr; |
| }; |
| |
| |
| class VideoEncodeAcceleratorSupportedProfileDataView { |
| public: |
| VideoEncodeAcceleratorSupportedProfileDataView() = default; |
| |
| VideoEncodeAcceleratorSupportedProfileDataView( |
| internal::VideoEncodeAcceleratorSupportedProfile_Data* data, |
| mojo::Message* message) |
| : data_(data), message_(message) {} |
| |
| bool is_null() const { return !data_; } |
| template <typename UserType> |
| [[nodiscard]] bool ReadProfile(UserType* output) const { |
| auto data_value = data_->profile; |
| return mojo::internal::Deserialize<::gpu::mojom::VideoCodecProfile>( |
| data_value, output); |
| } |
| VideoCodecProfile profile() const { |
| return ::mojo::internal::ToKnownEnumValueHelper( |
| static_cast<::gpu::mojom::VideoCodecProfile>(data_->profile)); |
| } |
| inline void GetMinResolutionDataView( |
| ::gfx::mojom::SizeDataView* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadMinResolution(UserType* output) { |
| |
| auto* pointer = data_->min_resolution.Get(); |
| return mojo::internal::Deserialize<::gfx::mojom::SizeDataView>( |
| pointer, output, message_); |
| } |
| inline void GetMaxResolutionDataView( |
| ::gfx::mojom::SizeDataView* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadMaxResolution(UserType* output) { |
| |
| auto* pointer = data_->max_resolution.Get(); |
| return mojo::internal::Deserialize<::gfx::mojom::SizeDataView>( |
| pointer, output, message_); |
| } |
| uint32_t max_framerate_numerator() const { |
| return data_->max_framerate_numerator; |
| } |
| uint32_t max_framerate_denominator() const { |
| return data_->max_framerate_denominator; |
| } |
| private: |
| internal::VideoEncodeAcceleratorSupportedProfile_Data* data_ = nullptr; |
| mojo::Message* message_ = nullptr; |
| }; |
| |
| |
| class ImageDecodeAcceleratorSupportedProfileDataView { |
| public: |
| ImageDecodeAcceleratorSupportedProfileDataView() = default; |
| |
| ImageDecodeAcceleratorSupportedProfileDataView( |
| internal::ImageDecodeAcceleratorSupportedProfile_Data* data, |
| mojo::Message* message) |
| : data_(data), message_(message) {} |
| |
| bool is_null() const { return !data_; } |
| template <typename UserType> |
| [[nodiscard]] bool ReadImageType(UserType* output) const { |
| auto data_value = data_->image_type; |
| return mojo::internal::Deserialize<::gpu::mojom::ImageDecodeAcceleratorType>( |
| data_value, output); |
| } |
| ImageDecodeAcceleratorType image_type() const { |
| return ::mojo::internal::ToKnownEnumValueHelper( |
| static_cast<::gpu::mojom::ImageDecodeAcceleratorType>(data_->image_type)); |
| } |
| inline void GetMinEncodedDimensionsDataView( |
| ::gfx::mojom::SizeDataView* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadMinEncodedDimensions(UserType* output) { |
| |
| auto* pointer = data_->min_encoded_dimensions.Get(); |
| return mojo::internal::Deserialize<::gfx::mojom::SizeDataView>( |
| pointer, output, message_); |
| } |
| inline void GetMaxEncodedDimensionsDataView( |
| ::gfx::mojom::SizeDataView* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadMaxEncodedDimensions(UserType* output) { |
| |
| auto* pointer = data_->max_encoded_dimensions.Get(); |
| return mojo::internal::Deserialize<::gfx::mojom::SizeDataView>( |
| pointer, output, message_); |
| } |
| inline void GetSubsamplingsDataView( |
| mojo::ArrayDataView<ImageDecodeAcceleratorSubsampling>* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadSubsamplings(UserType* output) { |
| |
| auto* pointer = data_->subsamplings.Get(); |
| return mojo::internal::Deserialize<mojo::ArrayDataView<::gpu::mojom::ImageDecodeAcceleratorSubsampling>>( |
| pointer, output, message_); |
| } |
| private: |
| internal::ImageDecodeAcceleratorSupportedProfile_Data* data_ = nullptr; |
| mojo::Message* message_ = nullptr; |
| }; |
| |
| |
| class GpuInfoDataView { |
| public: |
| GpuInfoDataView() = default; |
| |
| GpuInfoDataView( |
| internal::GpuInfo_Data* data, |
| mojo::Message* message) |
| : data_(data), message_(message) {} |
| |
| bool is_null() const { return !data_; } |
| inline void GetInitializationTimeDataView( |
| ::mojo_base::mojom::TimeDeltaDataView* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadInitializationTime(UserType* output) { |
| |
| auto* pointer = data_->initialization_time.Get(); |
| return mojo::internal::Deserialize<::mojo_base::mojom::TimeDeltaDataView>( |
| pointer, output, message_); |
| } |
| bool optimus() const { |
| return data_->optimus; |
| } |
| bool amd_switchable() const { |
| return data_->amd_switchable; |
| } |
| inline void GetGpuDataView( |
| GpuDeviceDataView* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadGpu(UserType* output) { |
| |
| auto* pointer = data_->gpu.Get(); |
| return mojo::internal::Deserialize<::gpu::mojom::GpuDeviceDataView>( |
| pointer, output, message_); |
| } |
| inline void GetSecondaryGpusDataView( |
| mojo::ArrayDataView<GpuDeviceDataView>* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadSecondaryGpus(UserType* output) { |
| |
| auto* pointer = data_->secondary_gpus.Get(); |
| return mojo::internal::Deserialize<mojo::ArrayDataView<::gpu::mojom::GpuDeviceDataView>>( |
| pointer, output, message_); |
| } |
| inline void GetNpusDataView( |
| mojo::ArrayDataView<GpuDeviceDataView>* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadNpus(UserType* output) { |
| |
| auto* pointer = data_->npus.Get(); |
| return mojo::internal::Deserialize<mojo::ArrayDataView<::gpu::mojom::GpuDeviceDataView>>( |
| pointer, output, message_); |
| } |
| inline void GetPixelShaderVersionDataView( |
| mojo::StringDataView* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadPixelShaderVersion(UserType* output) { |
| |
| auto* pointer = data_->pixel_shader_version.Get(); |
| return mojo::internal::Deserialize<mojo::StringDataView>( |
| pointer, output, message_); |
| } |
| inline void GetVertexShaderVersionDataView( |
| mojo::StringDataView* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadVertexShaderVersion(UserType* output) { |
| |
| auto* pointer = data_->vertex_shader_version.Get(); |
| return mojo::internal::Deserialize<mojo::StringDataView>( |
| pointer, output, message_); |
| } |
| inline void GetMaxMsaaSamplesDataView( |
| mojo::StringDataView* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadMaxMsaaSamples(UserType* output) { |
| |
| auto* pointer = data_->max_msaa_samples.Get(); |
| return mojo::internal::Deserialize<mojo::StringDataView>( |
| pointer, output, message_); |
| } |
| inline void GetMachineModelNameDataView( |
| mojo::StringDataView* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadMachineModelName(UserType* output) { |
| |
| auto* pointer = data_->machine_model_name.Get(); |
| return mojo::internal::Deserialize<mojo::StringDataView>( |
| pointer, output, message_); |
| } |
| inline void GetMachineModelVersionDataView( |
| mojo::StringDataView* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadMachineModelVersion(UserType* output) { |
| |
| auto* pointer = data_->machine_model_version.Get(); |
| return mojo::internal::Deserialize<mojo::StringDataView>( |
| pointer, output, message_); |
| } |
| inline void GetDisplayTypeDataView( |
| mojo::StringDataView* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadDisplayType(UserType* output) { |
| |
| auto* pointer = data_->display_type.Get(); |
| return mojo::internal::Deserialize<mojo::StringDataView>( |
| pointer, output, message_); |
| } |
| template <typename UserType> |
| [[nodiscard]] bool ReadSkiaBackendType(UserType* output) const { |
| auto data_value = data_->skia_backend_type; |
| return mojo::internal::Deserialize<::gpu::mojom::SkiaBackendType>( |
| data_value, output); |
| } |
| SkiaBackendType skia_backend_type() const { |
| return ::mojo::internal::ToKnownEnumValueHelper( |
| static_cast<::gpu::mojom::SkiaBackendType>(data_->skia_backend_type)); |
| } |
| inline void GetGlVersionDataView( |
| mojo::StringDataView* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadGlVersion(UserType* output) { |
| |
| auto* pointer = data_->gl_version.Get(); |
| return mojo::internal::Deserialize<mojo::StringDataView>( |
| pointer, output, message_); |
| } |
| inline void GetGlVendorDataView( |
| mojo::StringDataView* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadGlVendor(UserType* output) { |
| |
| auto* pointer = data_->gl_vendor.Get(); |
| return mojo::internal::Deserialize<mojo::StringDataView>( |
| pointer, output, message_); |
| } |
| inline void GetGlRendererDataView( |
| mojo::StringDataView* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadGlRenderer(UserType* output) { |
| |
| auto* pointer = data_->gl_renderer.Get(); |
| return mojo::internal::Deserialize<mojo::StringDataView>( |
| pointer, output, message_); |
| } |
| inline void GetGlExtensionsDataView( |
| mojo::StringDataView* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadGlExtensions(UserType* output) { |
| |
| auto* pointer = data_->gl_extensions.Get(); |
| return mojo::internal::Deserialize<mojo::StringDataView>( |
| pointer, output, message_); |
| } |
| inline void GetGlWsVendorDataView( |
| mojo::StringDataView* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadGlWsVendor(UserType* output) { |
| |
| auto* pointer = data_->gl_ws_vendor.Get(); |
| return mojo::internal::Deserialize<mojo::StringDataView>( |
| pointer, output, message_); |
| } |
| inline void GetGlWsVersionDataView( |
| mojo::StringDataView* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadGlWsVersion(UserType* output) { |
| |
| auto* pointer = data_->gl_ws_version.Get(); |
| return mojo::internal::Deserialize<mojo::StringDataView>( |
| pointer, output, message_); |
| } |
| inline void GetGlWsExtensionsDataView( |
| mojo::StringDataView* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadGlWsExtensions(UserType* output) { |
| |
| auto* pointer = data_->gl_ws_extensions.Get(); |
| return mojo::internal::Deserialize<mojo::StringDataView>( |
| pointer, output, message_); |
| } |
| uint32_t gl_reset_notification_strategy() const { |
| return data_->gl_reset_notification_strategy; |
| } |
| inline void GetGlImplementationPartsDataView( |
| ::gl::mojom::GLImplementationPartsDataView* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadGlImplementationParts(UserType* output) { |
| |
| auto* pointer = data_->gl_implementation_parts.Get(); |
| return mojo::internal::Deserialize<::gl::mojom::GLImplementationPartsDataView>( |
| pointer, output, message_); |
| } |
| inline void GetDirectRenderingVersionDataView( |
| mojo::StringDataView* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadDirectRenderingVersion(UserType* output) { |
| |
| auto* pointer = data_->direct_rendering_version.Get(); |
| return mojo::internal::Deserialize<mojo::StringDataView>( |
| pointer, output, message_); |
| } |
| bool sandboxed() const { |
| return data_->sandboxed; |
| } |
| bool in_process_gpu() const { |
| return data_->in_process_gpu; |
| } |
| bool passthrough_cmd_decoder() const { |
| return data_->passthrough_cmd_decoder; |
| } |
| bool can_support_threaded_texture_mailbox() const { |
| return data_->can_support_threaded_texture_mailbox; |
| } |
| inline void GetVideoDecodeAcceleratorSupportedProfilesDataView( |
| mojo::ArrayDataView<VideoDecodeAcceleratorSupportedProfileDataView>* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadVideoDecodeAcceleratorSupportedProfiles(UserType* output) { |
| |
| auto* pointer = data_->video_decode_accelerator_supported_profiles.Get(); |
| return mojo::internal::Deserialize<mojo::ArrayDataView<::gpu::mojom::VideoDecodeAcceleratorSupportedProfileDataView>>( |
| pointer, output, message_); |
| } |
| inline void GetVideoEncodeAcceleratorSupportedProfilesDataView( |
| mojo::ArrayDataView<VideoEncodeAcceleratorSupportedProfileDataView>* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadVideoEncodeAcceleratorSupportedProfiles(UserType* output) { |
| |
| auto* pointer = data_->video_encode_accelerator_supported_profiles.Get(); |
| return mojo::internal::Deserialize<mojo::ArrayDataView<::gpu::mojom::VideoEncodeAcceleratorSupportedProfileDataView>>( |
| pointer, output, message_); |
| } |
| bool jpeg_decode_accelerator_supported() const { |
| return data_->jpeg_decode_accelerator_supported; |
| } |
| bool subpixel_font_rendering() const { |
| return data_->subpixel_font_rendering; |
| } |
| uint32_t visibility_callback_call_count() const { |
| return data_->visibility_callback_call_count; |
| } |
| bool hardware_supports_vulkan() const { |
| return data_->hardware_supports_vulkan; |
| } |
| inline void GetVulkanInfoDataView( |
| ::gpu::mojom::VulkanInfoDataView* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadVulkanInfo(UserType* output) { |
| |
| static_assert( |
| mojo::internal::IsValidUserTypeForOptionalValue< |
| ::gpu::mojom::VulkanInfoDataView, UserType>(), |
| "Attempting to read the optional `vulkan_info` field into a type which " |
| "cannot represent a null value. Either wrap the destination object " |
| "with std::optional, ensure that any corresponding " |
| "{Struct/Union/Array/String}Traits define the necessary IsNull and " |
| "SetToNull methods, or use `MaybeReadVulkanInfo` instead " |
| "of `ReadVulkanInfo if you're fine with null values being " |
| "silently ignored in this case."); |
| auto* pointer = data_->vulkan_info.Get(); |
| return mojo::internal::Deserialize<::gpu::mojom::VulkanInfoDataView>( |
| pointer, output, message_); |
| } |
| private: |
| internal::GpuInfo_Data* data_ = nullptr; |
| mojo::Message* message_ = nullptr; |
| }; |
| |
| |
| } // gpu::mojom |
| |
| #endif // GPU_IPC_COMMON_GPU_INFO_MOJOM_DATA_VIEW_H_ |