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 15 matching lines...) Expand all Loading... |
26 #include "cc/base/switches.h" | 26 #include "cc/base/switches.h" |
27 #include "cc/debug/benchmark_instrumentation.h" | 27 #include "cc/debug/benchmark_instrumentation.h" |
28 #include "cc/output/output_surface.h" | 28 #include "cc/output/output_surface.h" |
29 #include "cc/output/vulkan_in_process_context_provider.h" | 29 #include "cc/output/vulkan_in_process_context_provider.h" |
30 #include "cc/scheduler/begin_frame_source.h" | 30 #include "cc/scheduler/begin_frame_source.h" |
31 #include "cc/trees/layer_tree_host.h" | 31 #include "cc/trees/layer_tree_host.h" |
32 #include "components/scheduler/renderer/render_widget_scheduling_state.h" | 32 #include "components/scheduler/renderer/render_widget_scheduling_state.h" |
33 #include "components/scheduler/renderer/renderer_scheduler.h" | 33 #include "components/scheduler/renderer/renderer_scheduler.h" |
34 #include "content/common/content_switches_internal.h" | 34 #include "content/common/content_switches_internal.h" |
35 #include "content/common/gpu/client/context_provider_command_buffer.h" | 35 #include "content/common/gpu/client/context_provider_command_buffer.h" |
36 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | |
37 #include "content/common/gpu_process_launch_causes.h" | 36 #include "content/common/gpu_process_launch_causes.h" |
38 #include "content/common/input/synthetic_gesture_packet.h" | 37 #include "content/common/input/synthetic_gesture_packet.h" |
39 #include "content/common/input/web_input_event_traits.h" | 38 #include "content/common/input/web_input_event_traits.h" |
40 #include "content/common/input_messages.h" | 39 #include "content/common/input_messages.h" |
41 #include "content/common/swapped_out_messages.h" | 40 #include "content/common/swapped_out_messages.h" |
42 #include "content/common/text_input_state.h" | 41 #include "content/common/text_input_state.h" |
43 #include "content/common/view_messages.h" | 42 #include "content/common/view_messages.h" |
44 #include "content/public/common/content_features.h" | 43 #include "content/public/common/content_features.h" |
45 #include "content/public/common/content_switches.h" | 44 #include "content/public/common/content_switches.h" |
46 #include "content/public/common/context_menu_params.h" | 45 #include "content/public/common/context_menu_params.h" |
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 attributes.stencil_size = 0; | 769 attributes.stencil_size = 0; |
771 attributes.samples = 0; | 770 attributes.samples = 0; |
772 attributes.sample_buffers = 0; | 771 attributes.sample_buffers = 0; |
773 attributes.bind_generates_resource = false; | 772 attributes.bind_generates_resource = false; |
774 attributes.lose_context_when_out_of_memory = true; | 773 attributes.lose_context_when_out_of_memory = true; |
775 | 774 |
776 bool automatic_flushes = false; | 775 bool automatic_flushes = false; |
777 | 776 |
778 // The compositor context shares resources with the worker context. | 777 // The compositor context shares resources with the worker context. |
779 context_provider = new ContextProviderCommandBuffer( | 778 context_provider = new ContextProviderCommandBuffer( |
780 base::WrapUnique(new content::WebGraphicsContext3DCommandBufferImpl( | 779 std::move(gpu_channel_host), gpu::kNullSurfaceHandle, |
781 gpu::kNullSurfaceHandle, GetURLForGraphicsContext3D(), | 780 GetURLForGraphicsContext3D(), gfx::PreferIntegratedGpu, |
782 std::move(gpu_channel_host), gfx::PreferIntegratedGpu, | 781 automatic_flushes, limits, attributes, worker_context_provider.get(), |
783 automatic_flushes)), | |
784 limits, attributes, worker_context_provider.get(), | |
785 command_buffer_metrics::RENDER_COMPOSITOR_CONTEXT); | 782 command_buffer_metrics::RENDER_COMPOSITOR_CONTEXT); |
786 | 783 |
787 #if defined(OS_ANDROID) | 784 #if defined(OS_ANDROID) |
788 if (RenderThreadImpl::current() && | 785 if (RenderThreadImpl::current() && |
789 RenderThreadImpl::current()->sync_compositor_message_filter()) { | 786 RenderThreadImpl::current()->sync_compositor_message_filter()) { |
790 uint32_t output_surface_id = next_output_surface_id_++; | 787 uint32_t output_surface_id = next_output_surface_id_++; |
791 return base::WrapUnique(new SynchronousCompositorOutputSurface( | 788 return base::WrapUnique(new SynchronousCompositorOutputSurface( |
792 context_provider, worker_context_provider, routing_id(), | 789 context_provider, worker_context_provider, routing_id(), |
793 output_surface_id, | 790 output_surface_id, |
794 RenderThreadImpl::current()->sync_compositor_message_filter(), | 791 RenderThreadImpl::current()->sync_compositor_message_filter(), |
(...skipping 1301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2096 } | 2093 } |
2097 | 2094 |
2098 float RenderWidget::GetOriginalDeviceScaleFactor() const { | 2095 float RenderWidget::GetOriginalDeviceScaleFactor() const { |
2099 return | 2096 return |
2100 screen_metrics_emulator_ ? | 2097 screen_metrics_emulator_ ? |
2101 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : | 2098 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : |
2102 device_scale_factor_; | 2099 device_scale_factor_; |
2103 } | 2100 } |
2104 | 2101 |
2105 } // namespace content | 2102 } // namespace content |
OLD | NEW |