| 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 26 matching lines...) Expand all Loading... |
| 37 // ui::ContextFactory implementation. | 37 // ui::ContextFactory implementation. |
| 38 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface( | 38 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface( |
| 39 ui::Compositor* compositor, bool software_fallback) OVERRIDE; | 39 ui::Compositor* compositor, bool software_fallback) OVERRIDE; |
| 40 virtual scoped_refptr<ui::Reflector> CreateReflector( | 40 virtual scoped_refptr<ui::Reflector> CreateReflector( |
| 41 ui::Compositor* source, | 41 ui::Compositor* source, |
| 42 ui::Layer* target) OVERRIDE; | 42 ui::Layer* target) OVERRIDE; |
| 43 virtual void RemoveReflector( | 43 virtual void RemoveReflector( |
| 44 scoped_refptr<ui::Reflector> reflector) OVERRIDE; | 44 scoped_refptr<ui::Reflector> reflector) OVERRIDE; |
| 45 virtual void RemoveCompositor(ui::Compositor* compositor) OVERRIDE; | 45 virtual void RemoveCompositor(ui::Compositor* compositor) OVERRIDE; |
| 46 virtual scoped_refptr<cc::ContextProvider> | 46 virtual scoped_refptr<cc::ContextProvider> |
| 47 OffscreenCompositorContextProvider() OVERRIDE; | |
| 48 virtual scoped_refptr<cc::ContextProvider> | |
| 49 SharedMainThreadContextProvider() OVERRIDE; | 47 SharedMainThreadContextProvider() OVERRIDE; |
| 50 virtual bool DoesCreateTestContexts() OVERRIDE; | 48 virtual bool DoesCreateTestContexts() OVERRIDE; |
| 51 | 49 |
| 52 // ImageTransportFactory implementation. | 50 // ImageTransportFactory implementation. |
| 53 virtual ui::ContextFactory* AsContextFactory() OVERRIDE; | 51 virtual ui::ContextFactory* AsContextFactory() OVERRIDE; |
| 54 virtual gfx::GLSurfaceHandle GetSharedSurfaceHandle() OVERRIDE; | 52 virtual gfx::GLSurfaceHandle GetSharedSurfaceHandle() OVERRIDE; |
| 55 virtual GLHelper* GetGLHelper() OVERRIDE; | 53 virtual GLHelper* GetGLHelper() OVERRIDE; |
| 56 virtual void AddObserver(ImageTransportFactoryObserver* observer) OVERRIDE; | 54 virtual void AddObserver(ImageTransportFactoryObserver* observer) OVERRIDE; |
| 57 virtual void RemoveObserver( | 55 virtual void RemoveObserver( |
| 58 ImageTransportFactoryObserver* observer) OVERRIDE; | 56 ImageTransportFactoryObserver* observer) OVERRIDE; |
| 59 | 57 |
| 60 private: | 58 private: |
| 61 struct PerCompositorData; | 59 struct PerCompositorData; |
| 62 | 60 |
| 63 PerCompositorData* CreatePerCompositorData(ui::Compositor* compositor); | 61 PerCompositorData* CreatePerCompositorData(ui::Compositor* compositor); |
| 64 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> | 62 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> |
| 65 CreateContextCommon(int surface_id); | 63 CreateContextCommon(int surface_id); |
| 66 | 64 |
| 67 void OnLostMainThreadSharedContextInsideCallback(); | 65 void OnLostMainThreadSharedContextInsideCallback(); |
| 68 void OnLostMainThreadSharedContext(); | 66 void OnLostMainThreadSharedContext(); |
| 69 | 67 |
| 70 typedef std::map<ui::Compositor*, PerCompositorData*> PerCompositorDataMap; | 68 typedef std::map<ui::Compositor*, PerCompositorData*> PerCompositorDataMap; |
| 71 PerCompositorDataMap per_compositor_data_; | 69 PerCompositorDataMap per_compositor_data_; |
| 72 scoped_refptr<ContextProviderCommandBuffer> offscreen_compositor_contexts_; | |
| 73 scoped_refptr<ContextProviderCommandBuffer> shared_main_thread_contexts_; | 70 scoped_refptr<ContextProviderCommandBuffer> shared_main_thread_contexts_; |
| 74 scoped_ptr<GLHelper> gl_helper_; | 71 scoped_ptr<GLHelper> gl_helper_; |
| 75 ObserverList<ImageTransportFactoryObserver> observer_list_; | 72 ObserverList<ImageTransportFactoryObserver> observer_list_; |
| 76 base::WeakPtrFactory<GpuProcessTransportFactory> callback_factory_; | 73 base::WeakPtrFactory<GpuProcessTransportFactory> callback_factory_; |
| 77 bool offscreen_content_bound_to_other_thread_; | |
| 78 | 74 |
| 79 // The contents of this map and its methods may only be used on the compositor | 75 // The contents of this map and its methods may only be used on the compositor |
| 80 // thread. | 76 // thread. |
| 81 IDMap<BrowserCompositorOutputSurface> output_surface_map_; | 77 IDMap<BrowserCompositorOutputSurface> output_surface_map_; |
| 82 | 78 |
| 83 scoped_refptr<BrowserCompositorOutputSurfaceProxy> output_surface_proxy_; | 79 scoped_refptr<BrowserCompositorOutputSurfaceProxy> output_surface_proxy_; |
| 84 | 80 |
| 85 DISALLOW_COPY_AND_ASSIGN(GpuProcessTransportFactory); | 81 DISALLOW_COPY_AND_ASSIGN(GpuProcessTransportFactory); |
| 86 }; | 82 }; |
| 87 | 83 |
| 88 } // namespace content | 84 } // namespace content |
| 89 | 85 |
| 90 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_ | 86 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_ |
| OLD | NEW |