diff options
author | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-15 22:52:07 +0000 |
---|---|---|
committer | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-15 22:52:07 +0000 |
commit | 52ee7cf440651a46bbfabb57e6b482f9d6d7db6b (patch) | |
tree | 2a3fdbb44af7b4f60b16b043a73b68d5bda05296 /webkit/gpu/webgraphicscontext3d_in_process_impl.cc | |
parent | 2dba717e66fbaadb77cf768c0855c683f5bc4a9a (diff) | |
download | chromium_src-52ee7cf440651a46bbfabb57e6b482f9d6d7db6b.zip chromium_src-52ee7cf440651a46bbfabb57e6b482f9d6d7db6b.tar.gz chromium_src-52ee7cf440651a46bbfabb57e6b482f9d6d7db6b.tar.bz2 |
Allow specification of the share group in WebGraphicsContext3DInProcessImpl
BUG=None
TEST=Aura + WebKit compositor
Review URL: http://codereview.chromium.org/8301019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105691 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/gpu/webgraphicscontext3d_in_process_impl.cc')
-rw-r--r-- | webkit/gpu/webgraphicscontext3d_in_process_impl.cc | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/webkit/gpu/webgraphicscontext3d_in_process_impl.cc b/webkit/gpu/webgraphicscontext3d_in_process_impl.cc index 5485a73..daf6604 100644 --- a/webkit/gpu/webgraphicscontext3d_in_process_impl.cc +++ b/webkit/gpu/webgraphicscontext3d_in_process_impl.cc @@ -43,7 +43,8 @@ struct WebGraphicsContext3DInProcessImpl::ShaderSourceEntry { }; WebGraphicsContext3DInProcessImpl::WebGraphicsContext3DInProcessImpl( - gfx::PluginWindowHandle window) + gfx::PluginWindowHandle window, + gfx::GLShareGroup* share_group) : initialized_(false), render_directly_to_web_view_(false), is_gles2_(false), @@ -66,7 +67,8 @@ WebGraphicsContext3DInProcessImpl::WebGraphicsContext3DInProcessImpl( #endif fragment_compiler_(0), vertex_compiler_(0), - window_(window) { + window_(window), + share_group_(share_group) { } WebGraphicsContext3DInProcessImpl::~WebGraphicsContext3DInProcessImpl() { @@ -114,27 +116,27 @@ bool WebGraphicsContext3DInProcessImpl::initialize( render_directly_to_web_view_ = render_directly_to_web_view; gfx::GLShareGroup* share_group = 0; - if (!render_directly_to_web_view) { - // Pick up the compositor's context to share resources with. - WebGraphicsContext3D* view_context = webView ? - webView->graphicsContext3D() : NULL; - if (view_context) { - WebGraphicsContext3DInProcessImpl* contextImpl = - static_cast<WebGraphicsContext3DInProcessImpl*>(view_context); - share_group = contextImpl->gl_context_->share_group(); - } else { - // The compositor's context didn't get created - // successfully, so conceptually there is no way we can - // render successfully to the WebView. - render_directly_to_web_view_ = false; - } - } - is_gles2_ = gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2; if (window_ != gfx::kNullPluginWindow) { + share_group = share_group_; gl_surface_ = gfx::GLSurface::CreateViewGLSurface(false, window_); } else { + if (!render_directly_to_web_view) { + // Pick up the compositor's context to share resources with. + WebGraphicsContext3D* view_context = webView ? + webView->graphicsContext3D() : NULL; + if (view_context) { + WebGraphicsContext3DInProcessImpl* contextImpl = + static_cast<WebGraphicsContext3DInProcessImpl*>(view_context); + share_group = contextImpl->gl_context_->share_group(); + } else { + // The compositor's context didn't get created + // successfully, so conceptually there is no way we can + // render successfully to the WebView. + render_directly_to_web_view_ = false; + } + } // This implementation always renders offscreen regardless of // whether render_directly_to_web_view is true. Both DumpRenderTree // and test_shell paint first to an intermediate offscreen buffer |