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 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 attributes.alpha_size = -1; | 770 attributes.alpha_size = -1; |
771 attributes.depth_size = 0; | 771 attributes.depth_size = 0; |
772 attributes.stencil_size = 0; | 772 attributes.stencil_size = 0; |
773 attributes.samples = 0; | 773 attributes.samples = 0; |
774 attributes.sample_buffers = 0; | 774 attributes.sample_buffers = 0; |
775 attributes.bind_generates_resource = false; | 775 attributes.bind_generates_resource = false; |
776 attributes.lose_context_when_out_of_memory = true; | 776 attributes.lose_context_when_out_of_memory = true; |
777 | 777 |
778 constexpr bool automatic_flushes = false; | 778 constexpr bool automatic_flushes = false; |
779 | 779 |
780 // The compositor context shares resources with the worker context. | 780 // The compositor context shares resources with the worker context unless |
781 scoped_refptr<ContextProviderCommandBuffer> context_provider( | 781 // the worker is async. |
782 new ContextProviderCommandBuffer( | 782 ContextProviderCommandBuffer* share_context = worker_context_provider.get(); |
783 std::move(gpu_channel_host), gpu::kNullSurfaceHandle, | 783 if (compositor_deps_->IsAsyncWorkerContextEnabled()) |
784 GetURLForGraphicsContext3D(), gfx::PreferIntegratedGpu, | 784 share_context = nullptr; |
785 automatic_flushes, limits, attributes, worker_context_provider.get(), | 785 |
786 command_buffer_metrics::RENDER_COMPOSITOR_CONTEXT)); | 786 scoped_refptr<ContextProviderCommandBuffer> context_provider( |
| 787 new ContextProviderCommandBuffer( |
| 788 std::move(gpu_channel_host), gpu::GPU_STREAM_DEFAULT, |
| 789 gpu::GpuStreamPriority::NORMAL, gpu::kNullSurfaceHandle, |
| 790 GetURLForGraphicsContext3D(), gfx::PreferIntegratedGpu, |
| 791 automatic_flushes, limits, attributes, share_context, |
| 792 command_buffer_metrics::RENDER_COMPOSITOR_CONTEXT)); |
787 | 793 |
788 #if defined(OS_ANDROID) | 794 #if defined(OS_ANDROID) |
789 if (RenderThreadImpl::current()->sync_compositor_message_filter()) { | 795 if (RenderThreadImpl::current()->sync_compositor_message_filter()) { |
790 return base::WrapUnique(new SynchronousCompositorOutputSurface( | 796 return base::WrapUnique(new SynchronousCompositorOutputSurface( |
791 context_provider, worker_context_provider, routing_id(), | 797 context_provider, worker_context_provider, routing_id(), |
792 output_surface_id, | 798 output_surface_id, |
793 RenderThreadImpl::current()->sync_compositor_message_filter(), | 799 RenderThreadImpl::current()->sync_compositor_message_filter(), |
794 frame_swap_message_queue_)); | 800 frame_swap_message_queue_)); |
795 } | 801 } |
796 #endif | 802 #endif |
(...skipping 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2074 } | 2080 } |
2075 | 2081 |
2076 float RenderWidget::GetOriginalDeviceScaleFactor() const { | 2082 float RenderWidget::GetOriginalDeviceScaleFactor() const { |
2077 return | 2083 return |
2078 screen_metrics_emulator_ ? | 2084 screen_metrics_emulator_ ? |
2079 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : | 2085 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : |
2080 device_scale_factor_; | 2086 device_scale_factor_; |
2081 } | 2087 } |
2082 | 2088 |
2083 } // namespace content | 2089 } // namespace content |
OLD | NEW |