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 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
772 if (gpu_channel_host->gpu_info().software_rendering) | 772 if (gpu_channel_host->gpu_info().software_rendering) |
773 use_software = true; | 773 use_software = true; |
774 } | 774 } |
775 | 775 |
776 #if defined(ENABLE_VULKAN) | 776 #if defined(ENABLE_VULKAN) |
777 scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider; | 777 scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider; |
778 #endif | 778 #endif |
779 scoped_refptr<ContextProviderCommandBuffer> context_provider; | 779 scoped_refptr<ContextProviderCommandBuffer> context_provider; |
780 scoped_refptr<ContextProviderCommandBuffer> worker_context_provider; | 780 scoped_refptr<ContextProviderCommandBuffer> worker_context_provider; |
781 if (!use_software) { | 781 if (!use_software) { |
782 #if defined(ENABLE_VULKAN) | 782 #if defined(ENABLE_VULKAN) |
piman
2016/04/19 23:42:02
I think you don't need this ifdef any more.
| |
783 vulkan_context_provider = cc::VulkanInProcessContextProvider::Create(); | 783 if (command_line.HasSwitch(switches::kEnableVulkan)) { |
784 if (vulkan_context_provider) { | 784 vulkan_context_provider = cc::VulkanInProcessContextProvider::Create(); |
785 uint32_t output_surface_id = next_output_surface_id_++; | 785 if (vulkan_context_provider) { |
786 return base::WrapUnique(new DelegatedCompositorOutputSurface( | 786 uint32_t output_surface_id = next_output_surface_id_++; |
787 routing_id(), output_surface_id, context_provider, | 787 return base::WrapUnique(new DelegatedCompositorOutputSurface( |
788 worker_context_provider, vulkan_context_provider, | 788 routing_id(), output_surface_id, context_provider, |
789 frame_swap_message_queue_)); | 789 worker_context_provider, vulkan_context_provider, |
790 frame_swap_message_queue_)); | |
791 } | |
790 } | 792 } |
791 #endif | 793 #endif |
792 | 794 |
793 context_provider = new ContextProviderCommandBuffer( | 795 context_provider = new ContextProviderCommandBuffer( |
794 CreateOffscreenContext(std::move(gpu_channel_host), | 796 CreateOffscreenContext(std::move(gpu_channel_host), |
795 GetURLForGraphicsContext3D()), | 797 GetURLForGraphicsContext3D()), |
796 RENDER_COMPOSITOR_CONTEXT); | 798 RENDER_COMPOSITOR_CONTEXT); |
797 worker_context_provider = | 799 worker_context_provider = |
798 RenderThreadImpl::current()->SharedWorkerContextProvider(); | 800 RenderThreadImpl::current()->SharedWorkerContextProvider(); |
799 if (!worker_context_provider) { | 801 if (!worker_context_provider) { |
(...skipping 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2126 } | 2128 } |
2127 | 2129 |
2128 float RenderWidget::GetOriginalDeviceScaleFactor() const { | 2130 float RenderWidget::GetOriginalDeviceScaleFactor() const { |
2129 return | 2131 return |
2130 screen_metrics_emulator_ ? | 2132 screen_metrics_emulator_ ? |
2131 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : | 2133 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : |
2132 device_scale_factor_; | 2134 device_scale_factor_; |
2133 } | 2135 } |
2134 | 2136 |
2135 } // namespace content | 2137 } // namespace content |
OLD | NEW |