| Index: content/browser/android/in_process/synchronous_compositor_factory_impl.cc
|
| diff --git a/content/browser/android/in_process/synchronous_compositor_factory_impl.cc b/content/browser/android/in_process/synchronous_compositor_factory_impl.cc
|
| index af50011c7b90b994f70ed2c229f1e85f16075a5b..006a3c6e29efff014b75a4570f001feb709756f2 100644
|
| --- a/content/browser/android/in_process/synchronous_compositor_factory_impl.cc
|
| +++ b/content/browser/android/in_process/synchronous_compositor_factory_impl.cc
|
| @@ -44,38 +44,41 @@ scoped_ptr<gpu::GLInProcessContext> CreateOffscreenContext(
|
| attributes, &in_process_attribs);
|
| in_process_attribs.lose_context_when_out_of_memory = true;
|
|
|
| - scoped_ptr<gpu::GLInProcessContext> context(
|
| - gpu::GLInProcessContext::Create(NULL /* service */,
|
| - NULL /* surface */,
|
| - true /* is_offscreen */,
|
| - gfx::kNullAcceleratedWidget,
|
| - gfx::Size(1, 1),
|
| - NULL /* share_context */,
|
| - false /* share_resources */,
|
| - in_process_attribs,
|
| - gpu_preference));
|
| + scoped_ptr<gpu::GLInProcessContext> context(gpu::GLInProcessContext::Create(
|
| + NULL /* service */,
|
| + NULL /* surface */,
|
| + true /* is_offscreen */,
|
| + gfx::kNullAcceleratedWidget,
|
| + gfx::Size(1, 1),
|
| + NULL /* share_context */,
|
| + false /* share_resources */,
|
| + in_process_attribs,
|
| + gpu_preference,
|
| + gpu::GLInProcessContextSharedMemoryLimits()));
|
| return context.Pass();
|
| }
|
|
|
| scoped_ptr<gpu::GLInProcessContext> CreateContext(
|
| scoped_refptr<gpu::InProcessCommandBuffer::Service> service,
|
| - gpu::GLInProcessContext* share_context) {
|
| + gpu::GLInProcessContext* share_context,
|
| + const gpu::GLInProcessContextSharedMemoryLimits& mem_limits) {
|
| const gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu;
|
| gpu::gles2::ContextCreationAttribHelper in_process_attribs;
|
| WebGraphicsContext3DImpl::ConvertAttributes(
|
| GetDefaultAttribs(), &in_process_attribs);
|
| in_process_attribs.lose_context_when_out_of_memory = true;
|
|
|
| - scoped_ptr<gpu::GLInProcessContext> context(
|
| - gpu::GLInProcessContext::Create(service,
|
| - NULL /* surface */,
|
| - false /* is_offscreen */,
|
| - gfx::kNullAcceleratedWidget,
|
| - gfx::Size(1, 1),
|
| - share_context,
|
| - false /* share_resources */,
|
| - in_process_attribs,
|
| - gpu_preference));
|
| + scoped_ptr<gpu::GLInProcessContext> context(gpu::GLInProcessContext::Create(
|
| + service,
|
| + NULL /* surface */,
|
| + false /* is_offscreen */,
|
| + gfx::kNullAcceleratedWidget,
|
| + gfx::Size(1, 1),
|
| + share_context,
|
| + false /* share_resources */,
|
| + in_process_attribs,
|
| + gpu_preference,
|
| + mem_limits));
|
| return context.Pass();
|
| }
|
|
|
| @@ -184,10 +187,16 @@ scoped_refptr<cc::ContextProvider> SynchronousCompositorFactoryImpl::
|
| CreateOnscreenContextProviderForCompositorThread() {
|
| DCHECK(service_);
|
|
|
| - if (!share_context_.get())
|
| - share_context_ = CreateContext(service_, NULL);
|
| + if (!share_context_.get()) {
|
| + share_context_ = CreateContext(
|
| + service_, NULL, gpu::GLInProcessContextSharedMemoryLimits());
|
| + }
|
| + gpu::GLInProcessContextSharedMemoryLimits mem_limits;
|
| + // This is half of what RenderWidget uses because synchronous compositor
|
| + // pipeline is only one frame deep.
|
| + mem_limits.mapped_memory_reclaim_limit = 6 * 1024 * 1024;
|
| return webkit::gpu::ContextProviderInProcess::Create(
|
| - WrapContext(CreateContext(service_, share_context_.get())),
|
| + WrapContext(CreateContext(service_, share_context_.get(), mem_limits)),
|
| "Child-Compositor");
|
| }
|
|
|
| @@ -248,7 +257,9 @@ SynchronousCompositorFactoryImpl::TryCreateStreamTextureFactory() {
|
| DCHECK(share_context_.get());
|
|
|
| video_context_provider_ = new VideoContextProvider(
|
| - CreateContext(service_, share_context_.get()));
|
| + CreateContext(service_,
|
| + share_context_.get(),
|
| + gpu::GLInProcessContextSharedMemoryLimits()));
|
| }
|
| return video_context_provider_;
|
| }
|
|
|