From de472286527828640709fe3dfcfb48d074e63098 Mon Sep 17 00:00:00 2001 From: "apatrick@chromium.org" Date: Fri, 29 Jul 2011 20:02:01 +0000 Subject: Allow the renderer process to map textures from one context into another. This is on an individual resource basis rather than general share groups in order to hide be able to hide the full namespace from untrusted plugins. Accelerated 2D canvas now no longer needs to copy its backing store on every page composite and the redundant backing texture is not needed, saving video memory. Unit tests for the GPU service to follow. Patch to delete copyTextureToParentTexture extensions from gpu/ to follow. BUG=90714 Review URL: http://codereview.chromium.org/7529015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94743 0039d316-1c4b-4281-b951-d872f2087c98 --- content/renderer/gpu/command_buffer_proxy.cc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'content/renderer/gpu/command_buffer_proxy.cc') diff --git a/content/renderer/gpu/command_buffer_proxy.cc b/content/renderer/gpu/command_buffer_proxy.cc index c4ec7a7..8c0967b 100644 --- a/content/renderer/gpu/command_buffer_proxy.cc +++ b/content/renderer/gpu/command_buffer_proxy.cc @@ -349,6 +349,27 @@ void CommandBufferProxy::OnSwapBuffers() { swap_buffers_callback_->Run(); } +bool CommandBufferProxy::MapExternalResource( + gpu::resource_type::ResourceType resource_type, + uint32 resource_source_id, + CommandBufferProxy* source_command_buffer, + uint32 resource_dest_id) { + if (last_state_.error != gpu::error::kNoError) + return false; + + if (!Send(new GpuCommandBufferMsg_MapExternalResource( + route_id_, + resource_type, + resource_source_id, + source_command_buffer ? + source_command_buffer->route_id() : MSG_ROUTING_NONE, + resource_dest_id))) { + return false; + } + + return true; +} + bool CommandBufferProxy::SetParent(CommandBufferProxy* parent_command_buffer, uint32 parent_texture_id) { if (last_state_.error != gpu::error::kNoError) -- cgit v1.1