diff options
author | scshunt@google.com <scshunt@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-29 21:54:55 +0000 |
---|---|---|
committer | scshunt@google.com <scshunt@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-29 21:54:55 +0000 |
commit | 9ed07f8831639f9d6c74b9633262710af532df5b (patch) | |
tree | 3df992da5b2e95a9b09ab4661c5a9352e4fac2d9 /content | |
parent | bdfa236676485f88c951929a7e5e2622541f9348 (diff) | |
download | chromium_src-9ed07f8831639f9d6c74b9633262710af532df5b.zip chromium_src-9ed07f8831639f9d6c74b9633262710af532df5b.tar.gz chromium_src-9ed07f8831639f9d6c74b9633262710af532df5b.tar.bz2 |
Add the necessary plumbing mechanisms to ensure proper WebGL support inside the <browser> tag, which is a separate patch.
Known bugs: Not all aspects of context sharing work properly; in no models would render although the background animated properly.
Requires a separate WebKit patch: https://bugs.webkit.org/show_bug.cgi?id=86504
R=fsamuel@chromium.org,piman@chromium.org,brettw@chromium.org
BUG=None
TEST=compiles
Review URL: https://chromiumcodereview.appspot.com/10386145
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139385 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
3 files changed, 13 insertions, 3 deletions
diff --git a/content/renderer/browser_plugin/guest_to_embedder_channel.cc b/content/renderer/browser_plugin/guest_to_embedder_channel.cc index ad82a68..1e5cec0 100644 --- a/content/renderer/browser_plugin/guest_to_embedder_channel.cc +++ b/content/renderer/browser_plugin/guest_to_embedder_channel.cc @@ -168,6 +168,7 @@ bool GuestToEmbedderChannel::CreateGraphicsContext( bool success = Send(new PpapiHostMsg_PPBGraphics3D_Create( ppapi::API_ID_PPB_GRAPHICS_3D, render_view->guest_pp_instance(), + ppapi::HostResource(), attribs, &resource)); if (!success || resource.is_null()) diff --git a/content/renderer/pepper/pepper_platform_context_3d_impl.cc b/content/renderer/pepper/pepper_platform_context_3d_impl.cc index 8e2f96a..670e9ab1 100644 --- a/content/renderer/pepper/pepper_platform_context_3d_impl.cc +++ b/content/renderer/pepper/pepper_platform_context_3d_impl.cc @@ -51,7 +51,8 @@ PlatformContext3DImpl::~PlatformContext3DImpl() { channel_ = NULL; } -bool PlatformContext3DImpl::Init(const int32* attrib_list) { +bool PlatformContext3DImpl::Init(const int32* attrib_list, + PlatformContext3D* share_context) { // Ignore initializing more than once. if (command_buffer_) return true; @@ -114,9 +115,16 @@ bool PlatformContext3DImpl::Init(const int32* attrib_list) { attribs.push_back(PP_GRAPHICS3DATTRIB_NONE); } + CommandBufferProxy* share_buffer = NULL; + if (share_context) { + PlatformContext3DImpl* share_impl = + static_cast<PlatformContext3DImpl*>(share_context); + share_buffer = share_impl->command_buffer_; + } + command_buffer_ = channel_->CreateOffscreenCommandBuffer( surface_size, - NULL, + share_buffer, "*", attribs, GURL::EmptyGURL(), diff --git a/content/renderer/pepper/pepper_platform_context_3d_impl.h b/content/renderer/pepper/pepper_platform_context_3d_impl.h index 8d3a0f6..bee7505 100644 --- a/content/renderer/pepper/pepper_platform_context_3d_impl.h +++ b/content/renderer/pepper/pepper_platform_context_3d_impl.h @@ -36,7 +36,8 @@ class PlatformContext3DImpl PepperParentContextProvider* parent_context_provider); virtual ~PlatformContext3DImpl(); - virtual bool Init(const int32* attrib_list) OVERRIDE; + virtual bool Init(const int32* attrib_list, + PlatformContext3D* share_context) OVERRIDE; virtual unsigned GetBackingTextureId() OVERRIDE; virtual bool IsOpaque() OVERRIDE; virtual gpu::CommandBuffer* GetCommandBuffer() OVERRIDE; |