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_IMAGE_TRANSPORT_FACTORY_H_ | 5 #ifndef CONTENT_BROWSER_COMPOSITOR_IMAGE_TRANSPORT_FACTORY_H_ |
6 #define CONTENT_BROWSER_COMPOSITOR_IMAGE_TRANSPORT_FACTORY_H_ | 6 #define CONTENT_BROWSER_COMPOSITOR_IMAGE_TRANSPORT_FACTORY_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <string> | 9 #include <string> |
9 | 10 |
10 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
13 #include "cc/surfaces/surface_id_allocator.h" | 13 #include "cc/surfaces/surface_id_allocator.h" |
14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
15 #include "ui/events/latency_info.h" | 15 #include "ui/events/latency_info.h" |
16 #include "ui/gfx/native_widget_types.h" | 16 #include "ui/gfx/native_widget_types.h" |
17 | 17 |
18 namespace cc { | 18 namespace cc { |
19 class SurfaceManager; | 19 class SurfaceManager; |
20 } | 20 } |
21 | 21 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 // using that surface as a texture). The factory is a process-wide singleton. | 57 // using that surface as a texture). The factory is a process-wide singleton. |
58 class CONTENT_EXPORT ImageTransportFactory { | 58 class CONTENT_EXPORT ImageTransportFactory { |
59 public: | 59 public: |
60 virtual ~ImageTransportFactory() {} | 60 virtual ~ImageTransportFactory() {} |
61 | 61 |
62 // Initializes the global transport factory. | 62 // Initializes the global transport factory. |
63 static void Initialize(); | 63 static void Initialize(); |
64 | 64 |
65 // Initializes the global transport factory for unit tests using the provided | 65 // Initializes the global transport factory for unit tests using the provided |
66 // context factory. | 66 // context factory. |
67 static void InitializeForUnitTests(scoped_ptr<ImageTransportFactory> factory); | 67 static void InitializeForUnitTests( |
| 68 std::unique_ptr<ImageTransportFactory> factory); |
68 | 69 |
69 // Terminates the global transport factory. | 70 // Terminates the global transport factory. |
70 static void Terminate(); | 71 static void Terminate(); |
71 | 72 |
72 // Gets the factory instance. | 73 // Gets the factory instance. |
73 static ImageTransportFactory* GetInstance(); | 74 static ImageTransportFactory* GetInstance(); |
74 | 75 |
75 // Gets the image transport factory as a context factory for the compositor. | 76 // Gets the image transport factory as a context factory for the compositor. |
76 virtual ui::ContextFactory* GetContextFactory() = 0; | 77 virtual ui::ContextFactory* GetContextFactory() = 0; |
77 | 78 |
(...skipping 24 matching lines...) Expand all Loading... |
102 // Used by GpuProcessHostUIShim to determine if a frame should not be | 103 // Used by GpuProcessHostUIShim to determine if a frame should not be |
103 // displayed because it is targetted to an NSView that has been disconnected. | 104 // displayed because it is targetted to an NSView that has been disconnected. |
104 virtual bool SurfaceShouldNotShowFramesAfterSuspendForRecycle( | 105 virtual bool SurfaceShouldNotShowFramesAfterSuspendForRecycle( |
105 int surface_id) const = 0; | 106 int surface_id) const = 0; |
106 #endif | 107 #endif |
107 }; | 108 }; |
108 | 109 |
109 } // namespace content | 110 } // namespace content |
110 | 111 |
111 #endif // CONTENT_BROWSER_COMPOSITOR_IMAGE_TRANSPORT_FACTORY_H_ | 112 #endif // CONTENT_BROWSER_COMPOSITOR_IMAGE_TRANSPORT_FACTORY_H_ |
OLD | NEW |