OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 module mojo.gfx; |
| 6 |
| 7 import "geometry/interfaces/geometry.mojom"; |
| 8 import "gfx/images/interfaces/image.mojom"; |
| 9 |
| 10 // The status of the last time this image was presented |
| 11 enum PresentationStatus { |
| 12 PRESENTED = 0, |
| 13 // Image properties are not supported by the consumer |
| 14 NOT_PRESENTED_INVALID_PROPERTIES = 1, |
| 15 // Producer flushed the image pool |
| 16 NOT_PRESENTED_FLUSHED = 2, |
| 17 }; |
| 18 |
| 19 // ImagePipe is a mechanism for streaming shared images between two |
| 20 // Mojo entities, one of which provides the image contents (the 'producer') and |
| 21 // one of which does something with the image contents (the 'consumer'). |
| 22 // It operates conceptually on a pool of |Image| objects that the pipe knows |
| 23 // about, allows image producers to add/remove images to/from this pool, and |
| 24 // provides mechanisms for the producer and the consumer to negotiate about who |
| 25 // owns each image in the pool at a given point in time. |
| 26 interface ImagePipe { |
| 27 |
| 28 // Add an image persistently to the pipe's image pool |
| 29 // Adding an image that is already added, or using an ID that is already in |
| 30 // use are both errors and will cause the connection to close. |
| 31 AddImage(Image image, uint32 id); |
| 32 |
| 33 // Remove an image from the pipe's pool |
| 34 // Use of an invalid ID will cause the connection to close. |
| 35 RemoveImage(uint32 id); |
| 36 |
| 37 // Mark the image as available for consumption by the consumer |
| 38 // The reply will be sent when the consumer is done using this image and |
| 39 // is ready to release ownership back to the producer. |
| 40 // The reply will not be sent until another Image is presented to replace it |
| 41 // presentuing an id that is added will cause the connection to close. |
| 42 PresentImage(uint32 id) => (PresentationStatus status); |
| 43 |
| 44 // Ask the consumer to release all images in the pipe's pool. This will |
| 45 // send the presentation reply with FLUSHED on all images in the pool |
| 46 // not being used by the consumer if the consumer is presenting this image, |
| 47 // that image may still be presented and its Present reply will reflect that. |
| 48 FlushImages(); |
| 49 |
| 50 }; |
OLD | NEW |