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 25 matching lines...) Expand all Loading... |
36 public ImageTransportFactory { | 36 public ImageTransportFactory { |
37 public: | 37 public: |
38 GpuProcessTransportFactory(); | 38 GpuProcessTransportFactory(); |
39 | 39 |
40 ~GpuProcessTransportFactory() override; | 40 ~GpuProcessTransportFactory() override; |
41 | 41 |
42 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> | 42 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> |
43 CreateOffscreenCommandBufferContext(); | 43 CreateOffscreenCommandBufferContext(); |
44 | 44 |
45 // ui::ContextFactory implementation. | 45 // ui::ContextFactory implementation. |
46 void CreateOutputSurface(base::WeakPtr<ui::Compositor> compositor, | 46 void CreateOutputSurface(base::WeakPtr<ui::Compositor> compositor) override; |
47 bool software_fallback) override; | |
48 scoped_refptr<ui::Reflector> CreateReflector(ui::Compositor* source, | 47 scoped_refptr<ui::Reflector> CreateReflector(ui::Compositor* source, |
49 ui::Layer* target) override; | 48 ui::Layer* target) override; |
50 void RemoveReflector(scoped_refptr<ui::Reflector> reflector) override; | 49 void RemoveReflector(scoped_refptr<ui::Reflector> reflector) override; |
51 void RemoveCompositor(ui::Compositor* compositor) override; | 50 void RemoveCompositor(ui::Compositor* compositor) override; |
52 scoped_refptr<cc::ContextProvider> SharedMainThreadContextProvider() override; | 51 scoped_refptr<cc::ContextProvider> SharedMainThreadContextProvider() override; |
53 bool DoesCreateTestContexts() override; | 52 bool DoesCreateTestContexts() override; |
54 cc::SharedBitmapManager* GetSharedBitmapManager() override; | 53 cc::SharedBitmapManager* GetSharedBitmapManager() override; |
55 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; | 54 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; |
56 scoped_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() override; | 55 scoped_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() override; |
57 void ResizeDisplay(ui::Compositor* compositor, | 56 void ResizeDisplay(ui::Compositor* compositor, |
(...skipping 10 matching lines...) Expand all Loading... |
68 void OnSurfaceDisplayed(int surface_id) override; | 67 void OnSurfaceDisplayed(int surface_id) override; |
69 void OnCompositorRecycled(ui::Compositor* compositor) override; | 68 void OnCompositorRecycled(ui::Compositor* compositor) override; |
70 bool SurfaceShouldNotShowFramesAfterRecycle(int surface_id) const override; | 69 bool SurfaceShouldNotShowFramesAfterRecycle(int surface_id) const override; |
71 #endif | 70 #endif |
72 | 71 |
73 private: | 72 private: |
74 struct PerCompositorData; | 73 struct PerCompositorData; |
75 | 74 |
76 PerCompositorData* CreatePerCompositorData(ui::Compositor* compositor); | 75 PerCompositorData* CreatePerCompositorData(ui::Compositor* compositor); |
77 void EstablishedGpuChannel(base::WeakPtr<ui::Compositor> compositor, | 76 void EstablishedGpuChannel(base::WeakPtr<ui::Compositor> compositor, |
78 bool create_software_renderer); | 77 bool create_gpu_output_surface, |
| 78 int num_attempts); |
79 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateContextCommon( | 79 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateContextCommon( |
80 scoped_refptr<GpuChannelHost> gpu_channel_host, | 80 scoped_refptr<GpuChannelHost> gpu_channel_host, |
81 int surface_id); | 81 int surface_id); |
82 | 82 |
83 void OnLostMainThreadSharedContextInsideCallback(); | 83 void OnLostMainThreadSharedContextInsideCallback(); |
84 void OnLostMainThreadSharedContext(); | 84 void OnLostMainThreadSharedContext(); |
85 | 85 |
86 typedef std::map<ui::Compositor*, PerCompositorData*> PerCompositorDataMap; | 86 typedef std::map<ui::Compositor*, PerCompositorData*> PerCompositorDataMap; |
87 PerCompositorDataMap per_compositor_data_; | 87 PerCompositorDataMap per_compositor_data_; |
88 scoped_refptr<ContextProviderCommandBuffer> shared_main_thread_contexts_; | 88 scoped_refptr<ContextProviderCommandBuffer> shared_main_thread_contexts_; |
89 scoped_ptr<GLHelper> gl_helper_; | 89 scoped_ptr<GLHelper> gl_helper_; |
90 ObserverList<ImageTransportFactoryObserver> observer_list_; | 90 ObserverList<ImageTransportFactoryObserver> observer_list_; |
91 scoped_ptr<cc::SurfaceManager> surface_manager_; | 91 scoped_ptr<cc::SurfaceManager> surface_manager_; |
92 uint32_t next_surface_id_namespace_; | 92 uint32_t next_surface_id_namespace_; |
93 | 93 |
94 // The contents of this map and its methods may only be used on the compositor | 94 // The contents of this map and its methods may only be used on the compositor |
95 // thread. | 95 // thread. |
96 IDMap<BrowserCompositorOutputSurface> output_surface_map_; | 96 IDMap<BrowserCompositorOutputSurface> output_surface_map_; |
97 | 97 |
98 base::WeakPtrFactory<GpuProcessTransportFactory> callback_factory_; | 98 base::WeakPtrFactory<GpuProcessTransportFactory> callback_factory_; |
99 | 99 |
100 DISALLOW_COPY_AND_ASSIGN(GpuProcessTransportFactory); | 100 DISALLOW_COPY_AND_ASSIGN(GpuProcessTransportFactory); |
101 }; | 101 }; |
102 | 102 |
103 } // namespace content | 103 } // namespace content |
104 | 104 |
105 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_ | 105 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_ |
OLD | NEW |