blob: 13628ae0316045f596cd812f959c430c6037fccf [file] [log] [blame]
// 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.
module viz.mojom;
import "components/arc/common/protected_buffer_manager.mojom";
import "components/arc/common/video_decode_accelerator.mojom";
import "components/arc/common/video_encode_accelerator.mojom";
import "components/arc/common/video_protected_buffer_allocator.mojom";
import "components/chromeos_camera/common/mjpeg_decode_accelerator.mojom";
import "components/chromeos_camera/common/jpeg_encode_accelerator.mojom";
import "gpu/ipc/common/dx_diag_node.mojom";
import "gpu/ipc/common/gpu_info.mojom";
import "gpu/ipc/common/memory_stats.mojom";
import "gpu/ipc/common/surface_handle.mojom";
import "gpu/ipc/common/sync_token.mojom";
import "media/mojo/interfaces/video_encode_accelerator.mojom";
import "ui/gfx/geometry/mojom/geometry.mojom";
import "ui/gfx/mojom/buffer_types.mojom";
interface GpuService {
// Tells the GPU service to create a new channel for communication with a
// client. The GPU service responds with an IPC handle.
EstablishGpuChannel(int32 client_id,
uint64 client_tracing_id,
bool is_gpu_host,
bool cache_shaders_on_disk)
=> (handle<message_pipe>? channel_handle);
// Tells the GPU process to close the channel identified by |client_id|.
// If no channel can be identified, do nothing.
CloseChannel(int32 client_id);
// Create a new ARC VideoDecodeAccelerator and binds it to |vda|.
CreateArcVideoDecodeAccelerator(arc.mojom.VideoDecodeAccelerator& vda);
// Create a new ARC VideoEncodeAccelerator and binds it to |vea|.
CreateArcVideoEncodeAccelerator(arc.mojom.VideoEncodeAccelerator& vea);
// Create a new ARC VideoProtectedBufferAllocator and binds it to |pba|.
arc.mojom.VideoProtectedBufferAllocator& pba);
// Create a new ARC ProtectedBufferManager and binds it to |pbm|.
CreateArcProtectedBufferManager(arc.mojom.ProtectedBufferManager& pbm);
// Creates a new MjpegDecodeAccelerator and binds it to |jda|.
chromeos_camera.mojom.MjpegDecodeAccelerator& jda);
// Creates a new JpegEncodeAccelerator and binds it to |jea|.
CreateJpegEncodeAccelerator(chromeos_camera.mojom.JpegEncodeAccelerator& jea);
// Creates a VideoEncodeAcceleratorProvider and binds it to |vea_provider|.
media.mojom.VideoEncodeAcceleratorProvider& vea_provider);
CreateGpuMemoryBuffer(gfx.mojom.GpuMemoryBufferId id,
gfx.mojom.Size size,
gfx.mojom.BufferFormat format,
gfx.mojom.BufferUsage usage,
int32 client_id,
gpu.mojom.SurfaceHandle surface_handle)
=> (gfx.mojom.GpuMemoryBufferHandle buffer_handle);
DestroyGpuMemoryBuffer(gfx.mojom.GpuMemoryBufferId id,
int32 client_id,
gpu.mojom.SyncToken sync_token);
GetVideoMemoryUsageStats() => (gpu.mojom.VideoMemoryUsageStats stats);
RequestCompleteGpuInfo() => (gpu.mojom.DxDiagNode dx_diagnostics);
=> (gpu.mojom.Dx12VulkanVersionInfo dx12_vulkan_version_info);
// Requests that the GPU process query system availability of HDR output and
// return it.
RequestHDRStatus() => (bool hdr_enabled);
// Notify GPU that a shader program was loaded from disk. Key is an
// SHA-1 hash, and data a binary blob with serialized program info.
// Note that this method is used only from a trusted process.
LoadedShader(int32 client_id, string key, string data);
// Tells GPU to wake up the GPU because we're about to draw.
// Tells GPU that host has seen a GPU switch. This can happen when the display
// is reconfigured, for example.
// Called by the browser shortly after the application is backgrounded. The
// GPU can use this message to perform appropriate cleanup. Sent with a
// slight delay to prevent thrashing if the app is rapidly backgrounded
// foregrounded.
// Called by the browser immediately after the application is backgrounded.
// Called by the browser immediately after the application is foregrounded.
// Begin a batch of layer tree changes.
// Commit a batch of layer tree changes atomically. Returns after the commit
// completes.
CommitCATransaction() => ();
Stop() => ();