Cherry-pick: Remove GLInProcessContext::CreateContext()
Clean cherry-pick of chromium crrev.com/r286952
Original description:
Change all CreateContext() calls to Context() and remove unnecessary code.
Change-Id: I81054d0af32dc165464d7f20b9b5a0a46fb824be
diff --git a/cc/test/test_in_process_context_provider.cc b/cc/test/test_in_process_context_provider.cc
index 5005c06..55e3239 100644
--- a/cc/test/test_in_process_context_provider.cc
+++ b/cc/test/test_in_process_context_provider.cc
@@ -35,12 +35,16 @@
gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu;
scoped_ptr<gpu::GLInProcessContext> context = make_scoped_ptr(
- gpu::GLInProcessContext::CreateContext(is_offscreen,
- gfx::AcceleratedWidget(),
- gfx::Size(1, 1),
- share_resources,
- attribs,
- gpu_preference));
+ gpu::GLInProcessContext::Create(NULL,
+ NULL,
+ is_offscreen,
+ gfx::kNullAcceleratedWidget,
+ gfx::Size(1, 1),
+ NULL,
+ share_resources,
+ attribs,
+ gpu_preference));
+
DCHECK(context);
return context.Pass();
}
diff --git a/gpu/command_buffer/client/gl_in_process_context.cc b/gpu/command_buffer/client/gl_in_process_context.cc
index 33d4156..bfcea4a 100644
--- a/gpu/command_buffer/client/gl_in_process_context.cc
+++ b/gpu/command_buffer/client/gl_in_process_context.cc
@@ -312,31 +312,6 @@
fail_if_major_perf_caveat(-1),
lose_context_when_out_of_memory(-1) {}
-// static
-GLInProcessContext* GLInProcessContext::CreateContext(
- bool is_offscreen,
- gfx::AcceleratedWidget window,
- const gfx::Size& size,
- bool share_resources,
- const GLInProcessContextAttribs& attribs,
- gfx::GpuPreference gpu_preference) {
- scoped_ptr<GLInProcessContextImpl> context(
- new GLInProcessContextImpl());
- if (!context->Initialize(
- NULL /* surface */,
- is_offscreen,
- share_resources,
- NULL,
- window,
- size,
- attribs,
- gpu_preference,
- scoped_refptr<InProcessCommandBuffer::Service>()))
- return NULL;
-
- return context.release();
-}
-
GLInProcessContext* GLInProcessContext::Create(
scoped_refptr<gpu::InProcessCommandBuffer::Service> service,
scoped_refptr<gfx::GLSurface> surface,
@@ -359,7 +334,7 @@
is_offscreen,
use_global_share_group,
share_context,
- gfx::kNullAcceleratedWidget,
+ window,
size,
attribs,
gpu_preference,
diff --git a/gpu/command_buffer/client/gl_in_process_context.h b/gpu/command_buffer/client/gl_in_process_context.h
index c1478b1..6c3a485 100644
--- a/gpu/command_buffer/client/gl_in_process_context.h
+++ b/gpu/command_buffer/client/gl_in_process_context.h
@@ -52,15 +52,6 @@
// Create a GLInProcessContext, if |is_offscreen| is true, renders to an
// offscreen context. |attrib_list| must be NULL or a NONE-terminated list
// of attribute/value pairs.
- // TODO(boliu): Fix all callsites to use Create and remove this.
- static GLInProcessContext* CreateContext(
- bool is_offscreen,
- gfx::AcceleratedWidget window,
- const gfx::Size& size,
- bool share_resources,
- const GLInProcessContextAttribs& attribs,
- gfx::GpuPreference gpu_preference);
-
// If |surface| is not NULL, then it must match |is_offscreen| and |size|,
// |window| must be gfx::kNullAcceleratedWidget, and the command buffer
// service must run on the same thread as this client because GLSurface is
diff --git a/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc b/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
index 3ce34fe..2ca9613 100644
--- a/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
+++ b/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
@@ -154,14 +154,15 @@
// will need to be lost either when the first context requesting the
// discrete GPU is created, or the last one is destroyed.
gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu;
-
- context_.reset(GLInProcessContext::CreateContext(
- is_offscreen_,
- window_,
- gfx::Size(1, 1),
- share_resources_,
- attribs_,
- gpu_preference));
+ context_.reset(GLInProcessContext::Create(NULL, /* service */
+ NULL, /* surface */
+ is_offscreen_,
+ window_,
+ gfx::Size(1, 1),
+ NULL, /* share_context */
+ share_resources_,
+ attribs_,
+ gpu_preference));
}
if (context_) {