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

Unified Diff: content/common/gpu/gpu_messages.h

Issue 7529015: Allow the renderer process to map textures from one context into another. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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: content/common/gpu/gpu_messages.h
===================================================================
--- content/common/gpu/gpu_messages.h (revision 94701)
+++ content/common/gpu/gpu_messages.h (working copy)
@@ -102,6 +102,7 @@
IPC_ENUM_TRAITS(content::CauseForGpuLaunch)
IPC_ENUM_TRAITS(gpu::error::ContextLostReason)
+IPC_ENUM_TRAITS(gpu::resource_type::ResourceType)
//------------------------------------------------------------------------------
// GPU Messages
@@ -318,6 +319,28 @@
int32 /* size */,
bool /* result */)
+
+// Map a resource from an external context into this context. The source
+// context need not be in the same share group from the client's point of
+// view, allowing safe sharing between an "untrusted" context, like Pepper
+// and a compositor context.
+//
+// Currently only texture resources are supported. TODO(apatrick): generalize
+// this as appropriate.
+//
+// To unmap a previously mapped external resource, delete it in the
+// destination context group. This will not delete the underlying texture
+// object, just disassociate it with the id in the destination context group.
+//
+// The lifetime of the external resource is managed by the context group it
+// was originally created in. When the last context in that group is destroyed
+// the resource becomes invalid in all other context groups it is mapped into.
+IPC_MESSAGE_ROUTED4(GpuCommandBufferMsg_MapExternalResource,
+ gpu::resource_type::ResourceType /* resource_type */,
+ uint32 /* resource_source_id */,
+ int32 /* source_route_id */,
+ uint32 /* resource_dest_id */)
+
// Sets the parent command buffer. This allows the parent and child to share
// textures.
IPC_SYNC_MESSAGE_ROUTED2_1(GpuCommandBufferMsg_SetParent,

Powered by Google App Engine
This is Rietveld 408576698