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

Unified Diff: webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc

Issue 7669072: Use 3D graphics context shareResources flag to decide whether a context should share resources. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 4 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
Index: webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
===================================================================
--- webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc (revision 97282)
+++ webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc (working copy)
@@ -213,8 +213,8 @@
const int32 kTransferBufferSize = 1024 * 1024;
static base::LazyInstance<
- std::set<WebGraphicsContext3DInProcessCommandBufferImpl*> > g_all_contexts(
- base::LINKER_INITIALIZED);
+ std::set<WebGraphicsContext3DInProcessCommandBufferImpl*> >
+ g_all_shared_contexts(base::LINKER_INITIALIZED);
// Singleton used to initialize and terminate the gles2 library.
class GLES2Initializer {
@@ -609,7 +609,7 @@
WebGraphicsContext3DInProcessCommandBufferImpl::
~WebGraphicsContext3DInProcessCommandBufferImpl() {
- g_all_contexts.Pointer()->erase(this);
+ g_all_shared_contexts.Pointer()->erase(this);
}
// This string should only be passed for WebGL contexts. Nothing ELSE!!!
@@ -661,14 +661,10 @@
}
}
- // HACK: Assume this is a WebGL context by looking for the noExtensions
- // attribute. WebGL contexts must not go in the share group because they
- // rely on destruction of the context to clean up owned resources. Putting
- // them in a share group would prevent this from happening.
WebGraphicsContext3DInProcessCommandBufferImpl* context_group = NULL;
- if (!attributes.noExtensions)
- context_group = g_all_contexts.Pointer()->empty() ?
- NULL : *g_all_contexts.Pointer()->begin();
+ if (attributes.shareResources)
+ context_group = g_all_shared_contexts.Pointer()->empty() ?
+ NULL : *g_all_shared_contexts.Pointer()->begin();
context_ = GLInProcessContext::CreateOffscreenContext(
parent_context,
@@ -706,8 +702,8 @@
}
makeContextCurrent();
- if (!attributes.noExtensions)
- g_all_contexts.Pointer()->insert(this);
+ if (attributes.shareResources)
+ g_all_shared_contexts.Pointer()->insert(this);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698