Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: mojo/services/gfx/images/interfaces/image_pipe.mojom

Issue 1595773002: Added ImagePipe (Closed) Base URL: https://github.com/domokit/mojo.git@submit-2
Patch Set: minor changes to make it build with GCC on fnl Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 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 [DartPackage="mojo_services"]
6 module mojo.gfx;
7
8 import "geometry/interfaces/geometry.mojom";
9 import "gfx/images/interfaces/image.mojom";
10
11 //The status of the last time this image was presented
12 enum PresentationStatus {
13 PRESENTED = 0,
14 //Image properties are not supported by the consumer (this is not neccessarily
15 // an error, as these properties could have changed after the image was added)
16 NOT_PRESENTED_INVALID_PROPERTIES,
17 //Producer flushed the image pool
18 NOT_PRESENTED_FLUSHED,
19 };
20
21 //ImagePipe is a collection of semantics for streaming shared images between two
22 //Mojo entities, one of which provides the image contents (the 'producer') and
23 //one of which does something with the image contents (the 'consumer').
24 //It operates conceptually on a pool of image descriptors that the pipe knows
25 //about, allows image producers to add/remove images to/from this pool, and
26 //provides mechanisms for the producer and the consumer to negotiate about who
27 //owns each image in the pool at a given point in time
28 interface ImagePipe {
29
30 //Add an image persistently to the pipe's image pool
31 //Adding an image that is already added, or using an ID that is already in use
32 //are both errors and will cause the connection to terminate
33 AddImage(Image image, uint32 id);
34
35 //Remove an image from the pipe's pool
36 //Use of an invalid ID will cause the connection to be terminated
37 RemoveImage(uint32 id);
38
39 //Mark the image as available for consumption by the consumer
40 //The reply will be sent when the consumer is done using this image and
41 //is ready to release ownership back to the producer.
42 //The reply will not be sent until another Image is presented to replace it
43 //presentuing an id that is added will cause the connection to terminate
44 PresentImage(uint32 id) => (uint32 id, PresentationStatus status);
45
46 //Ask the consumer to release all images in the pipe's pool
47 //this will send the presentation reply with FLUSHED on all images in the pool
48 //not being used by the consumer if the consumer is presenting this image,
49 //that image may still be presented and its Present reply will reflect that
50 FlushImages();
51
52 //Get supported propertied for images added to this pipe
53 //The reply to this method will only be sent when the values change compared
54 //to the last time they were sent (immediately for the first time they are
55 //called), so to listen for continuous updates call this method immediately
56 //after recieving the reply
57 GetSupportedImageProperties() => (SupportedImageProperties supported_propertie s);
58 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698