OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/browser/compositor/gpu_process_transport_factory.h" | 5 #include "content/browser/compositor/gpu_process_transport_factory.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 gfx::AcceleratedWidget widget = compositor->widget(); | 876 gfx::AcceleratedWidget widget = compositor->widget(); |
877 | 877 |
878 auto data = base::MakeUnique<PerCompositorData>(); | 878 auto data = base::MakeUnique<PerCompositorData>(); |
879 if (widget == gfx::kNullAcceleratedWidget) { | 879 if (widget == gfx::kNullAcceleratedWidget) { |
880 data->surface_handle = gpu::kNullSurfaceHandle; | 880 data->surface_handle = gpu::kNullSurfaceHandle; |
881 } else { | 881 } else { |
882 #if defined(GPU_SURFACE_HANDLE_IS_ACCELERATED_WINDOW) | 882 #if defined(GPU_SURFACE_HANDLE_IS_ACCELERATED_WINDOW) |
883 data->surface_handle = widget; | 883 data->surface_handle = widget; |
884 #else | 884 #else |
885 gpu::GpuSurfaceTracker* tracker = gpu::GpuSurfaceTracker::Get(); | 885 gpu::GpuSurfaceTracker* tracker = gpu::GpuSurfaceTracker::Get(); |
886 data->surface_handle = tracker->AddSurfaceForNativeWidget(widget); | 886 data->surface_handle = tracker->AddSurfaceForNativeWidget( |
| 887 gpu::GpuSurfaceTracker::SurfaceRecord(widget)); |
887 #endif | 888 #endif |
888 } | 889 } |
889 | 890 |
890 PerCompositorData* return_ptr = data.get(); | 891 PerCompositorData* return_ptr = data.get(); |
891 per_compositor_data_[compositor] = std::move(data); | 892 per_compositor_data_[compositor] = std::move(data); |
892 return return_ptr; | 893 return return_ptr; |
893 } | 894 } |
894 | 895 |
895 void GpuProcessTransportFactory::OnLostMainThreadSharedContextInsideCallback() { | 896 void GpuProcessTransportFactory::OnLostMainThreadSharedContextInsideCallback() { |
896 base::ThreadTaskRunnerHandle::Get()->PostTask( | 897 base::ThreadTaskRunnerHandle::Get()->PostTask( |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
929 shared_vulkan_context_provider_ = | 930 shared_vulkan_context_provider_ = |
930 cc::VulkanInProcessContextProvider::Create(); | 931 cc::VulkanInProcessContextProvider::Create(); |
931 } | 932 } |
932 | 933 |
933 shared_vulkan_context_provider_initialized_ = true; | 934 shared_vulkan_context_provider_initialized_ = true; |
934 } | 935 } |
935 return shared_vulkan_context_provider_; | 936 return shared_vulkan_context_provider_; |
936 } | 937 } |
937 | 938 |
938 } // namespace content | 939 } // namespace content |
OLD | NEW |