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 | 11 |
12 #include "base/id_map.h" | 12 #include "base/id_map.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.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 "content/common/gpu/client/gpu_channel_host.h" | 20 #include "gpu/ipc/client/gpu_channel_host.h" |
21 #include "gpu/ipc/common/surface_handle.h" | 21 #include "gpu/ipc/common/surface_handle.h" |
22 #include "ui/compositor/compositor.h" | 22 #include "ui/compositor/compositor.h" |
23 | 23 |
24 namespace base { | 24 namespace base { |
25 class SimpleThread; | 25 class SimpleThread; |
26 class Thread; | 26 class Thread; |
27 } | 27 } |
28 | 28 |
29 namespace cc { | 29 namespace cc { |
30 class SingleThreadTaskGraphRunner; | 30 class SingleThreadTaskGraphRunner; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 private: | 88 private: |
89 struct PerCompositorData; | 89 struct PerCompositorData; |
90 | 90 |
91 PerCompositorData* CreatePerCompositorData(ui::Compositor* compositor); | 91 PerCompositorData* CreatePerCompositorData(ui::Compositor* compositor); |
92 scoped_ptr<cc::SoftwareOutputDevice> CreateSoftwareOutputDevice( | 92 scoped_ptr<cc::SoftwareOutputDevice> CreateSoftwareOutputDevice( |
93 ui::Compositor* compositor); | 93 ui::Compositor* compositor); |
94 void EstablishedGpuChannel(base::WeakPtr<ui::Compositor> compositor, | 94 void EstablishedGpuChannel(base::WeakPtr<ui::Compositor> compositor, |
95 bool create_gpu_output_surface, | 95 bool create_gpu_output_surface, |
96 int num_attempts); | 96 int num_attempts); |
97 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateContextCommon( | 97 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateContextCommon( |
98 scoped_refptr<GpuChannelHost> gpu_channel_host, | 98 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host, |
99 gpu::SurfaceHandle surface_handle); | 99 gpu::SurfaceHandle surface_handle); |
100 | 100 |
101 void OnLostMainThreadSharedContextInsideCallback(); | 101 void OnLostMainThreadSharedContextInsideCallback(); |
102 void OnLostMainThreadSharedContext(); | 102 void OnLostMainThreadSharedContext(); |
103 | 103 |
104 typedef std::map<ui::Compositor*, PerCompositorData*> PerCompositorDataMap; | 104 typedef std::map<ui::Compositor*, PerCompositorData*> PerCompositorDataMap; |
105 PerCompositorDataMap per_compositor_data_; | 105 PerCompositorDataMap per_compositor_data_; |
106 scoped_refptr<ContextProviderCommandBuffer> shared_main_thread_contexts_; | 106 scoped_refptr<ContextProviderCommandBuffer> shared_main_thread_contexts_; |
107 scoped_ptr<GLHelper> gl_helper_; | 107 scoped_ptr<GLHelper> gl_helper_; |
108 base::ObserverList<ImageTransportFactoryObserver> observer_list_; | 108 base::ObserverList<ImageTransportFactoryObserver> observer_list_; |
(...skipping 11 matching lines...) Expand all Loading... |
120 IDMap<BrowserCompositorOutputSurface> output_surface_map_; | 120 IDMap<BrowserCompositorOutputSurface> output_surface_map_; |
121 | 121 |
122 base::WeakPtrFactory<GpuProcessTransportFactory> callback_factory_; | 122 base::WeakPtrFactory<GpuProcessTransportFactory> callback_factory_; |
123 | 123 |
124 DISALLOW_COPY_AND_ASSIGN(GpuProcessTransportFactory); | 124 DISALLOW_COPY_AND_ASSIGN(GpuProcessTransportFactory); |
125 }; | 125 }; |
126 | 126 |
127 } // namespace content | 127 } // namespace content |
128 | 128 |
129 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_ | 129 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_ |
OLD | NEW |