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

Unified Diff: mojo/services/gfx/composition/interfaces/resources.mojom

Issue 1552963002: Initial checkin of the new Mozart compositor. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-11
Patch Set: Created 4 years, 12 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/composition/interfaces/resources.mojom
diff --git a/mojo/services/gfx/composition/interfaces/resources.mojom b/mojo/services/gfx/composition/interfaces/resources.mojom
new file mode 100644
index 0000000000000000000000000000000000000000..f2f9a525d5567f27ae0bd8cca9301d6410b5672e
--- /dev/null
+++ b/mojo/services/gfx/composition/interfaces/resources.mojom
@@ -0,0 +1,62 @@
+// 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.
+
+[DartPackage="mojo_services"]
+module mojo.gfx.composition;
+
+import "mojo/services/geometry/interfaces/geometry.mojom";
+import "mojo/services/gfx/composition/interfaces/scene_token.mojom";
+
+// Resources are references to foreign objects which are being imported into
+// the scene graph, such as images and other scenes. Each resource must be
+// given a locally unique identifier when it is bound to the scene.
+union Resource {
+ SceneResource scene;
+ MailboxTextureResource mailbox_texture;
+};
+
+// Scene resource declaration.
+//
+// Binds a resource id to a scene given its scene token.
+//
+// If the scene referenced by the token becomes unavailable, the
+// |Scene.OnResourceUnavailable| event will be sent.
+struct SceneResource {
+ // The scene token of the referenced scene.
+ SceneToken scene_token;
+};
+
+// Mailbox texture resource declaration.
+//
+// Binds a resource id to a texture transferred via a GL mailbox.
+// Assumes the format is RGBA_8888 and the target is GL_TEXTURE_2D.
+//
+// If the texture referenced by the token becomes unavailable, the
+// |Scene.OnResourceUnavailable| event will be sent.
+//
+// TODO(jeffbrown): Replace this with Image and ImagePipe.
+struct MailboxTextureResource {
+ // The name of the mailbox, as produced by glGenMailboxCHROMIUM().
+ array<uint8, 64> mailbox_name;
+
+ // The sync point which indicates completion of texture rendering, as
+ // produced by glInsertSyncPointCHROMIUM().
+ uint32 sync_point;
+
+ // The size of the texture in pixels.
+ mojo.Size size;
+
+ // The callback interface to be notified when it is safe to release or
+ // recycle the underlying texture storage once the resource has been
+ // removed from the scene.
+ MailboxTextureCallback callback;
+};
+
+// Release callback for MailboxTextureResources.
+interface MailboxTextureCallback {
+ // Called some time after a mailbox texture is removed from the scene
+ // to indicate that it is now safe to release or recycle the underlying
+ // texture storage.
+ OnMailboxTextureReleased();
+};

Powered by Google App Engine
This is Rietveld 408576698