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

Unified Diff: mojo/services/gfx/images/interfaces/image.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.mojom
diff --git a/mojo/services/gfx/images/interfaces/image.mojom b/mojo/services/gfx/images/interfaces/image.mojom
new file mode 100644
index 0000000000000000000000000000000000000000..d3ca0339a0bd6e4b7661e8105a676c59866fb314
--- /dev/null
+++ b/mojo/services/gfx/images/interfaces/image.mojom
@@ -0,0 +1,47 @@
+// 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";
+
+//This should probably be a system wide list (maybe in exists already?) since
jamesr 2016/02/18 20:40:59 space after "//"
Forrest Reiling 2016/02/25 00:35:15 Done.
+//this is undoubtably not the only interface that will care about color formats
+enum PixelLayout {
+ RGBA_8888 = 0,
+ BGRA_8888 = 1,
jamesr 2016/02/18 20:40:59 do we actually support both of these? can we just
Forrest Reiling 2016/02/25 00:35:15 I think these come from differences in GL vs Vulka
+};
+
+enum ColorSpace {
+ SRGB = 0,
+};
+
+struct ColorFormat {
+ PixelLayout layout;
+ ColorSpace color_space;
+};
+
+//ImageBuffer is a thin wrapper around a handle for a platform memory handle
+//which includes some basic metadata about the image. This may eventually be
+//provided by some other, more general purpose system This should probably be
+//where we put flags/properties about the buffer that are not image specific
+//(Like whether it is CPU or GPU memory, what the layout is like, etc.)
+struct ImageBuffer {
+ uint64 size;
+ handle data;
+};
+
+//Image wraps ImageBuffer and provides image-specific metadata for the buffer
+struct Image {
+ mojo.Size size; //width and height of image in pixels
+ uint32 stride; //bytes per row
+ uint32 pitch; // pixels per row
+ ColorFormat format; //pixel format
+ ImageBuffer buffer;
+};
+
+struct SupportedImageProperties {
+ array<ColorFormat> formats;
+ mojo.Size size;
+};

Powered by Google App Engine
This is Rietveld 408576698