summaryrefslogtreecommitdiffstats
path: root/content/renderer/gpu/command_buffer_proxy.cc
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-29 20:02:01 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-29 20:02:01 +0000
commitde472286527828640709fe3dfcfb48d074e63098 (patch)
tree4873318953ce9b06f7e3742430f865df70893267 /content/renderer/gpu/command_buffer_proxy.cc
parentcf0a77e1e18f547316c8da0a55c3ddeedae18263 (diff)
downloadchromium_src-de472286527828640709fe3dfcfb48d074e63098.zip
chromium_src-de472286527828640709fe3dfcfb48d074e63098.tar.gz
chromium_src-de472286527828640709fe3dfcfb48d074e63098.tar.bz2
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
Diffstat (limited to 'content/renderer/gpu/command_buffer_proxy.cc')
-rw-r--r--content/renderer/gpu/command_buffer_proxy.cc21
1 files changed, 21 insertions, 0 deletions
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)