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 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 // The compositor context shares resources with the worker context unless | 777 // The compositor context shares resources with the worker context unless |
778 // the worker is async. | 778 // the worker is async. |
779 ContextProviderCommandBuffer* share_context = worker_context_provider.get(); | 779 ContextProviderCommandBuffer* share_context = worker_context_provider.get(); |
780 if (compositor_deps_->IsAsyncWorkerContextEnabled()) | 780 if (compositor_deps_->IsAsyncWorkerContextEnabled()) |
781 share_context = nullptr; | 781 share_context = nullptr; |
782 | 782 |
783 context_provider = new ContextProviderCommandBuffer( | 783 context_provider = new ContextProviderCommandBuffer( |
784 std::move(gpu_channel_host), gpu::GPU_STREAM_DEFAULT, | 784 std::move(gpu_channel_host), gpu::GPU_STREAM_DEFAULT, |
785 gpu::GpuStreamPriority::NORMAL, gpu::kNullSurfaceHandle, | 785 gpu::GpuStreamPriority::NORMAL, gpu::kNullSurfaceHandle, |
786 GetURLForGraphicsContext3D(), gfx::PreferIntegratedGpu, | 786 GetURLForGraphicsContext3D(), gfx::PreferIntegratedGpu, |
787 automatic_flushes, limits, attributes, worker_context_provider.get(), | 787 automatic_flushes, limits, attributes, share_context, |
788 command_buffer_metrics::RENDER_COMPOSITOR_CONTEXT); | 788 command_buffer_metrics::RENDER_COMPOSITOR_CONTEXT); |
789 | 789 |
790 #if defined(OS_ANDROID) | 790 #if defined(OS_ANDROID) |
791 if (RenderThreadImpl::current() && | 791 if (RenderThreadImpl::current() && |
792 RenderThreadImpl::current()->sync_compositor_message_filter()) { | 792 RenderThreadImpl::current()->sync_compositor_message_filter()) { |
793 uint32_t output_surface_id = next_output_surface_id_++; | 793 uint32_t output_surface_id = next_output_surface_id_++; |
794 return base::WrapUnique(new SynchronousCompositorOutputSurface( | 794 return base::WrapUnique(new SynchronousCompositorOutputSurface( |
795 context_provider, worker_context_provider, routing_id(), | 795 context_provider, worker_context_provider, routing_id(), |
796 output_surface_id, | 796 output_surface_id, |
797 RenderThreadImpl::current()->sync_compositor_message_filter(), | 797 RenderThreadImpl::current()->sync_compositor_message_filter(), |
(...skipping 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2093 } | 2093 } |
2094 | 2094 |
2095 float RenderWidget::GetOriginalDeviceScaleFactor() const { | 2095 float RenderWidget::GetOriginalDeviceScaleFactor() const { |
2096 return | 2096 return |
2097 screen_metrics_emulator_ ? | 2097 screen_metrics_emulator_ ? |
2098 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : | 2098 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : |
2099 device_scale_factor_; | 2099 device_scale_factor_; |
2100 } | 2100 } |
2101 | 2101 |
2102 } // namespace content | 2102 } // namespace content |
OLD | NEW |