blob: 29e1efa14e9abc65dde1e8b04f0c9f123a1bcc18 [file] [log] [blame]
// Copyright 2014 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.
import "mojo/services/public/interfaces/geometry/geometry.mojom"
import "mojo/services/gles2/command_buffer.mojom"
import "mojo/services/public/interfaces/surfaces/quads.mojom"
import "mojo/services/public/interfaces/surfaces/surface_id.mojom"
module mojo.surfaces {
enum ResourceFormat {
RGBA_8888,
RGBA_4444,
BGRA_8888,
LUMINANCE_8,
RGB_565,
ETC1,
};
struct Mailbox {
int8[64] name;
};
struct MailboxHolder {
Mailbox mailbox;
uint32 texture_target;
uint32 sync_point;
};
struct TransferableResource {
uint32 id;
ResourceFormat format;
uint32 filter;
mojo.Size size;
MailboxHolder mailbox_holder;
bool is_repeated;
bool is_software;
};
struct ReturnedResource {
uint32 id;
uint32 sync_point;
int32 count;
bool lost;
};
struct Frame {
TransferableResource[] resources;
Pass[] passes;
};
interface SurfaceClient {
SetIdNamespace(uint32 id);
ReturnResources(ReturnedResource[] resources);
};
[Client=SurfaceClient]
interface Surface {
CreateSurface(SurfaceId id, mojo.Size size);
SubmitFrame(SurfaceId id, Frame frame);
DestroySurface(SurfaceId id);
CreateGLES2BoundSurface(mojo.CommandBuffer gles2_client,
SurfaceId id,
mojo.Size size);
};
}