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 <map> | 8 #include <map> |
9 | 9 |
10 #include "base/id_map.h" | 10 #include "base/id_map.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 void OnSurfaceDisplayed(int surface_id) override; | 73 void OnSurfaceDisplayed(int surface_id) override; |
74 void SetCompositorSuspendedForRecycle(ui::Compositor* compositor, | 74 void SetCompositorSuspendedForRecycle(ui::Compositor* compositor, |
75 bool suspended) override; | 75 bool suspended) override; |
76 bool SurfaceShouldNotShowFramesAfterSuspendForRecycle( | 76 bool SurfaceShouldNotShowFramesAfterSuspendForRecycle( |
77 int surface_id) const override; | 77 int surface_id) const override; |
78 #endif | 78 #endif |
79 | 79 |
80 private: | 80 private: |
81 struct PerCompositorData; | 81 struct PerCompositorData; |
82 | 82 |
| 83 scoped_refptr<ContextProviderCommandBuffer> SharedWorkerContextProvider(); |
83 PerCompositorData* CreatePerCompositorData(ui::Compositor* compositor); | 84 PerCompositorData* CreatePerCompositorData(ui::Compositor* compositor); |
84 scoped_ptr<cc::SoftwareOutputDevice> CreateSoftwareOutputDevice( | 85 scoped_ptr<cc::SoftwareOutputDevice> CreateSoftwareOutputDevice( |
85 ui::Compositor* compositor); | 86 ui::Compositor* compositor); |
86 void EstablishedGpuChannel(base::WeakPtr<ui::Compositor> compositor, | 87 void EstablishedGpuChannel(base::WeakPtr<ui::Compositor> compositor, |
87 bool create_gpu_output_surface, | 88 bool create_gpu_output_surface, |
88 int num_attempts); | 89 int num_attempts); |
89 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateContextCommon( | 90 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateContextCommon( |
90 scoped_refptr<GpuChannelHost> gpu_channel_host, | 91 scoped_refptr<GpuChannelHost> gpu_channel_host, |
91 int surface_id); | 92 int surface_id); |
92 | 93 |
93 void OnLostMainThreadSharedContextInsideCallback(); | 94 void OnLostMainThreadSharedContextInsideCallback(); |
94 void OnLostMainThreadSharedContext(); | 95 void OnLostMainThreadSharedContext(); |
| 96 void OnLostWorkerSharedContext(); |
95 | 97 |
96 typedef std::map<ui::Compositor*, PerCompositorData*> PerCompositorDataMap; | 98 typedef std::map<ui::Compositor*, PerCompositorData*> PerCompositorDataMap; |
97 PerCompositorDataMap per_compositor_data_; | 99 PerCompositorDataMap per_compositor_data_; |
98 scoped_refptr<ContextProviderCommandBuffer> shared_main_thread_contexts_; | 100 scoped_refptr<ContextProviderCommandBuffer> shared_main_thread_contexts_; |
99 scoped_ptr<GLHelper> gl_helper_; | 101 scoped_ptr<GLHelper> gl_helper_; |
100 base::ObserverList<ImageTransportFactoryObserver> observer_list_; | 102 base::ObserverList<ImageTransportFactoryObserver> observer_list_; |
101 scoped_ptr<cc::SurfaceManager> surface_manager_; | 103 scoped_ptr<cc::SurfaceManager> surface_manager_; |
102 uint32_t next_surface_id_namespace_; | 104 uint32_t next_surface_id_namespace_; |
103 scoped_ptr<cc::TaskGraphRunner> task_graph_runner_; | 105 scoped_ptr<cc::TaskGraphRunner> task_graph_runner_; |
104 scoped_ptr<base::SimpleThread> raster_thread_; | 106 scoped_ptr<base::SimpleThread> raster_thread_; |
| 107 scoped_refptr<ContextProviderCommandBuffer> shared_worker_context_provider_; |
105 | 108 |
106 #if defined(OS_WIN) | 109 #if defined(OS_WIN) |
107 scoped_ptr<OutputDeviceBacking> software_backing_; | 110 scoped_ptr<OutputDeviceBacking> software_backing_; |
108 #endif | 111 #endif |
109 | 112 |
110 // The contents of this map and its methods may only be used on the compositor | 113 // The contents of this map and its methods may only be used on the compositor |
111 // thread. | 114 // thread. |
112 IDMap<BrowserCompositorOutputSurface> output_surface_map_; | 115 IDMap<BrowserCompositorOutputSurface> output_surface_map_; |
113 | 116 |
114 base::WeakPtrFactory<GpuProcessTransportFactory> callback_factory_; | 117 base::WeakPtrFactory<GpuProcessTransportFactory> callback_factory_; |
115 | 118 |
116 DISALLOW_COPY_AND_ASSIGN(GpuProcessTransportFactory); | 119 DISALLOW_COPY_AND_ASSIGN(GpuProcessTransportFactory); |
117 }; | 120 }; |
118 | 121 |
119 } // namespace content | 122 } // namespace content |
120 | 123 |
121 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_ | 124 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_ |
OLD | NEW |