Home | History | Annotate | Download | only in surfaces
      1 // Copyright 2014 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 import "mojo/services/gles2/command_buffer.mojom"
      6 import "mojo/services/public/interfaces/geometry/geometry.mojom"
      7 import "mojo/services/public/interfaces/surfaces/quads.mojom"
      8 import "mojo/services/public/interfaces/surfaces/surface_id.mojom"
      9 
     10 module mojo {
     11 
     12 enum ResourceFormat {
     13   RGBA_8888,
     14   RGBA_4444,
     15   BGRA_8888,
     16   ALPHA_8,
     17   LUMINANCE_8,
     18   RGB_565,
     19   ETC1,
     20 };
     21 
     22 struct Mailbox {
     23   int8[64] name;
     24 };
     25 
     26 struct MailboxHolder {
     27   Mailbox mailbox;
     28   uint32 texture_target;
     29   uint32 sync_point;
     30 };
     31 
     32 struct TransferableResource {
     33   uint32 id;
     34   ResourceFormat format;
     35   uint32 filter;
     36   Size size;
     37   MailboxHolder mailbox_holder;
     38   bool is_repeated;
     39   bool is_software;
     40 };
     41 
     42 struct ReturnedResource {
     43   uint32 id;
     44   uint32 sync_point;
     45   int32 count;
     46   bool lost;
     47 };
     48 
     49 struct Frame {
     50   TransferableResource[] resources;
     51   Pass[] passes;
     52 };
     53 
     54 interface SurfaceClient {
     55   ReturnResources(ReturnedResource[] resources);
     56 };
     57 
     58 [Client=SurfaceClient]
     59 interface Surface {
     60   // The id is created by the client and must be unique and contain the
     61   // connection's namespace in the upper 32 bits.
     62   CreateSurface(SurfaceId id, Size size);
     63 
     64   // The client can only submit frames to surfaces created with this connection.
     65   SubmitFrame(SurfaceId id, Frame frame);
     66   DestroySurface(SurfaceId id);
     67 
     68   CreateGLES2BoundSurface(CommandBuffer gles2_client,
     69                           SurfaceId id,
     70                           Size size);
     71 };
     72 
     73 }
     74