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" |
(...skipping 17 matching lines...) Expand all Loading... |
28 : public ui::ContextFactory, | 28 : public ui::ContextFactory, |
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 // ContextFactory implementation. | 38 // ui::ContextFactory implementation. |
39 virtual scoped_ptr<WebKit::WebGraphicsContext3D> CreateOffscreenContext() | |
40 OVERRIDE; | |
41 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface( | 39 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface( |
42 ui::Compositor* compositor) OVERRIDE; | 40 ui::Compositor* compositor) OVERRIDE; |
43 virtual scoped_refptr<ui::Reflector> CreateReflector( | 41 virtual scoped_refptr<ui::Reflector> CreateReflector( |
44 ui::Compositor* source, | 42 ui::Compositor* source, |
45 ui::Layer* target) OVERRIDE; | 43 ui::Layer* target) OVERRIDE; |
46 virtual void RemoveReflector( | 44 virtual void RemoveReflector( |
47 scoped_refptr<ui::Reflector> reflector) OVERRIDE; | 45 scoped_refptr<ui::Reflector> reflector) OVERRIDE; |
48 virtual void RemoveCompositor(ui::Compositor* compositor) OVERRIDE; | 46 virtual void RemoveCompositor(ui::Compositor* compositor) OVERRIDE; |
| 47 virtual scoped_refptr<cc::ContextProvider> |
| 48 OffscreenContextProviderForMainThread() OVERRIDE; |
| 49 virtual scoped_refptr<cc::ContextProvider> |
| 50 OffscreenContextProviderForCompositorThread() OVERRIDE; |
49 virtual bool DoesCreateTestContexts() OVERRIDE; | 51 virtual bool DoesCreateTestContexts() OVERRIDE; |
50 | 52 |
51 // ImageTransportFactory implementation. | 53 // ImageTransportFactory implementation. |
52 virtual ui::ContextFactory* AsContextFactory() OVERRIDE; | 54 virtual ui::ContextFactory* AsContextFactory() OVERRIDE; |
53 virtual gfx::GLSurfaceHandle CreateSharedSurfaceHandle() OVERRIDE; | 55 virtual gfx::GLSurfaceHandle CreateSharedSurfaceHandle() OVERRIDE; |
54 virtual void DestroySharedSurfaceHandle( | 56 virtual void DestroySharedSurfaceHandle( |
55 gfx::GLSurfaceHandle surface) OVERRIDE; | 57 gfx::GLSurfaceHandle surface) OVERRIDE; |
56 virtual scoped_refptr<ui::Texture> CreateTransportClient( | 58 virtual scoped_refptr<ui::Texture> CreateTransportClient( |
57 float device_scale_factor) OVERRIDE; | 59 float device_scale_factor) OVERRIDE; |
58 virtual scoped_refptr<ui::Texture> CreateOwnedTexture( | 60 virtual scoped_refptr<ui::Texture> CreateOwnedTexture( |
59 const gfx::Size& size, | 61 const gfx::Size& size, |
60 float device_scale_factor, | 62 float device_scale_factor, |
61 unsigned int texture_id) OVERRIDE; | 63 unsigned int texture_id) OVERRIDE; |
62 virtual GLHelper* GetGLHelper() OVERRIDE; | 64 virtual GLHelper* GetGLHelper() OVERRIDE; |
63 virtual uint32 InsertSyncPoint() OVERRIDE; | 65 virtual uint32 InsertSyncPoint() OVERRIDE; |
64 virtual void WaitSyncPoint(uint32 sync_point) OVERRIDE; | 66 virtual void WaitSyncPoint(uint32 sync_point) OVERRIDE; |
65 virtual void AddObserver(ImageTransportFactoryObserver* observer) OVERRIDE; | 67 virtual void AddObserver(ImageTransportFactoryObserver* observer) OVERRIDE; |
66 virtual void RemoveObserver( | 68 virtual void RemoveObserver( |
67 ImageTransportFactoryObserver* observer) OVERRIDE; | 69 ImageTransportFactoryObserver* observer) OVERRIDE; |
68 | 70 |
69 // ui::ContextFactory implementation. | |
70 virtual scoped_refptr<cc::ContextProvider> | |
71 OffscreenContextProviderForMainThread() OVERRIDE; | |
72 virtual scoped_refptr<cc::ContextProvider> | |
73 OffscreenContextProviderForCompositorThread() OVERRIDE; | |
74 | |
75 void OnLostContext(ui::Compositor* compositor); | 71 void OnLostContext(ui::Compositor* compositor); |
76 | 72 |
77 private: | 73 private: |
78 struct PerCompositorData; | 74 struct PerCompositorData; |
79 | 75 |
80 PerCompositorData* CreatePerCompositorData(ui::Compositor* compositor); | 76 PerCompositorData* CreatePerCompositorData(ui::Compositor* compositor); |
81 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateContextCommon( | 77 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateContextCommon( |
82 const base::WeakPtr<WebGraphicsContext3DSwapBuffersClient>& swap_client, | 78 const base::WeakPtr<WebGraphicsContext3DSwapBuffersClient>& swap_client, |
83 int surface_id); | 79 int surface_id); |
84 | 80 |
(...skipping 16 matching lines...) Expand all Loading... |
101 IDMap<BrowserCompositorOutputSurface> output_surface_map_; | 97 IDMap<BrowserCompositorOutputSurface> output_surface_map_; |
102 | 98 |
103 scoped_refptr<BrowserCompositorOutputSurfaceProxy> output_surface_proxy_; | 99 scoped_refptr<BrowserCompositorOutputSurfaceProxy> output_surface_proxy_; |
104 | 100 |
105 DISALLOW_COPY_AND_ASSIGN(GpuProcessTransportFactory); | 101 DISALLOW_COPY_AND_ASSIGN(GpuProcessTransportFactory); |
106 }; | 102 }; |
107 | 103 |
108 } // namespace content | 104 } // namespace content |
109 | 105 |
110 #endif // CONTENT_BROWSER_AURA_GPU_PROCESS_TRANSPORT_FACTORY_H_ | 106 #endif // CONTENT_BROWSER_AURA_GPU_PROCESS_TRANSPORT_FACTORY_H_ |
OLD | NEW |