| 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 #ifndef CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_ | 5 #ifndef CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_ |
| 6 #define CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_ | 6 #define CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 base::TimeTicks timebase, | 72 base::TimeTicks timebase, |
| 73 base::TimeDelta interval) override; | 73 base::TimeDelta interval) override; |
| 74 void SetOutputIsSecure(ui::Compositor* compositor, bool secure) override; | 74 void SetOutputIsSecure(ui::Compositor* compositor, bool secure) override; |
| 75 void AddObserver(ui::ContextFactoryObserver* observer) override; | 75 void AddObserver(ui::ContextFactoryObserver* observer) override; |
| 76 void RemoveObserver(ui::ContextFactoryObserver* observer) override; | 76 void RemoveObserver(ui::ContextFactoryObserver* observer) override; |
| 77 | 77 |
| 78 // ImageTransportFactory implementation. | 78 // ImageTransportFactory implementation. |
| 79 ui::ContextFactory* GetContextFactory() override; | 79 ui::ContextFactory* GetContextFactory() override; |
| 80 cc::SurfaceManager* GetSurfaceManager() override; | 80 cc::SurfaceManager* GetSurfaceManager() override; |
| 81 display_compositor::GLHelper* GetGLHelper() override; | 81 display_compositor::GLHelper* GetGLHelper() override; |
| 82 void SetGpuChannelEstablishFactory( |
| 83 gpu::GpuChannelEstablishFactory* factory) override; |
| 82 #if defined(OS_MACOSX) | 84 #if defined(OS_MACOSX) |
| 83 void SetCompositorSuspendedForRecycle(ui::Compositor* compositor, | 85 void SetCompositorSuspendedForRecycle(ui::Compositor* compositor, |
| 84 bool suspended) override; | 86 bool suspended) override; |
| 85 #endif | 87 #endif |
| 86 | 88 |
| 87 private: | 89 private: |
| 88 struct PerCompositorData; | 90 struct PerCompositorData; |
| 89 | 91 |
| 90 PerCompositorData* CreatePerCompositorData(ui::Compositor* compositor); | 92 PerCompositorData* CreatePerCompositorData(ui::Compositor* compositor); |
| 91 std::unique_ptr<cc::SoftwareOutputDevice> CreateSoftwareOutputDevice( | 93 std::unique_ptr<cc::SoftwareOutputDevice> CreateSoftwareOutputDevice( |
| 92 ui::Compositor* compositor); | 94 ui::Compositor* compositor); |
| 93 void EstablishedGpuChannel(base::WeakPtr<ui::Compositor> compositor, | 95 void EstablishedGpuChannel( |
| 94 bool create_gpu_output_surface, | 96 base::WeakPtr<ui::Compositor> compositor, |
| 95 int num_attempts); | 97 bool create_gpu_output_surface, |
| 98 int num_attempts, |
| 99 scoped_refptr<gpu::GpuChannelHost> established_channel_host); |
| 96 | 100 |
| 97 void OnLostMainThreadSharedContextInsideCallback(); | 101 void OnLostMainThreadSharedContextInsideCallback(); |
| 98 void OnLostMainThreadSharedContext(); | 102 void OnLostMainThreadSharedContext(); |
| 99 | 103 |
| 100 scoped_refptr<cc::VulkanInProcessContextProvider> | 104 scoped_refptr<cc::VulkanInProcessContextProvider> |
| 101 SharedVulkanContextProvider(); | 105 SharedVulkanContextProvider(); |
| 102 | 106 |
| 103 typedef std::map<ui::Compositor*, PerCompositorData*> PerCompositorDataMap; | 107 typedef std::map<ui::Compositor*, PerCompositorData*> PerCompositorDataMap; |
| 104 PerCompositorDataMap per_compositor_data_; | 108 PerCompositorDataMap per_compositor_data_; |
| 105 scoped_refptr<ContextProviderCommandBuffer> shared_main_thread_contexts_; | 109 scoped_refptr<ContextProviderCommandBuffer> shared_main_thread_contexts_; |
| 106 std::unique_ptr<display_compositor::GLHelper> gl_helper_; | 110 std::unique_ptr<display_compositor::GLHelper> gl_helper_; |
| 107 base::ObserverList<ui::ContextFactoryObserver> observer_list_; | 111 base::ObserverList<ui::ContextFactoryObserver> observer_list_; |
| 108 std::unique_ptr<cc::SurfaceManager> surface_manager_; | 112 std::unique_ptr<cc::SurfaceManager> surface_manager_; |
| 109 uint32_t next_surface_client_id_; | 113 uint32_t next_surface_client_id_; |
| 110 std::unique_ptr<cc::SingleThreadTaskGraphRunner> task_graph_runner_; | 114 std::unique_ptr<cc::SingleThreadTaskGraphRunner> task_graph_runner_; |
| 111 scoped_refptr<ContextProviderCommandBuffer> shared_worker_context_provider_; | 115 scoped_refptr<ContextProviderCommandBuffer> shared_worker_context_provider_; |
| 112 | 116 |
| 113 bool shared_vulkan_context_provider_initialized_ = false; | 117 bool shared_vulkan_context_provider_initialized_ = false; |
| 114 scoped_refptr<cc::VulkanInProcessContextProvider> | 118 scoped_refptr<cc::VulkanInProcessContextProvider> |
| 115 shared_vulkan_context_provider_; | 119 shared_vulkan_context_provider_; |
| 116 | 120 |
| 121 gpu::GpuChannelEstablishFactory* gpu_channel_factory_ = nullptr; |
| 122 |
| 117 #if defined(OS_WIN) | 123 #if defined(OS_WIN) |
| 118 std::unique_ptr<OutputDeviceBacking> software_backing_; | 124 std::unique_ptr<OutputDeviceBacking> software_backing_; |
| 119 #endif | 125 #endif |
| 120 base::WeakPtrFactory<GpuProcessTransportFactory> callback_factory_; | 126 base::WeakPtrFactory<GpuProcessTransportFactory> callback_factory_; |
| 121 | 127 |
| 122 DISALLOW_COPY_AND_ASSIGN(GpuProcessTransportFactory); | 128 DISALLOW_COPY_AND_ASSIGN(GpuProcessTransportFactory); |
| 123 }; | 129 }; |
| 124 | 130 |
| 125 } // namespace content | 131 } // namespace content |
| 126 | 132 |
| 127 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_ | 133 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_ |
| OLD | NEW |