Implemented support for GL context share groups in the renderer process.I put all compositor and canvas contexts in the same share group so they can share IDs.
Review URL: http://codereview.chromium.org/7554015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95345 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc
index e1e95bb..82916484 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -29,6 +29,7 @@
GpuCommandBufferStub::GpuCommandBufferStub(
GpuChannel* channel,
+ GpuCommandBufferStub* share_group,
gfx::PluginWindowHandle handle,
const gfx::Size& size,
const gpu::gles2::DisallowedExtensions& disallowed_extensions,
@@ -54,6 +55,10 @@
parent_texture_for_initialization_(0),
watchdog_(watchdog),
task_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
+ if (share_group)
+ context_group_ = share_group->context_group_;
+ else
+ context_group_ = new gpu::gles2::ContextGroup;
}
GpuCommandBufferStub::~GpuCommandBufferStub() {
@@ -147,7 +152,7 @@
if (command_buffer_->Initialize(&shared_memory, size)) {
scheduler_.reset(gpu::GpuScheduler::Create(command_buffer_.get(),
channel_,
- NULL));
+ context_group_.get()));
#if defined(TOUCH_UI)
if (software_) {
OnInitializeFailed(reply_message);