OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
768 attributes.alpha_size = -1; | 768 attributes.alpha_size = -1; |
769 attributes.depth_size = 0; | 769 attributes.depth_size = 0; |
770 attributes.stencil_size = 0; | 770 attributes.stencil_size = 0; |
771 attributes.samples = 0; | 771 attributes.samples = 0; |
772 attributes.sample_buffers = 0; | 772 attributes.sample_buffers = 0; |
773 attributes.bind_generates_resource = false; | 773 attributes.bind_generates_resource = false; |
774 attributes.lose_context_when_out_of_memory = true; | 774 attributes.lose_context_when_out_of_memory = true; |
775 | 775 |
776 bool automatic_flushes = false; | 776 bool automatic_flushes = false; |
777 | 777 |
778 // The compositor context shares resources with the worker context. | 778 // The compositor context shares resources with the worker context unless |
| 779 // the worker is async. |
| 780 ContextProviderCommandBuffer* share_context = worker_context_provider.get(); |
| 781 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 782 switches::kEnableGpuAsyncWorkerContext)) { |
| 783 share_context = nullptr; |
| 784 } |
779 context_provider = new ContextProviderCommandBuffer( | 785 context_provider = new ContextProviderCommandBuffer( |
780 base::WrapUnique(new content::WebGraphicsContext3DCommandBufferImpl( | 786 base::WrapUnique(new content::WebGraphicsContext3DCommandBufferImpl( |
781 gpu::kNullSurfaceHandle, GetURLForGraphicsContext3D(), | 787 gpu::kNullSurfaceHandle, GetURLForGraphicsContext3D(), |
782 std::move(gpu_channel_host), gfx::PreferIntegratedGpu, | 788 std::move(gpu_channel_host), gfx::PreferIntegratedGpu, |
783 automatic_flushes)), | 789 automatic_flushes, gpu::GPU_STREAM_DEFAULT, |
| 790 gpu::GpuStreamPriority::NORMAL)), |
784 limits, attributes, worker_context_provider.get(), | 791 limits, attributes, worker_context_provider.get(), |
785 command_buffer_metrics::RENDER_COMPOSITOR_CONTEXT); | 792 command_buffer_metrics::RENDER_COMPOSITOR_CONTEXT); |
786 | 793 |
787 #if defined(OS_ANDROID) | 794 #if defined(OS_ANDROID) |
788 if (RenderThreadImpl::current() && | 795 if (RenderThreadImpl::current() && |
789 RenderThreadImpl::current()->sync_compositor_message_filter()) { | 796 RenderThreadImpl::current()->sync_compositor_message_filter()) { |
790 uint32_t output_surface_id = next_output_surface_id_++; | 797 uint32_t output_surface_id = next_output_surface_id_++; |
791 return base::WrapUnique(new SynchronousCompositorOutputSurface( | 798 return base::WrapUnique(new SynchronousCompositorOutputSurface( |
792 context_provider, worker_context_provider, routing_id(), | 799 context_provider, worker_context_provider, routing_id(), |
793 output_surface_id, | 800 output_surface_id, |
(...skipping 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2096 } | 2103 } |
2097 | 2104 |
2098 float RenderWidget::GetOriginalDeviceScaleFactor() const { | 2105 float RenderWidget::GetOriginalDeviceScaleFactor() const { |
2099 return | 2106 return |
2100 screen_metrics_emulator_ ? | 2107 screen_metrics_emulator_ ? |
2101 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : | 2108 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : |
2102 device_scale_factor_; | 2109 device_scale_factor_; |
2103 } | 2110 } |
2104 | 2111 |
2105 } // namespace content | 2112 } // namespace content |
OLD | NEW |