summaryrefslogtreecommitdiffstats
path: root/webkit/gpu
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-27 01:01:04 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-27 01:01:04 +0000
commit25d478179a5d334f1c691948e0c13990a88dfbf3 (patch)
tree824210b4fb043d47b8ba5faa852da1612fcb30c1 /webkit/gpu
parent583844c2df50f0f2188aab7eed3fbcc40e499511 (diff)
downloadchromium_src-25d478179a5d334f1c691948e0c13990a88dfbf3.zip
chromium_src-25d478179a5d334f1c691948e0c13990a88dfbf3.tar.gz
chromium_src-25d478179a5d334f1c691948e0c13990a88dfbf3.tar.bz2
Use 3D graphics context shareResources flag to decide whether a context should share resources.
Before, it abused the noExtensions flag to determine to disable share groups for WebGL, which was awful. This patch is dependent on https://bugs.webkit.org/show_bug.cgi?id=66516. See also http://codereview.chromium.org/7669072 where I perpetrated the aforementioned hack. BUG=92356 Review URL: http://codereview.chromium.org/7669072 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98527 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/gpu')
-rw-r--r--webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc20
1 files changed, 8 insertions, 12 deletions
diff --git a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
index 4c4f05e..ae81c98 100644
--- a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
+++ b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
@@ -198,8 +198,8 @@ const int32 kCommandBufferSize = 1024 * 1024;
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 {
@@ -575,7 +575,7 @@ WebGraphicsContext3DInProcessCommandBufferImpl::
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!!!
@@ -627,14 +627,10 @@ bool WebGraphicsContext3DInProcessCommandBufferImpl::initialize(
}
}
- // 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,
@@ -672,8 +668,8 @@ bool WebGraphicsContext3DInProcessCommandBufferImpl::initialize(
}
makeContextCurrent();
- if (!attributes.noExtensions)
- g_all_contexts.Pointer()->insert(this);
+ if (attributes.shareResources)
+ g_all_shared_contexts.Pointer()->insert(this);
return true;
}