// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module viz.mojom;
import "gpu/ipc/common/gpu_feature_info.mojom";
import "gpu/ipc/common/gpu_info.mojom";
import "gpu/ipc/common/client_gmb_interface.mojom";
import "gpu/ipc/common/shared_image_capabilities.mojom";
import "gpu/ipc/common/sync_token.mojom";
[EnableIf=is_chromeos_ash]
import "components/chromeos_camera/common/mjpeg_decode_accelerator.mojom";
import "media/mojo/mojom/video_encode_accelerator.mojom";
import "mojo/public/mojom/base/shared_memory.mojom";
import "ui/gfx/geometry/mojom/geometry.mojom";
import "ui/gfx/mojom/buffer_types.mojom";
// API exposed to clients with lower level of trust, e.g. Renderers.
interface Gpu {
// Creates a direct channel between renderer and gpu process for GMB
// creation.
CreateClientGpuMemoryBufferFactory(
pending_receiver<gpu.mojom.ClientGmbInterface> receiver);
// Tells the GPU service to create a new channel for communication with a
// client. The GPU service responds with client ID, IPC handle and
// GPUInfo.
EstablishGpuChannel() =>
(int32 client_id,
handle<message_pipe>? channel_handle,
gpu.mojom.GpuInfo gpu_info,
gpu.mojom.GpuFeatureInfo gpu_feature_info,
gpu.mojom.SharedImageCapabilities shared_image_capabilities);
// Creates a new JpegDecodeAccelerator and binds it to |jda|.
[EnableIf=is_chromeos_ash]
CreateJpegDecodeAccelerator(
pending_receiver<chromeos_camera.mojom.MjpegDecodeAccelerator> jda);
// Creates a VideoEncodeAcceleratorProvider and binds it to |vea_provider|.
CreateVideoEncodeAcceleratorProvider(
pending_receiver<media.mojom.VideoEncodeAcceleratorProvider>
vea_provider);
};