Index: mojo/services/gles2/gpu_impl.cc |
diff --git a/mojo/services/gles2/gpu_impl.cc b/mojo/services/gles2/gpu_impl.cc |
index 593c614539035ef60416c8b78e92a35ca00561ed..7b3340667bd3f711d800c285cc5bb5a03101a619 100644 |
--- a/mojo/services/gles2/gpu_impl.cc |
+++ b/mojo/services/gles2/gpu_impl.cc |
@@ -5,20 +5,28 @@ |
#include "mojo/services/gles2/gpu_impl.h" |
#include "gpu/command_buffer/service/mailbox_manager.h" |
+#include "gpu/command_buffer/service/mailbox_manager_impl.h" |
#include "mojo/converters/geometry/geometry_type_converters.h" |
#include "mojo/services/gles2/command_buffer_driver.h" |
#include "mojo/services/gles2/command_buffer_impl.h" |
#include "ui/gl/gl_share_group.h" |
+#include "ui/gl/gl_surface.h" |
namespace mojo { |
-GpuImpl::GpuImpl( |
- InterfaceRequest<Gpu> request, |
- const scoped_refptr<gfx::GLShareGroup>& share_group, |
- const scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager) |
- : share_group_(share_group), |
- mailbox_manager_(mailbox_manager), |
- binding_(this, request.Pass()) { |
+GpuImpl::State::State() |
+ : control_thread_("gpu_command_buffer_control"), |
+ share_group_(new gfx::GLShareGroup), |
+ mailbox_manager_(new gpu::gles2::MailboxManagerImpl) { |
+ control_thread_.Start(); |
+} |
+ |
+GpuImpl::State::~State() { |
+} |
+ |
+GpuImpl::GpuImpl(InterfaceRequest<Gpu> request, |
+ const scoped_refptr<State>& state) |
+ : binding_(this, request.Pass()), state_(state) { |
} |
GpuImpl::~GpuImpl() { |
@@ -30,17 +38,17 @@ void GpuImpl::CreateOnscreenGLES2Context( |
InterfaceRequest<CommandBuffer> request) { |
gfx::AcceleratedWidget widget = bit_cast<gfx::AcceleratedWidget>( |
static_cast<uintptr_t>(native_viewport_id)); |
- new CommandBufferImpl(request.Pass(), |
+ new CommandBufferImpl(request.Pass(), state_->control_task_runner(), |
make_scoped_ptr(new CommandBufferDriver( |
- widget, size.To<gfx::Size>(), share_group_.get(), |
- mailbox_manager_.get()))); |
+ widget, size.To<gfx::Size>(), state_->share_group(), |
+ state_->mailbox_manager()))); |
} |
void GpuImpl::CreateOffscreenGLES2Context( |
InterfaceRequest<CommandBuffer> request) { |
- new CommandBufferImpl(request.Pass(), |
+ new CommandBufferImpl(request.Pass(), state_->control_task_runner(), |
make_scoped_ptr(new CommandBufferDriver( |
- share_group_.get(), mailbox_manager_.get()))); |
+ state_->share_group(), state_->mailbox_manager()))); |
} |
} // namespace mojo |