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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 cc::SharedBitmapManager* GetSharedBitmapManager() override; | 61 cc::SharedBitmapManager* GetSharedBitmapManager() override; |
62 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; | 62 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; |
63 cc::TaskGraphRunner* GetTaskGraphRunner() override; | 63 cc::TaskGraphRunner* GetTaskGraphRunner() override; |
64 std::unique_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() override; | 64 std::unique_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() override; |
65 void ResizeDisplay(ui::Compositor* compositor, | 65 void ResizeDisplay(ui::Compositor* compositor, |
66 const gfx::Size& size) override; | 66 const gfx::Size& size) override; |
67 | 67 |
68 // ImageTransportFactory implementation. | 68 // ImageTransportFactory implementation. |
69 ui::ContextFactory* GetContextFactory() override; | 69 ui::ContextFactory* GetContextFactory() override; |
70 cc::SurfaceManager* GetSurfaceManager() override; | 70 cc::SurfaceManager* GetSurfaceManager() override; |
71 display_compositor::GLHelper* GetGLHelper() override; | 71 GLHelper* GetGLHelper() override; |
72 void AddObserver(ImageTransportFactoryObserver* observer) override; | 72 void AddObserver(ImageTransportFactoryObserver* observer) override; |
73 void RemoveObserver(ImageTransportFactoryObserver* observer) override; | 73 void RemoveObserver(ImageTransportFactoryObserver* observer) override; |
74 #if defined(OS_MACOSX) | 74 #if defined(OS_MACOSX) |
75 void OnGpuSwapBuffersCompleted( | 75 void OnGpuSwapBuffersCompleted( |
76 int surface_id, | 76 int surface_id, |
77 const std::vector<ui::LatencyInfo>& latency_info, | 77 const std::vector<ui::LatencyInfo>& latency_info, |
78 gfx::SwapResult result) override; | 78 gfx::SwapResult result) override; |
79 void SetCompositorSuspendedForRecycle(ui::Compositor* compositor, | 79 void SetCompositorSuspendedForRecycle(ui::Compositor* compositor, |
80 bool suspended) override; | 80 bool suspended) override; |
81 bool SurfaceShouldNotShowFramesAfterSuspendForRecycle( | 81 bool SurfaceShouldNotShowFramesAfterSuspendForRecycle( |
82 int surface_id) const override; | 82 int surface_id) const override; |
83 #endif | 83 #endif |
84 | 84 |
85 private: | 85 private: |
86 struct PerCompositorData; | 86 struct PerCompositorData; |
87 | 87 |
88 PerCompositorData* CreatePerCompositorData(ui::Compositor* compositor); | 88 PerCompositorData* CreatePerCompositorData(ui::Compositor* compositor); |
89 std::unique_ptr<cc::SoftwareOutputDevice> CreateSoftwareOutputDevice( | 89 std::unique_ptr<cc::SoftwareOutputDevice> CreateSoftwareOutputDevice( |
90 ui::Compositor* compositor); | 90 ui::Compositor* compositor); |
91 void EstablishedGpuChannel(base::WeakPtr<ui::Compositor> compositor, | 91 void EstablishedGpuChannel(base::WeakPtr<ui::Compositor> compositor, |
92 bool create_gpu_output_surface, | 92 bool create_gpu_output_surface, |
93 int num_attempts); | 93 int num_attempts); |
94 | 94 |
95 void OnLostMainThreadSharedContextInsideCallback(); | 95 void OnLostMainThreadSharedContextInsideCallback(); |
96 void OnLostMainThreadSharedContext(); | 96 void OnLostMainThreadSharedContext(); |
97 | 97 |
98 typedef std::map<ui::Compositor*, PerCompositorData*> PerCompositorDataMap; | 98 typedef std::map<ui::Compositor*, PerCompositorData*> PerCompositorDataMap; |
99 PerCompositorDataMap per_compositor_data_; | 99 PerCompositorDataMap per_compositor_data_; |
100 scoped_refptr<ContextProviderCommandBuffer> shared_main_thread_contexts_; | 100 scoped_refptr<ContextProviderCommandBuffer> shared_main_thread_contexts_; |
101 std::unique_ptr<display_compositor::GLHelper> gl_helper_; | 101 std::unique_ptr<GLHelper> gl_helper_; |
102 base::ObserverList<ImageTransportFactoryObserver> observer_list_; | 102 base::ObserverList<ImageTransportFactoryObserver> observer_list_; |
103 std::unique_ptr<cc::SurfaceManager> surface_manager_; | 103 std::unique_ptr<cc::SurfaceManager> surface_manager_; |
104 uint32_t next_surface_id_namespace_; | 104 uint32_t next_surface_id_namespace_; |
105 std::unique_ptr<cc::SingleThreadTaskGraphRunner> task_graph_runner_; | 105 std::unique_ptr<cc::SingleThreadTaskGraphRunner> task_graph_runner_; |
106 scoped_refptr<ContextProviderCommandBuffer> shared_worker_context_provider_; | 106 scoped_refptr<ContextProviderCommandBuffer> shared_worker_context_provider_; |
107 | 107 |
108 #if defined(OS_WIN) | 108 #if defined(OS_WIN) |
109 std::unique_ptr<OutputDeviceBacking> software_backing_; | 109 std::unique_ptr<OutputDeviceBacking> software_backing_; |
110 #endif | 110 #endif |
111 | 111 |
112 // The contents of this map and its methods may only be used on the compositor | 112 // The contents of this map and its methods may only be used on the compositor |
113 // thread. | 113 // thread. |
114 IDMap<BrowserCompositorOutputSurface> output_surface_map_; | 114 IDMap<BrowserCompositorOutputSurface> output_surface_map_; |
115 | 115 |
116 base::WeakPtrFactory<GpuProcessTransportFactory> callback_factory_; | 116 base::WeakPtrFactory<GpuProcessTransportFactory> callback_factory_; |
117 | 117 |
118 DISALLOW_COPY_AND_ASSIGN(GpuProcessTransportFactory); | 118 DISALLOW_COPY_AND_ASSIGN(GpuProcessTransportFactory); |
119 }; | 119 }; |
120 | 120 |
121 } // namespace content | 121 } // namespace content |
122 | 122 |
123 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_ | 123 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_ |
OLD | NEW |