Remove GLInProcessContext::CreateContext()
Change all CreateContext() calls to Context() and remove unnecessary code. BUG= Review URL: https://codereview.chromium.org/429863002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286952 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
cc/test
gpu/command_buffer/client
webkit/common/gpu
@@ -35,12 +35,16 @@ scoped_ptr<gpu::GLInProcessContext> CreateTestInProcessContext() {
|
|||||||
gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu;
|
gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu;
|
||||||
|
|
||||||
scoped_ptr<gpu::GLInProcessContext> context = make_scoped_ptr(
|
scoped_ptr<gpu::GLInProcessContext> context = make_scoped_ptr(
|
||||||
gpu::GLInProcessContext::CreateContext(is_offscreen,
|
gpu::GLInProcessContext::Create(NULL,
|
||||||
gfx::AcceleratedWidget(),
|
NULL,
|
||||||
gfx::Size(1, 1),
|
is_offscreen,
|
||||||
share_resources,
|
gfx::kNullAcceleratedWidget,
|
||||||
attribs,
|
gfx::Size(1, 1),
|
||||||
gpu_preference));
|
NULL,
|
||||||
|
share_resources,
|
||||||
|
attribs,
|
||||||
|
gpu_preference));
|
||||||
|
|
||||||
DCHECK(context);
|
DCHECK(context);
|
||||||
return context.Pass();
|
return context.Pass();
|
||||||
}
|
}
|
||||||
|
@@ -312,31 +312,6 @@ GLInProcessContextAttribs::GLInProcessContextAttribs()
|
|||||||
fail_if_major_perf_caveat(-1),
|
fail_if_major_perf_caveat(-1),
|
||||||
lose_context_when_out_of_memory(-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(
|
GLInProcessContext* GLInProcessContext::Create(
|
||||||
scoped_refptr<gpu::InProcessCommandBuffer::Service> service,
|
scoped_refptr<gpu::InProcessCommandBuffer::Service> service,
|
||||||
scoped_refptr<gfx::GLSurface> surface,
|
scoped_refptr<gfx::GLSurface> surface,
|
||||||
@@ -359,7 +334,7 @@ GLInProcessContext* GLInProcessContext::Create(
|
|||||||
is_offscreen,
|
is_offscreen,
|
||||||
use_global_share_group,
|
use_global_share_group,
|
||||||
share_context,
|
share_context,
|
||||||
gfx::kNullAcceleratedWidget,
|
window,
|
||||||
size,
|
size,
|
||||||
attribs,
|
attribs,
|
||||||
gpu_preference,
|
gpu_preference,
|
||||||
|
@@ -52,15 +52,6 @@ class GL_IN_PROCESS_CONTEXT_EXPORT GLInProcessContext {
|
|||||||
// Create a GLInProcessContext, if |is_offscreen| is true, renders to an
|
// Create a GLInProcessContext, if |is_offscreen| is true, renders to an
|
||||||
// offscreen context. |attrib_list| must be NULL or a NONE-terminated list
|
// offscreen context. |attrib_list| must be NULL or a NONE-terminated list
|
||||||
// of attribute/value pairs.
|
// 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|,
|
// If |surface| is not NULL, then it must match |is_offscreen| and |size|,
|
||||||
// |window| must be gfx::kNullAcceleratedWidget, and the command buffer
|
// |window| must be gfx::kNullAcceleratedWidget, and the command buffer
|
||||||
// service must run on the same thread as this client because GLSurface is
|
// service must run on the same thread as this client because GLSurface is
|
||||||
|
@@ -147,14 +147,15 @@ bool WebGraphicsContext3DInProcessCommandBufferImpl::MaybeInitializeGL() {
|
|||||||
// will need to be lost either when the first context requesting the
|
// will need to be lost either when the first context requesting the
|
||||||
// discrete GPU is created, or the last one is destroyed.
|
// discrete GPU is created, or the last one is destroyed.
|
||||||
gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu;
|
gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu;
|
||||||
|
context_.reset(GLInProcessContext::Create(NULL, /* service */
|
||||||
context_.reset(GLInProcessContext::CreateContext(
|
NULL, /* surface */
|
||||||
is_offscreen_,
|
is_offscreen_,
|
||||||
window_,
|
window_,
|
||||||
gfx::Size(1, 1),
|
gfx::Size(1, 1),
|
||||||
share_resources_,
|
NULL, /* share_context */
|
||||||
attribs_,
|
share_resources_,
|
||||||
gpu_preference));
|
attribs_,
|
||||||
|
gpu_preference));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (context_) {
|
if (context_) {
|
||||||
|
Reference in New Issue
Block a user