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

Unified Diff: webkit/gpu/webgraphicscontext3d_in_process_impl.cc

Issue 8301019: Allow specification of the share group in WebGraphicsContext3DInProcessImpl (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 2 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
« no previous file with comments | « webkit/gpu/webgraphicscontext3d_in_process_impl.h ('k') | webkit/support/test_webkit_platform_support.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/gpu/webgraphicscontext3d_in_process_impl.cc
diff --git a/webkit/gpu/webgraphicscontext3d_in_process_impl.cc b/webkit/gpu/webgraphicscontext3d_in_process_impl.cc
index 5485a73a6d6456058514939e4988ff92420119e1..daf6604f3fee4cbb1f001656e391ea4c71dd5aba 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
« no previous file with comments | « webkit/gpu/webgraphicscontext3d_in_process_impl.h ('k') | webkit/support/test_webkit_platform_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698