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

Unified 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: Expose InterfacePtr::encountered_error() through ImagePipeProducerEndpoint so the GL on ImagePipe i… 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 side-by-side diff with in-line comments
Download patch
Index: mojo/services/gfx/images/interfaces/image_pipe.mojom
diff --git a/mojo/services/gfx/images/interfaces/image_pipe.mojom b/mojo/services/gfx/images/interfaces/image_pipe.mojom
new file mode 100644
index 0000000000000000000000000000000000000000..f62d09a6362546a0cd28d4c7eec5bb411c7acb56
--- /dev/null
+++ b/mojo/services/gfx/images/interfaces/image_pipe.mojom
@@ -0,0 +1,57 @@
+// Copyright 2015 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.
+
+module mojo.gfx;
+
+import "geometry/interfaces/geometry.mojom";
+import "gfx/images/interfaces/image.mojom";
+
+//The status of the last time this image was presented
+enum PresentationStatus {
+ PRESENTED = 0,
+ //Image properties are not supported by the consumer (this is not neccessarily
+ // an error, as these properties could have changed after the image was added)
+ NOT_PRESENTED_INVALID_PROPERTIES,
+ //Producer flushed the image pool
+ NOT_PRESENTED_FLUSHED,
+};
+
+//ImagePipe is a collection of semantics for streaming shared images between two
+//Mojo entities, one of which provides the image contents (the 'producer') and
+//one of which does something with the image contents (the 'consumer').
+//It operates conceptually on a pool of image descriptors that the pipe knows
+//about, allows image producers to add/remove images to/from this pool, and
+//provides mechanisms for the producer and the consumer to negotiate about who
+//owns each image in the pool at a given point in time
+interface ImagePipe {
+
+ //Add an image persistently to the pipe's image pool
+ //Adding an image that is already added, or using an ID that is already in use
+ //are both errors and will cause the connection to terminate
+ AddImage(Image image, uint32 id);
+
+ //Remove an image from the pipe's pool
+ //Use of an invalid ID will cause the connection to be terminated
+ RemoveImage(uint32 id);
+
+ //Mark the image as available for consumption by the consumer
+ //The reply will be sent when the consumer is done using this image and
+ //is ready to release ownership back to the producer.
+ //The reply will not be sent until another Image is presented to replace it
+ //presentuing an id that is added will cause the connection to terminate
+ PresentImage(uint32 id) => (uint32 id, PresentationStatus status);
+
+ //Ask the consumer to release all images in the pipe's pool
+ //this will send the presentation reply with FLUSHED on all images in the pool
+ //not being used by the consumer if the consumer is presenting this image,
+ //that image may still be presented and its Present reply will reflect that
+ FlushImages();
+
+ //Get supported propertied for images added to this pipe
+ //The reply to this method will only be sent when the values change compared
+ //to the last time they were sent (immediately for the first time they are
+ //called), so to listen for continuous updates call this method immediately
+ //after recieving the reply
+ GetSupportedImageProperties() => (SupportedImageProperties supported_properties);
+};

Powered by Google App Engine
This is Rietveld 408576698