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;
|
||||
|
||||
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();
|
||||
}
|
||||
|
@ -312,31 +312,6 @@ GLInProcessContextAttribs::GLInProcessContextAttribs()
|
||||
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 @@ GLInProcessContext* GLInProcessContext::Create(
|
||||
is_offscreen,
|
||||
use_global_share_group,
|
||||
share_context,
|
||||
gfx::kNullAcceleratedWidget,
|
||||
window,
|
||||
size,
|
||||
attribs,
|
||||
gpu_preference,
|
||||
|
@ -52,15 +52,6 @@ class GL_IN_PROCESS_CONTEXT_EXPORT GLInProcessContext {
|
||||
// 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
|
||||
|
@ -147,14 +147,15 @@ bool WebGraphicsContext3DInProcessCommandBufferImpl::MaybeInitializeGL() {
|
||||
// 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_) {
|
||||
|
Reference in New Issue
Block a user