| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_AURA_GPU_PROCESS_TRANSPORT_FACTORY_H_ | 5 #ifndef CONTENT_BROWSER_AURA_GPU_PROCESS_TRANSPORT_FACTORY_H_ |
| 6 #define CONTENT_BROWSER_AURA_GPU_PROCESS_TRANSPORT_FACTORY_H_ | 6 #define CONTENT_BROWSER_AURA_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" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
| 15 #include "content/browser/aura/image_transport_factory.h" | 15 #include "content/browser/aura/image_transport_factory.h" |
| 16 #include "ui/compositor/compositor.h" | 16 #include "ui/compositor/compositor.h" |
| 17 | 17 |
| 18 namespace content { | 18 namespace content { |
| 19 class BrowserCompositorOutputSurface; | 19 class BrowserCompositorOutputSurface; |
| 20 class BrowserCompositorOutputSurfaceProxy; | 20 class BrowserCompositorOutputSurfaceProxy; |
| 21 class CompositorSwapClient; | 21 class CompositorSwapClient; |
| 22 class ContextProviderCommandBuffer; | 22 class ContextProviderCommandBuffer; |
| 23 class ReflectorImpl; | 23 class ReflectorImpl; |
| 24 class WebGraphicsContext3DCommandBufferImpl; | 24 class WebGraphicsContext3DCommandBufferImpl; |
| 25 class WebGraphicsContext3DSwapBuffersClient; | 25 class WebGraphicsContext3DSwapBuffersClient; |
| 26 | 26 |
| 27 class GpuProcessTransportFactory | 27 class GpuProcessTransportFactory : public ui::ContextFactory, |
| 28 : public ui::ContextFactory, | 28 public SurfaceCapturingContextFactory, |
| 29 public ImageTransportFactory { | 29 public ImageTransportFactory { |
| 30 public: | 30 public: |
| 31 GpuProcessTransportFactory(); | 31 GpuProcessTransportFactory(); |
| 32 | 32 |
| 33 virtual ~GpuProcessTransportFactory(); | 33 virtual ~GpuProcessTransportFactory(); |
| 34 | 34 |
| 35 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> | 35 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> |
| 36 CreateOffscreenCommandBufferContext(); | 36 CreateOffscreenCommandBufferContext(); |
| 37 | 37 |
| 38 // ui::ContextFactory implementation. | 38 // ui::ContextFactory implementation. |
| 39 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface( | 39 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface( |
| 40 ui::Compositor* compositor) OVERRIDE; | 40 ui::Compositor* compositor) OVERRIDE; |
| 41 virtual scoped_refptr<ui::Reflector> CreateReflector( | 41 virtual scoped_refptr<ui::Reflector> CreateReflector( |
| 42 ui::Compositor* source, | 42 ui::Compositor* source, |
| 43 ui::Layer* target) OVERRIDE; | 43 ui::Layer* target) OVERRIDE; |
| 44 virtual void RemoveReflector( | 44 virtual void RemoveReflector( |
| 45 scoped_refptr<ui::Reflector> reflector) OVERRIDE; | 45 scoped_refptr<ui::Reflector> reflector) OVERRIDE; |
| 46 virtual void RemoveCompositor(ui::Compositor* compositor) OVERRIDE; | 46 virtual void RemoveCompositor(ui::Compositor* compositor) OVERRIDE; |
| 47 virtual scoped_refptr<cc::ContextProvider> | 47 virtual scoped_refptr<cc::ContextProvider> |
| 48 OffscreenContextProviderForMainThread() OVERRIDE; | 48 OffscreenContextProviderForMainThread() OVERRIDE; |
| 49 virtual scoped_refptr<cc::ContextProvider> | 49 virtual scoped_refptr<cc::ContextProvider> |
| 50 OffscreenContextProviderForCompositorThread() OVERRIDE; | 50 OffscreenContextProviderForCompositorThread() OVERRIDE; |
| 51 virtual bool DoesCreateTestContexts() OVERRIDE; | 51 virtual bool DoesCreateTestContexts() OVERRIDE; |
| 52 | 52 |
| 53 // SurfaceCapturingContextFactory implementation. |
| 54 virtual scoped_ptr<SurfaceCapturer> CreateOutputSurfaceCapturer( |
| 55 ui::Compositor* compositor, |
| 56 SurfaceCapturer::Client* client) OVERRIDE; |
| 57 |
| 53 // ImageTransportFactory implementation. | 58 // ImageTransportFactory implementation. |
| 54 virtual ui::ContextFactory* AsContextFactory() OVERRIDE; | 59 virtual ui::ContextFactory* AsContextFactory() OVERRIDE; |
| 60 virtual SurfaceCapturingContextFactory* AsSurfaceCapturingContextFactory() |
| 61 OVERRIDE; |
| 55 virtual gfx::GLSurfaceHandle CreateSharedSurfaceHandle() OVERRIDE; | 62 virtual gfx::GLSurfaceHandle CreateSharedSurfaceHandle() OVERRIDE; |
| 56 virtual void DestroySharedSurfaceHandle( | 63 virtual void DestroySharedSurfaceHandle( |
| 57 gfx::GLSurfaceHandle surface) OVERRIDE; | 64 gfx::GLSurfaceHandle surface) OVERRIDE; |
| 58 virtual scoped_refptr<ui::Texture> CreateTransportClient( | 65 virtual scoped_refptr<ui::Texture> CreateTransportClient( |
| 59 float device_scale_factor) OVERRIDE; | 66 float device_scale_factor) OVERRIDE; |
| 60 virtual scoped_refptr<ui::Texture> CreateOwnedTexture( | 67 virtual scoped_refptr<ui::Texture> CreateOwnedTexture( |
| 61 const gfx::Size& size, | 68 const gfx::Size& size, |
| 62 float device_scale_factor, | 69 float device_scale_factor, |
| 63 unsigned int texture_id) OVERRIDE; | 70 unsigned int texture_id) OVERRIDE; |
| 64 virtual GLHelper* GetGLHelper() OVERRIDE; | 71 virtual GLHelper* GetGLHelper() OVERRIDE; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 IDMap<BrowserCompositorOutputSurface> output_surface_map_; | 104 IDMap<BrowserCompositorOutputSurface> output_surface_map_; |
| 98 | 105 |
| 99 scoped_refptr<BrowserCompositorOutputSurfaceProxy> output_surface_proxy_; | 106 scoped_refptr<BrowserCompositorOutputSurfaceProxy> output_surface_proxy_; |
| 100 | 107 |
| 101 DISALLOW_COPY_AND_ASSIGN(GpuProcessTransportFactory); | 108 DISALLOW_COPY_AND_ASSIGN(GpuProcessTransportFactory); |
| 102 }; | 109 }; |
| 103 | 110 |
| 104 } // namespace content | 111 } // namespace content |
| 105 | 112 |
| 106 #endif // CONTENT_BROWSER_AURA_GPU_PROCESS_TRANSPORT_FACTORY_H_ | 113 #endif // CONTENT_BROWSER_AURA_GPU_PROCESS_TRANSPORT_FACTORY_H_ |
| OLD | NEW |