Index: ui/compositor/compositor.cc |
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc |
index 88cfc5637176e296d770d92653b7cc50c21c197c..5edffee8ec3f2431de4972530453527c214cf15a 100644 |
--- a/ui/compositor/compositor.cc |
+++ b/ui/compositor/compositor.cc |
@@ -109,17 +109,13 @@ bool DefaultContextFactory::Initialize() { |
scoped_ptr<cc::OutputSurface> DefaultContextFactory::CreateOutputSurface( |
Compositor* compositor) { |
- WebKit::WebGraphicsContext3D::Attributes attrs; |
- attrs.depth = false; |
- attrs.stencil = false; |
- attrs.antialias = false; |
- attrs.shareResources = true; |
- using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl; |
- scoped_ptr<WebKit::WebGraphicsContext3D> context( |
- WebGraphicsContext3DInProcessCommandBufferImpl::CreateViewContext( |
- attrs, compositor->widget())); |
- return make_scoped_ptr(new cc::OutputSurface(context.Pass())); |
+ using webkit::gpu::ContextProviderInProcess; |
+ scoped_refptr<ContextProviderInProcess> context_provider = |
+ ContextProviderInProcess::Create( |
+ base::Bind(&DefaultContextFactory::CreateViewContext, compositor)); |
+ DCHECK(context_provider.get()); |
+ return make_scoped_ptr(new cc::OutputSurface(context_provider)); |
} |
scoped_refptr<Reflector> DefaultContextFactory::CreateReflector( |
@@ -160,15 +156,31 @@ void DefaultContextFactory::RemoveCompositor(Compositor* compositor) { |
bool DefaultContextFactory::DoesCreateTestContexts() { return false; } |
+// static |
+scoped_ptr<webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl> |
+DefaultContextFactory::CreateViewContext(Compositor* compositor) { |
+ WebKit::WebGraphicsContext3D::Attributes attrs; |
+ attrs.depth = false; |
+ attrs.stencil = false; |
+ attrs.antialias = false; |
+ attrs.shareResources = true; |
+ |
+ using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl; |
+ scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context( |
+ WebGraphicsContext3DInProcessCommandBufferImpl::CreateViewContext( |
+ attrs, compositor->widget())); |
+ CHECK(context); |
+ return context.Pass(); |
+} |
+ |
TestContextFactory::TestContextFactory() {} |
TestContextFactory::~TestContextFactory() {} |
scoped_ptr<cc::OutputSurface> TestContextFactory::CreateOutputSurface( |
Compositor* compositor) { |
- scoped_ptr<WebKit::WebGraphicsContext3D> context( |
- cc::TestWebGraphicsContext3D::Create()); |
- return make_scoped_ptr(new cc::OutputSurface(context.Pass())); |
+ return make_scoped_ptr( |
+ new cc::OutputSurface(cc::TestContextProvider::Create())); |
} |
scoped_refptr<Reflector> TestContextFactory::CreateReflector( |