| Index: content/browser/renderer_host/compositor_impl_android.cc
|
| diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc
|
| index d4e330bdb667fc66b261f75816f623a87dadad97..9231509b32071d66345aadef6fff39350706f48e 100644
|
| --- a/content/browser/renderer_host/compositor_impl_android.cc
|
| +++ b/content/browser/renderer_host/compositor_impl_android.cc
|
| @@ -148,7 +148,7 @@ class OutputSurfaceWithoutParent : public cc::OutputSurface,
|
| swap_buffers_completion_callback_.callback());
|
|
|
| populate_gpu_capabilities_callback_.Run(
|
| - context_provider_->ContextCapabilities().gpu);
|
| + context_provider_->ContextCapabilities());
|
| compositor_->AddObserver(this);
|
|
|
| client->SetBeginFrameSource(begin_frame_source_.get());
|
| @@ -419,35 +419,6 @@ void CompositorImpl::SetNeedsComposite() {
|
| host_->SetNeedsAnimate();
|
| }
|
|
|
| -static std::unique_ptr<WebGraphicsContext3DCommandBufferImpl>
|
| -CreateGpuProcessViewContext(
|
| - const scoped_refptr<gpu::GpuChannelHost>& gpu_channel_host,
|
| - const gpu::gles2::ContextCreationAttribHelper& attributes,
|
| - int surface_id) {
|
| - GURL url("chrome://gpu/Compositor::createContext3D");
|
| - static const size_t kBytesPerPixel = 4;
|
| - gfx::DeviceDisplayInfo display_info;
|
| - size_t full_screen_texture_size_in_bytes =
|
| - display_info.GetDisplayHeight() *
|
| - display_info.GetDisplayWidth() *
|
| - kBytesPerPixel;
|
| - WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits;
|
| - limits.command_buffer_size = 64 * 1024;
|
| - limits.start_transfer_buffer_size = 64 * 1024;
|
| - limits.min_transfer_buffer_size = 64 * 1024;
|
| - limits.max_transfer_buffer_size = std::min(
|
| - 3 * full_screen_texture_size_in_bytes, kDefaultMaxTransferBufferSize);
|
| - limits.mapped_memory_reclaim_limit = 2 * 1024 * 1024;
|
| - GpuSurfaceTracker* tracker = GpuSurfaceTracker::Get();
|
| - gpu::SurfaceHandle surface_handle = tracker->GetSurfaceHandle(surface_id);
|
| - bool share_resources = true;
|
| - bool automatic_flushes = false;
|
| - return base::WrapUnique(new WebGraphicsContext3DCommandBufferImpl(
|
| - surface_handle, url, gpu_channel_host.get(), attributes,
|
| - gfx::PreferIntegratedGpu, share_resources, automatic_flushes, limits,
|
| - nullptr));
|
| -}
|
| -
|
| void CompositorImpl::UpdateLayerTreeHost() {
|
| client_->UpdateLayerTreeHost();
|
| if (needs_animate_) {
|
| @@ -550,11 +521,38 @@ void CompositorImpl::CreateOutputSurface() {
|
| // But from here on just try and always lead to either
|
| // DidInitializeOutputSurface() or DidFailToInitializeOutputSurface().
|
| scoped_refptr<gpu::GpuChannelHost> gpu_channel_host(factory->GetGpuChannel());
|
| +
|
| + GURL url("chrome://gpu/CompositorImpl::CreateOutputSurface");
|
| + gpu::SurfaceHandle surface_handle =
|
| + GpuSurfaceTracker::Get()->GetSurfaceHandle(surface_id_);
|
| + constexpr bool share_resources = true;
|
| + constexpr bool automatic_flushes = false;
|
| +
|
| + // TODO(danakj): Why are these limits lower here? This context is used by the
|
| + // browser compositor (so limits like RenderWidget make sense), but also by
|
| + // the display compositor and GpuProcessTransportFactory doesn't set limits
|
| + // on the display compositor context, and we do issue a fair number of draw
|
| + // commands?
|
| + gpu::SharedMemoryLimits limits;
|
| + limits.command_buffer_size = 64 * 1024;
|
| + limits.start_transfer_buffer_size = 64 * 1024;
|
| + limits.min_transfer_buffer_size = 64 * 1024;
|
| + constexpr size_t kBytesPerPixel = 4;
|
| + const size_t full_screen_texture_size_in_bytes =
|
| + gfx::DeviceDisplayInfo().GetDisplayHeight() *
|
| + gfx::DeviceDisplayInfo().GetDisplayWidth() * kBytesPerPixel;
|
| + limits.max_transfer_buffer_size = std::min(
|
| + 3 * full_screen_texture_size_in_bytes, kDefaultMaxTransferBufferSize);
|
| + // TODO(danakj): Why this limit on the compositor context?
|
| + limits.mapped_memory_reclaim_limit = 2 * 1024 * 1024;
|
| +
|
| scoped_refptr<ContextProviderCommandBuffer> context_provider(
|
| new ContextProviderCommandBuffer(
|
| - CreateGpuProcessViewContext(gpu_channel_host, attributes,
|
| - surface_id_),
|
| - DISPLAY_COMPOSITOR_ONSCREEN_CONTEXT));
|
| + base::WrapUnique(new WebGraphicsContext3DCommandBufferImpl(
|
| + surface_handle, url, gpu_channel_host.get(), attributes,
|
| + gfx::PreferIntegratedGpu, share_resources, automatic_flushes,
|
| + nullptr)),
|
| + limits, DISPLAY_COMPOSITOR_ONSCREEN_CONTEXT));
|
| DCHECK(context_provider.get());
|
|
|
| std::unique_ptr<cc::OutputSurface> real_output_surface(
|
|
|