Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2134)

Side by Side Diff: content/browser/compositor/gpu_process_transport_factory.h

Issue 2684933003: Move frame_sink_id management to framesink_manager.cc/h from (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "content/browser/compositor/image_transport_factory.h" 19 #include "content/browser/compositor/image_transport_factory.h"
20 #include "gpu/ipc/client/gpu_channel_host.h" 20 #include "gpu/ipc/client/gpu_channel_host.h"
21 #include "ui/compositor/compositor.h" 21 #include "ui/compositor/compositor.h"
22 22
23 namespace cc { 23 namespace cc {
24 class SingleThreadTaskGraphRunner; 24 class SingleThreadTaskGraphRunner;
25 class SoftwareOutputDevice; 25 class SoftwareOutputDevice;
26 class SurfaceManager; 26 class SurfaceManager;
27 class FrameSinkManager;
27 class VulkanInProcessContextProvider; 28 class VulkanInProcessContextProvider;
28 } 29 }
29 30
30 namespace ui { 31 namespace ui {
31 class ContextProviderCommandBuffer; 32 class ContextProviderCommandBuffer;
32 } 33 }
33 34
34 namespace content { 35 namespace content {
35 class OutputDeviceBacking; 36 class OutputDeviceBacking;
36 37
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 base::TimeDelta interval) override; 70 base::TimeDelta interval) override;
70 void SetDisplayVSyncParameters(ui::Compositor* compositor, 71 void SetDisplayVSyncParameters(ui::Compositor* compositor,
71 base::TimeTicks timebase, 72 base::TimeTicks timebase,
72 base::TimeDelta interval) override; 73 base::TimeDelta interval) override;
73 void SetOutputIsSecure(ui::Compositor* compositor, bool secure) override; 74 void SetOutputIsSecure(ui::Compositor* compositor, bool secure) override;
74 75
75 // ImageTransportFactory implementation. 76 // ImageTransportFactory implementation.
76 ui::ContextFactory* GetContextFactory() override; 77 ui::ContextFactory* GetContextFactory() override;
77 ui::ContextFactoryPrivate* GetContextFactoryPrivate() override; 78 ui::ContextFactoryPrivate* GetContextFactoryPrivate() override;
78 cc::SurfaceManager* GetSurfaceManager() override; 79 cc::SurfaceManager* GetSurfaceManager() override;
80 cc::FrameSinkManager* GetFrameSinkManager() override;
79 display_compositor::GLHelper* GetGLHelper() override; 81 display_compositor::GLHelper* GetGLHelper() override;
80 void SetGpuChannelEstablishFactory( 82 void SetGpuChannelEstablishFactory(
81 gpu::GpuChannelEstablishFactory* factory) override; 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( 95 void EstablishedGpuChannel(
94 base::WeakPtr<ui::Compositor> compositor, 96 base::WeakPtr<ui::Compositor> compositor,
95 bool create_gpu_output_surface, 97 bool create_gpu_output_surface,
96 int num_attempts, 98 int num_attempts,
97 scoped_refptr<gpu::GpuChannelHost> established_channel_host); 99 scoped_refptr<gpu::GpuChannelHost> established_channel_host);
98 100
99 void OnLostMainThreadSharedContextInsideCallback(); 101 void OnLostMainThreadSharedContextInsideCallback();
100 void OnLostMainThreadSharedContext(); 102 void OnLostMainThreadSharedContext();
101 103
102 scoped_refptr<cc::VulkanInProcessContextProvider> 104 scoped_refptr<cc::VulkanInProcessContextProvider>
103 SharedVulkanContextProvider(); 105 SharedVulkanContextProvider();
104 106
105 std::unique_ptr<cc::SurfaceManager> surface_manager_; 107 std::unique_ptr<cc::SurfaceManager> surface_manager_;
108 std::unique_ptr<cc::FrameSinkManager> framesink_manager_;
106 uint32_t next_sink_id_ = 1u; 109 uint32_t next_sink_id_ = 1u;
107 110
108 #if defined(OS_WIN) 111 #if defined(OS_WIN)
109 // Used by output surface, stored in PerCompositorData. 112 // Used by output surface, stored in PerCompositorData.
110 std::unique_ptr<OutputDeviceBacking> software_backing_; 113 std::unique_ptr<OutputDeviceBacking> software_backing_;
111 #endif 114 #endif
112 115
113 // Depends on SurfaceManager. 116 // Depends on SurfaceManager.
114 typedef std::map<ui::Compositor*, std::unique_ptr<PerCompositorData>> 117 typedef std::map<ui::Compositor*, std::unique_ptr<PerCompositorData>>
115 PerCompositorDataMap; 118 PerCompositorDataMap;
(...skipping 13 matching lines...) Expand all
129 gpu::GpuChannelEstablishFactory* gpu_channel_factory_ = nullptr; 132 gpu::GpuChannelEstablishFactory* gpu_channel_factory_ = nullptr;
130 133
131 base::WeakPtrFactory<GpuProcessTransportFactory> callback_factory_; 134 base::WeakPtrFactory<GpuProcessTransportFactory> callback_factory_;
132 135
133 DISALLOW_COPY_AND_ASSIGN(GpuProcessTransportFactory); 136 DISALLOW_COPY_AND_ASSIGN(GpuProcessTransportFactory);
134 }; 137 };
135 138
136 } // namespace content 139 } // namespace content
137 140
138 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_ 141 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698