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 <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 namespace ui { | 27 namespace ui { |
28 class Compositor; | 28 class Compositor; |
29 class ContextFactory; | 29 class ContextFactory; |
30 class Texture; | 30 class Texture; |
31 } | 31 } |
32 | 32 |
33 namespace blink { | 33 namespace blink { |
34 class WebGraphicsContext3D; | 34 class WebGraphicsContext3D; |
35 } | 35 } |
36 | 36 |
| 37 namespace display_compositor { |
| 38 class GLHelper; |
| 39 } |
| 40 |
37 namespace content { | 41 namespace content { |
38 class GLHelper; | |
39 | 42 |
40 // This class provides a way to get notified when surface handles get lost. | 43 // This class provides a way to get notified when surface handles get lost. |
41 class CONTENT_EXPORT ImageTransportFactoryObserver { | 44 class CONTENT_EXPORT ImageTransportFactoryObserver { |
42 public: | 45 public: |
43 virtual ~ImageTransportFactoryObserver() {} | 46 virtual ~ImageTransportFactoryObserver() {} |
44 | 47 |
45 // Notifies that the surface handles generated by ImageTransportFactory were | 48 // Notifies that the surface handles generated by ImageTransportFactory were |
46 // lost. | 49 // lost. |
47 // When this is called, the old resources (e.g. shared context, GL helper) | 50 // When this is called, the old resources (e.g. shared context, GL helper) |
48 // still exist, but are about to be destroyed. Getting a reference to those | 51 // still exist, but are about to be destroyed. Getting a reference to those |
(...skipping 25 matching lines...) Expand all Loading... |
74 static ImageTransportFactory* GetInstance(); | 77 static ImageTransportFactory* GetInstance(); |
75 | 78 |
76 // Gets the image transport factory as a context factory for the compositor. | 79 // Gets the image transport factory as a context factory for the compositor. |
77 virtual ui::ContextFactory* GetContextFactory() = 0; | 80 virtual ui::ContextFactory* GetContextFactory() = 0; |
78 | 81 |
79 virtual cc::SurfaceManager* GetSurfaceManager() = 0; | 82 virtual cc::SurfaceManager* GetSurfaceManager() = 0; |
80 | 83 |
81 // Gets a GLHelper instance, associated with the shared context. This | 84 // Gets a GLHelper instance, associated with the shared context. This |
82 // GLHelper will get destroyed whenever the shared context is lost | 85 // GLHelper will get destroyed whenever the shared context is lost |
83 // (ImageTransportFactoryObserver::OnLostResources is called). | 86 // (ImageTransportFactoryObserver::OnLostResources is called). |
84 virtual GLHelper* GetGLHelper() = 0; | 87 virtual display_compositor::GLHelper* GetGLHelper() = 0; |
85 | 88 |
86 virtual void AddObserver(ImageTransportFactoryObserver* observer) = 0; | 89 virtual void AddObserver(ImageTransportFactoryObserver* observer) = 0; |
87 virtual void RemoveObserver(ImageTransportFactoryObserver* observer) = 0; | 90 virtual void RemoveObserver(ImageTransportFactoryObserver* observer) = 0; |
88 | 91 |
89 #if defined(OS_MACOSX) | 92 #if defined(OS_MACOSX) |
90 virtual void OnGpuSwapBuffersCompleted( | 93 virtual void OnGpuSwapBuffersCompleted( |
91 int surface_id, | 94 int surface_id, |
92 const std::vector<ui::LatencyInfo>& latency_info, | 95 const std::vector<ui::LatencyInfo>& latency_info, |
93 gfx::SwapResult result) = 0; | 96 gfx::SwapResult result) = 0; |
94 | 97 |
95 // Called with |suspended| as true when the ui::Compositor has been | 98 // Called with |suspended| as true when the ui::Compositor has been |
96 // disconnected from an NSView and may be attached to another one. Called | 99 // disconnected from an NSView and may be attached to another one. Called |
97 // with |suspended| as false after the ui::Compositor has been connected to | 100 // with |suspended| as false after the ui::Compositor has been connected to |
98 // a new NSView and the first commit targeted at the new NSView has | 101 // a new NSView and the first commit targeted at the new NSView has |
99 // completed. This ensures that content and frames intended for the old | 102 // completed. This ensures that content and frames intended for the old |
100 // NSView will not flash in the new NSView. | 103 // NSView will not flash in the new NSView. |
101 virtual void SetCompositorSuspendedForRecycle(ui::Compositor* compositor, | 104 virtual void SetCompositorSuspendedForRecycle(ui::Compositor* compositor, |
102 bool suspended) = 0; | 105 bool suspended) = 0; |
103 // Used by GpuProcessHostUIShim to determine if a frame should not be | 106 // Used by GpuProcessHostUIShim to determine if a frame should not be |
104 // displayed because it is targetted to an NSView that has been disconnected. | 107 // displayed because it is targetted to an NSView that has been disconnected. |
105 virtual bool SurfaceShouldNotShowFramesAfterSuspendForRecycle( | 108 virtual bool SurfaceShouldNotShowFramesAfterSuspendForRecycle( |
106 int surface_id) const = 0; | 109 int surface_id) const = 0; |
107 #endif | 110 #endif |
108 }; | 111 }; |
109 | 112 |
110 } // namespace content | 113 } // namespace content |
111 | 114 |
112 #endif // CONTENT_BROWSER_COMPOSITOR_IMAGE_TRANSPORT_FACTORY_H_ | 115 #endif // CONTENT_BROWSER_COMPOSITOR_IMAGE_TRANSPORT_FACTORY_H_ |
OLD | NEW |