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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 void CreateOutputSurface(base::WeakPtr<ui::Compositor> compositor, | 46 void CreateOutputSurface(base::WeakPtr<ui::Compositor> compositor, |
47 bool software_fallback) override; | 47 bool software_fallback) override; |
48 scoped_refptr<ui::Reflector> CreateReflector(ui::Compositor* source, | 48 scoped_refptr<ui::Reflector> CreateReflector(ui::Compositor* source, |
49 ui::Layer* target) override; | 49 ui::Layer* target) override; |
50 void RemoveReflector(scoped_refptr<ui::Reflector> reflector) override; | 50 void RemoveReflector(scoped_refptr<ui::Reflector> reflector) override; |
51 void RemoveCompositor(ui::Compositor* compositor) override; | 51 void RemoveCompositor(ui::Compositor* compositor) override; |
52 scoped_refptr<cc::ContextProvider> SharedMainThreadContextProvider() override; | 52 scoped_refptr<cc::ContextProvider> SharedMainThreadContextProvider() override; |
53 bool DoesCreateTestContexts() override; | 53 bool DoesCreateTestContexts() override; |
54 cc::SharedBitmapManager* GetSharedBitmapManager() override; | 54 cc::SharedBitmapManager* GetSharedBitmapManager() override; |
55 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; | 55 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; |
56 base::MessageLoopProxy* GetCompositorMessageLoop() override; | |
57 scoped_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() override; | 56 scoped_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() override; |
58 void ResizeDisplay(ui::Compositor* compositor, | 57 void ResizeDisplay(ui::Compositor* compositor, |
59 const gfx::Size& size) override; | 58 const gfx::Size& size) override; |
60 | 59 |
61 // ImageTransportFactory implementation. | 60 // ImageTransportFactory implementation. |
62 ui::ContextFactory* GetContextFactory() override; | 61 ui::ContextFactory* GetContextFactory() override; |
63 gfx::GLSurfaceHandle GetSharedSurfaceHandle() override; | 62 gfx::GLSurfaceHandle GetSharedSurfaceHandle() override; |
64 cc::SurfaceManager* GetSurfaceManager() override; | 63 cc::SurfaceManager* GetSurfaceManager() override; |
65 GLHelper* GetGLHelper() override; | 64 GLHelper* GetGLHelper() override; |
66 void AddObserver(ImageTransportFactoryObserver* observer) override; | 65 void AddObserver(ImageTransportFactoryObserver* observer) override; |
(...skipping 11 matching lines...) Expand all Loading... |
78 void EstablishedGpuChannel(base::WeakPtr<ui::Compositor> compositor, | 77 void EstablishedGpuChannel(base::WeakPtr<ui::Compositor> compositor, |
79 bool create_software_renderer); | 78 bool create_software_renderer); |
80 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateContextCommon( | 79 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateContextCommon( |
81 scoped_refptr<GpuChannelHost> gpu_channel_host, | 80 scoped_refptr<GpuChannelHost> gpu_channel_host, |
82 int surface_id); | 81 int surface_id); |
83 | 82 |
84 void OnLostMainThreadSharedContextInsideCallback(); | 83 void OnLostMainThreadSharedContextInsideCallback(); |
85 void OnLostMainThreadSharedContext(); | 84 void OnLostMainThreadSharedContext(); |
86 | 85 |
87 typedef std::map<ui::Compositor*, PerCompositorData*> PerCompositorDataMap; | 86 typedef std::map<ui::Compositor*, PerCompositorData*> PerCompositorDataMap; |
88 scoped_ptr<base::Thread> compositor_thread_; | |
89 PerCompositorDataMap per_compositor_data_; | 87 PerCompositorDataMap per_compositor_data_; |
90 scoped_refptr<ContextProviderCommandBuffer> shared_main_thread_contexts_; | 88 scoped_refptr<ContextProviderCommandBuffer> shared_main_thread_contexts_; |
91 scoped_ptr<GLHelper> gl_helper_; | 89 scoped_ptr<GLHelper> gl_helper_; |
92 ObserverList<ImageTransportFactoryObserver> observer_list_; | 90 ObserverList<ImageTransportFactoryObserver> observer_list_; |
93 scoped_ptr<cc::SurfaceManager> surface_manager_; | 91 scoped_ptr<cc::SurfaceManager> surface_manager_; |
94 uint32_t next_surface_id_namespace_; | 92 uint32_t next_surface_id_namespace_; |
95 | 93 |
96 // 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 |
97 // thread. | 95 // thread. |
98 IDMap<BrowserCompositorOutputSurface> output_surface_map_; | 96 IDMap<BrowserCompositorOutputSurface> output_surface_map_; |
99 | 97 |
100 base::WeakPtrFactory<GpuProcessTransportFactory> callback_factory_; | 98 base::WeakPtrFactory<GpuProcessTransportFactory> callback_factory_; |
101 | 99 |
102 DISALLOW_COPY_AND_ASSIGN(GpuProcessTransportFactory); | 100 DISALLOW_COPY_AND_ASSIGN(GpuProcessTransportFactory); |
103 }; | 101 }; |
104 | 102 |
105 } // namespace content | 103 } // namespace content |
106 | 104 |
107 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_ | 105 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_ |
OLD | NEW |