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

Unified Diff: gpu/command_buffer/client/gl_in_process_context.cc

Issue 143023005: Support multiple service instances with GLInProcessContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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: gpu/command_buffer/client/gl_in_process_context.cc
diff --git a/gpu/command_buffer/client/gl_in_process_context.cc b/gpu/command_buffer/client/gl_in_process_context.cc
index 1bd4c6254572f4a1459c921cc28c91ad9ec1deec..24cb829889edf4535f358a24568c015726b3cfa1 100644
--- a/gpu/command_buffer/client/gl_in_process_context.cc
+++ b/gpu/command_buffer/client/gl_in_process_context.cc
@@ -26,7 +26,6 @@
#include "gpu/command_buffer/client/transfer_buffer.h"
#include "gpu/command_buffer/common/command_buffer.h"
#include "gpu/command_buffer/common/constants.h"
-#include "gpu/command_buffer/service/in_process_command_buffer.h"
#include "ui/gfx/size.h"
#include "ui/gl/gl_image.h"
@@ -52,13 +51,15 @@ class GLInProcessContextImpl
explicit GLInProcessContextImpl();
virtual ~GLInProcessContextImpl();
- bool Initialize(scoped_refptr<gfx::GLSurface> surface,
- bool is_offscreen,
- bool share_resources,
- gfx::AcceleratedWidget window,
- const gfx::Size& size,
- const GLInProcessContextAttribs& attribs,
- gfx::GpuPreference gpu_preference);
+ bool Initialize(
+ scoped_refptr<gfx::GLSurface> surface,
+ bool is_offscreen,
+ bool share_resources,
+ gfx::AcceleratedWidget window,
+ const gfx::Size& size,
+ const GLInProcessContextAttribs& attribs,
+ gfx::GpuPreference gpu_preference,
+ const scoped_refptr<InProcessCommandBuffer::Service>& service);
// GLInProcessContext implementation:
virtual void SetContextLostCallback(const base::Closure& callback) OVERRIDE;
@@ -125,7 +126,8 @@ bool GLInProcessContextImpl::Initialize(
gfx::AcceleratedWidget window,
const gfx::Size& size,
const GLInProcessContextAttribs& attribs,
- gfx::GpuPreference gpu_preference) {
+ gfx::GpuPreference gpu_preference,
+ const scoped_refptr<InProcessCommandBuffer::Service>& service) {
DCHECK(size.width() >= 0 && size.height() >= 0);
// Changes to these values should also be copied to
@@ -185,7 +187,7 @@ bool GLInProcessContextImpl::Initialize(
base::Closure wrapped_callback =
base::Bind(&GLInProcessContextImpl::OnContextLost, AsWeakPtr());
- command_buffer_.reset(new InProcessCommandBuffer());
+ command_buffer_.reset(new InProcessCommandBuffer(service));
scoped_ptr<base::AutoLock> scoped_shared_context_lock;
scoped_refptr<gles2::ShareGroup> share_group;
@@ -313,7 +315,8 @@ GLInProcessContext* GLInProcessContext::CreateContext(
window,
size,
attribs,
- gpu_preference))
+ gpu_preference,
+ scoped_refptr<InProcessCommandBuffer::Service>()))
return NULL;
return context.release();
@@ -322,6 +325,7 @@ GLInProcessContext* GLInProcessContext::CreateContext(
// static
GLInProcessContext* GLInProcessContext::CreateWithSurface(
scoped_refptr<gfx::GLSurface> surface,
+ scoped_refptr<gpu::InProcessCommandBuffer::Service> service,
bool share_resources,
const GLInProcessContextAttribs& attribs,
gfx::GpuPreference gpu_preference) {
@@ -334,7 +338,8 @@ GLInProcessContext* GLInProcessContext::CreateWithSurface(
gfx::kNullAcceleratedWidget,
surface->GetSize(),
attribs,
- gpu_preference))
+ gpu_preference,
+ scoped_refptr<InProcessCommandBuffer::Service>()))
boliu 2014/02/10 18:42:08 oh, need to pass service param here, updated https
no sievers 2014/02/12 03:09:15 Doh, thanks.
return NULL;
return context.release();

Powered by Google App Engine
This is Rietveld 408576698