Index: mojo/services/gles2/command_buffer_impl.cc |
diff --git a/mojo/services/gles2/command_buffer_impl.cc b/mojo/services/gles2/command_buffer_impl.cc |
index 1c25887260f01621fe2a24426ac80171dea30a75..d3b9137f40fb48a242c1fce0fdb59ff9bc7ee042 100644 |
--- a/mojo/services/gles2/command_buffer_impl.cc |
+++ b/mojo/services/gles2/command_buffer_impl.cc |
@@ -45,25 +45,9 @@ |
} // anonymous namespace |
-CommandBufferImpl::CommandBufferImpl( |
- gfx::GLShareGroup* share_group, |
- gpu::gles2::MailboxManager* mailbox_manager) |
- : widget_(gfx::kNullAcceleratedWidget), |
- size_(1, 1), |
- share_group_(share_group), |
- mailbox_manager_(mailbox_manager) { |
-} |
- |
-CommandBufferImpl::CommandBufferImpl( |
- gfx::AcceleratedWidget widget, |
- const gfx::Size& size, |
- gfx::GLShareGroup* share_group, |
- gpu::gles2::MailboxManager* mailbox_manager) |
- : widget_(widget), |
- size_(size), |
- share_group_(share_group), |
- mailbox_manager_(mailbox_manager) { |
-} |
+CommandBufferImpl::CommandBufferImpl(gfx::AcceleratedWidget widget, |
+ const gfx::Size& size) |
+ : widget_(widget), size_(size) {} |
CommandBufferImpl::~CommandBufferImpl() { |
client()->DidDestroy(); |
@@ -82,26 +66,24 @@ |
bool CommandBufferImpl::DoInitialize( |
mojo::ScopedSharedBufferHandle shared_state) { |
- if (widget_ == gfx::kNullAcceleratedWidget) |
- surface_ = gfx::GLSurface::CreateOffscreenGLSurface(size_); |
- else |
- surface_ = gfx::GLSurface::CreateViewGLSurface(widget_); |
+ // TODO(piman): offscreen surface. |
+ surface_ = gfx::GLSurface::CreateViewGLSurface(widget_); |
if (!surface_.get()) |
return false; |
- // TODO(piman): virtual contexts, gpu preference. |
- context_ = gfx::GLContext::CreateGLContext( |
- share_group_, surface_.get(), gfx::PreferIntegratedGpu); |
- if (!context_.get()) |
+ // TODO(piman): context sharing, virtual contexts, gpu preference. |
+ scoped_refptr<gfx::GLContext> context = gfx::GLContext::CreateGLContext( |
+ NULL, surface_.get(), gfx::PreferIntegratedGpu); |
+ if (!context.get()) |
return false; |
- if (!context_->MakeCurrent(surface_.get())) |
+ if (!context->MakeCurrent(surface_.get())) |
return false; |
// TODO(piman): ShaderTranslatorCache is currently per-ContextGroup but |
// only needs to be per-thread. |
scoped_refptr<gpu::gles2::ContextGroup> context_group = |
- new gpu::gles2::ContextGroup(mailbox_manager_, |
+ new gpu::gles2::ContextGroup(NULL, |
new MemoryTrackerStub, |
new gpu::gles2::ShaderTranslatorCache, |
NULL, |
@@ -124,7 +106,7 @@ |
// TODO(piman): attributes. |
std::vector<int32> attrib_vector; |
if (!decoder_->Initialize(surface_, |
- context_, |
+ context, |
false /* offscreen */, |
size_, |
disallowed_features, |
@@ -155,11 +137,6 @@ |
} |
void CommandBufferImpl::Flush(int32_t put_offset) { |
- if (!context_->MakeCurrent(surface_.get())) { |
- DLOG(WARNING) << "Context lost"; |
- client()->LostContext(gpu::error::kUnknown); |
- return; |
- } |
command_buffer_->Flush(put_offset); |
} |