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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // Gets a GLHelper instance, associated with the shared context. This | 78 // Gets a GLHelper instance, associated with the shared context. This |
79 // GLHelper will get destroyed whenever the shared context is lost | 79 // GLHelper will get destroyed whenever the shared context is lost |
80 // (ImageTransportFactoryObserver::OnLostResources is called). | 80 // (ImageTransportFactoryObserver::OnLostResources is called). |
81 virtual GLHelper* GetGLHelper() = 0; | 81 virtual GLHelper* GetGLHelper() = 0; |
82 | 82 |
83 virtual void AddObserver(ImageTransportFactoryObserver* observer) = 0; | 83 virtual void AddObserver(ImageTransportFactoryObserver* observer) = 0; |
84 virtual void RemoveObserver(ImageTransportFactoryObserver* observer) = 0; | 84 virtual void RemoveObserver(ImageTransportFactoryObserver* observer) = 0; |
85 | 85 |
86 #if defined(OS_MACOSX) | 86 #if defined(OS_MACOSX) |
87 virtual void OnSurfaceDisplayed(int surface_id) = 0; | 87 virtual void OnSurfaceDisplayed(int surface_id) = 0; |
88 // Called when the ui::Compositor has been disconnected from an NSView and | 88 // Called with |suspended| as true when the ui::Compositor has been |
89 // may be attached to another one. This ensures that content and frames | 89 // disconnected from an NSView and may be attached to another one. Called |
90 // intended for the old NSView will not appear in the new NSView. | 90 // with |suspended| as false after the ui::Compositor has been connected to |
91 virtual void OnCompositorRecycled(ui::Compositor* compositor) = 0; | 91 // a new NSView and the first commit targeted at the new NSView has |
| 92 // completed. This ensures that content and frames intended for the old |
| 93 // NSView will not flash in the new NSView. |
| 94 virtual void SetCompositorSuspendedForRecycle(ui::Compositor* compositor, |
| 95 bool suspended) = 0; |
92 // Used by GpuProcessHostUIShim to determine if a frame should not be | 96 // Used by GpuProcessHostUIShim to determine if a frame should not be |
93 // displayed because it is targetted to an NSView that has been disconnected. | 97 // displayed because it is targetted to an NSView that has been disconnected. |
94 virtual bool SurfaceShouldNotShowFramesAfterRecycle(int surface_id) const = 0; | 98 virtual bool SurfaceShouldNotShowFramesAfterSuspendForRecycle( |
| 99 int surface_id) const = 0; |
95 #endif | 100 #endif |
96 }; | 101 }; |
97 | 102 |
98 } // namespace content | 103 } // namespace content |
99 | 104 |
100 #endif // CONTENT_BROWSER_COMPOSITOR_IMAGE_TRANSPORT_FACTORY_H_ | 105 #endif // CONTENT_BROWSER_COMPOSITOR_IMAGE_TRANSPORT_FACTORY_H_ |
OLD | NEW |