Chromium Code Reviews| 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 (this is not neccessarily | |
|
jeffbrown
2016/03/03 23:09:58
style nit: space after //
Forrest Reiling
2016/03/04 21:04:28
Done.
| |
| 14 // an error, as these properties could have changed after the image was added) | |
| 15 NOT_PRESENTED_INVALID_PROPERTIES, | |
|
jeffbrown
2016/03/03 23:09:58
assign explicit values to each one
Forrest Reiling
2016/03/04 21:04:28
Done.
| |
| 16 //Producer flushed the image pool | |
| 17 NOT_PRESENTED_FLUSHED, | |
| 18 }; | |
| 19 | |
| 20 //ImagePipe is a collection of semantics for streaming shared images between two | |
|
jeffbrown
2016/03/03 23:09:58
nit: ImagePipe is a mechanism for streaming...
Forrest Reiling
2016/03/04 21:04:28
Done.
| |
| 21 //Mojo entities, one of which provides the image contents (the 'producer') and | |
| 22 //one of which does something with the image contents (the 'consumer'). | |
| 23 //It operates conceptually on a pool of image descriptors that the pipe knows | |
|
jeffbrown
2016/03/03 23:09:58
Conceptually, it operates on a poll of |Image| obj
Forrest Reiling
2016/03/04 21:04:28
Done.
| |
| 24 //about, allows image producers to add/remove images to/from this pool, and | |
| 25 //provides mechanisms for the producer and the consumer to negotiate about who | |
| 26 //owns each image in the pool at a given point in time | |
| 27 interface ImagePipe { | |
| 28 | |
| 29 //Add an image persistently to the pipe's image pool | |
| 30 //Adding an image that is already added, or using an ID that is already in use | |
| 31 //are both errors and will cause the connection to terminate | |
|
jeffbrown
2016/03/03 23:09:58
instead of terminate, say closed
Forrest Reiling
2016/03/04 21:04:28
Done.
| |
| 32 AddImage(Image image, uint32 id); | |
|
jeffbrown
2016/03/03 23:09:58
AddImage(uint32 id, Image image);
Forrest Reiling
2016/03/04 21:04:28
I'm skipping this one because I don't think it has
| |
| 33 | |
| 34 //Remove an image from the pipe's pool | |
| 35 //Use of an invalid ID will cause the connection to be terminated | |
| 36 RemoveImage(uint32 id); | |
| 37 | |
| 38 //Mark the image as available for consumption by the consumer | |
|
jeffbrown
2016/03/03 23:09:58
period at the end of each sentence (here and elsew
Forrest Reiling
2016/03/04 21:04:28
Done.
| |
| 39 //The reply will be sent when the consumer is done using this image and | |
| 40 //is ready to release ownership back to the producer. | |
| 41 //The reply will not be sent until another Image is presented to replace it | |
| 42 //presentuing an id that is added will cause the connection to terminate | |
| 43 PresentImage(uint32 id) => (uint32 id, PresentationStatus status); | |
|
jeffbrown
2016/03/03 23:27:49
remove the returned id, the caller should just bin
Forrest Reiling
2016/03/04 21:04:28
Done.
| |
| 44 | |
| 45 //Ask the consumer to release all images in the pipe's pool | |
| 46 //this will send the presentation reply with FLUSHED on all images in the pool | |
| 47 //not being used by the consumer if the consumer is presenting this image, | |
| 48 //that image may still be presented and its Present reply will reflect that | |
| 49 FlushImages(); | |
| 50 | |
| 51 //Get supported propertied for images added to this pipe | |
| 52 //The reply to this method will only be sent when the values change compared | |
|
jeffbrown
2016/03/03 23:09:58
So what's interesting is that this is the Producer
Forrest Reiling
2016/03/04 21:04:28
Removing as per our discussion
| |
| 53 //to the last time they were sent (immediately for the first time they are | |
| 54 //called), so to listen for continuous updates call this method immediately | |
| 55 //after recieving the reply | |
| 56 GetSupportedImageProperties() => (SupportedImageProperties supported_propertie s); | |
| 57 }; | |
| OLD | NEW |