| 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> |
| 11 #include <memory> | 11 #include <memory> |
| 12 | 12 |
| 13 #include "base/id_map.h" | 13 #include "base/id_map.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "base/observer_list.h" | 17 #include "base/observer_list.h" |
| 18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
| 19 #include "cc/output/renderer_settings.h" |
| 19 #include "cc/surfaces/frame_sink_id_allocator.h" | 20 #include "cc/surfaces/frame_sink_id_allocator.h" |
| 20 #include "content/browser/compositor/image_transport_factory.h" | 21 #include "content/browser/compositor/image_transport_factory.h" |
| 21 #include "gpu/ipc/client/gpu_channel_host.h" | 22 #include "gpu/ipc/client/gpu_channel_host.h" |
| 22 #include "ui/compositor/compositor.h" | 23 #include "ui/compositor/compositor.h" |
| 23 | 24 |
| 24 namespace cc { | 25 namespace cc { |
| 25 class SingleThreadTaskGraphRunner; | 26 class SingleThreadTaskGraphRunner; |
| 26 class SoftwareOutputDevice; | 27 class SoftwareOutputDevice; |
| 27 class SurfaceManager; | 28 class SurfaceManager; |
| 28 class VulkanInProcessContextProvider; | 29 class VulkanInProcessContextProvider; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 41 public ImageTransportFactory { | 42 public ImageTransportFactory { |
| 42 public: | 43 public: |
| 43 GpuProcessTransportFactory(); | 44 GpuProcessTransportFactory(); |
| 44 | 45 |
| 45 ~GpuProcessTransportFactory() override; | 46 ~GpuProcessTransportFactory() override; |
| 46 | 47 |
| 47 // ui::ContextFactory implementation. | 48 // ui::ContextFactory implementation. |
| 48 void CreateCompositorFrameSink( | 49 void CreateCompositorFrameSink( |
| 49 base::WeakPtr<ui::Compositor> compositor) override; | 50 base::WeakPtr<ui::Compositor> compositor) override; |
| 50 scoped_refptr<cc::ContextProvider> SharedMainThreadContextProvider() override; | 51 scoped_refptr<cc::ContextProvider> SharedMainThreadContextProvider() override; |
| 51 uint32_t GetImageTextureTarget(gfx::BufferFormat format, | |
| 52 gfx::BufferUsage usage) override; | |
| 53 double GetRefreshRate() const override; | 52 double GetRefreshRate() const override; |
| 54 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; | 53 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; |
| 55 cc::TaskGraphRunner* GetTaskGraphRunner() override; | 54 cc::TaskGraphRunner* GetTaskGraphRunner() override; |
| 55 const cc::RendererSettings& GetRendererSettings() const override; |
| 56 void AddObserver(ui::ContextFactoryObserver* observer) override; | 56 void AddObserver(ui::ContextFactoryObserver* observer) override; |
| 57 void RemoveObserver(ui::ContextFactoryObserver* observer) override; | 57 void RemoveObserver(ui::ContextFactoryObserver* observer) override; |
| 58 | 58 |
| 59 // ui::ContextFactoryPrivate implementation. | 59 // ui::ContextFactoryPrivate implementation. |
| 60 std::unique_ptr<ui::Reflector> CreateReflector(ui::Compositor* source, | 60 std::unique_ptr<ui::Reflector> CreateReflector(ui::Compositor* source, |
| 61 ui::Layer* target) override; | 61 ui::Layer* target) override; |
| 62 void RemoveReflector(ui::Reflector* reflector) override; | 62 void RemoveReflector(ui::Reflector* reflector) override; |
| 63 void RemoveCompositor(ui::Compositor* compositor) override; | 63 void RemoveCompositor(ui::Compositor* compositor) override; |
| 64 cc::FrameSinkId AllocateFrameSinkId() override; | 64 cc::FrameSinkId AllocateFrameSinkId() override; |
| 65 void SetDisplayVisible(ui::Compositor* compositor, bool visible) override; | 65 void SetDisplayVisible(ui::Compositor* compositor, bool visible) override; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 #if defined(OS_WIN) | 114 #if defined(OS_WIN) |
| 115 // Used by output surface, stored in PerCompositorData. | 115 // Used by output surface, stored in PerCompositorData. |
| 116 std::unique_ptr<OutputDeviceBacking> software_backing_; | 116 std::unique_ptr<OutputDeviceBacking> software_backing_; |
| 117 #endif | 117 #endif |
| 118 | 118 |
| 119 // Depends on SurfaceManager. | 119 // Depends on SurfaceManager. |
| 120 typedef std::map<ui::Compositor*, std::unique_ptr<PerCompositorData>> | 120 typedef std::map<ui::Compositor*, std::unique_ptr<PerCompositorData>> |
| 121 PerCompositorDataMap; | 121 PerCompositorDataMap; |
| 122 PerCompositorDataMap per_compositor_data_; | 122 PerCompositorDataMap per_compositor_data_; |
| 123 | 123 |
| 124 const cc::RendererSettings renderer_settings_; |
| 124 scoped_refptr<ui::ContextProviderCommandBuffer> shared_main_thread_contexts_; | 125 scoped_refptr<ui::ContextProviderCommandBuffer> shared_main_thread_contexts_; |
| 125 std::unique_ptr<display_compositor::GLHelper> gl_helper_; | 126 std::unique_ptr<display_compositor::GLHelper> gl_helper_; |
| 126 base::ObserverList<ui::ContextFactoryObserver> observer_list_; | 127 base::ObserverList<ui::ContextFactoryObserver> observer_list_; |
| 127 std::unique_ptr<cc::SingleThreadTaskGraphRunner> task_graph_runner_; | 128 std::unique_ptr<cc::SingleThreadTaskGraphRunner> task_graph_runner_; |
| 128 scoped_refptr<ui::ContextProviderCommandBuffer> | 129 scoped_refptr<ui::ContextProviderCommandBuffer> |
| 129 shared_worker_context_provider_; | 130 shared_worker_context_provider_; |
| 130 | 131 |
| 131 bool disable_display_vsync_ = false; | 132 bool disable_display_vsync_ = false; |
| 132 bool shared_vulkan_context_provider_initialized_ = false; | 133 bool shared_vulkan_context_provider_initialized_ = false; |
| 133 scoped_refptr<cc::VulkanInProcessContextProvider> | 134 scoped_refptr<cc::VulkanInProcessContextProvider> |
| 134 shared_vulkan_context_provider_; | 135 shared_vulkan_context_provider_; |
| 135 | 136 |
| 136 gpu::GpuChannelEstablishFactory* gpu_channel_factory_ = nullptr; | 137 gpu::GpuChannelEstablishFactory* gpu_channel_factory_ = nullptr; |
| 137 | 138 |
| 138 base::WeakPtrFactory<GpuProcessTransportFactory> callback_factory_; | 139 base::WeakPtrFactory<GpuProcessTransportFactory> callback_factory_; |
| 139 | 140 |
| 140 DISALLOW_COPY_AND_ASSIGN(GpuProcessTransportFactory); | 141 DISALLOW_COPY_AND_ASSIGN(GpuProcessTransportFactory); |
| 141 }; | 142 }; |
| 142 | 143 |
| 143 } // namespace content | 144 } // namespace content |
| 144 | 145 |
| 145 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_ | 146 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_ |
| OLD | NEW |