| 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" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "cc/surfaces/surface_id_allocator.h" | 12 #include "cc/surfaces/surface_id_allocator.h" |
| 13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 14 #include "ui/events/latency_info.h" |
| 14 #include "ui/gfx/native_widget_types.h" | 15 #include "ui/gfx/native_widget_types.h" |
| 15 | 16 |
| 16 namespace cc { | 17 namespace cc { |
| 17 class SurfaceManager; | 18 class SurfaceManager; |
| 18 } | 19 } |
| 19 | 20 |
| 20 namespace gfx { | 21 namespace gfx { |
| 21 class Size; | 22 class Size; |
| 23 enum class SwapResult; |
| 22 } | 24 } |
| 23 | 25 |
| 24 namespace ui { | 26 namespace ui { |
| 25 class Compositor; | 27 class Compositor; |
| 26 class ContextFactory; | 28 class ContextFactory; |
| 27 class Texture; | 29 class Texture; |
| 28 } | 30 } |
| 29 | 31 |
| 30 namespace blink { | 32 namespace blink { |
| 31 class WebGraphicsContext3D; | 33 class WebGraphicsContext3D; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 78 |
| 77 // Gets a GLHelper instance, associated with the shared context. This | 79 // Gets a GLHelper instance, associated with the shared context. This |
| 78 // GLHelper will get destroyed whenever the shared context is lost | 80 // GLHelper will get destroyed whenever the shared context is lost |
| 79 // (ImageTransportFactoryObserver::OnLostResources is called). | 81 // (ImageTransportFactoryObserver::OnLostResources is called). |
| 80 virtual GLHelper* GetGLHelper() = 0; | 82 virtual GLHelper* GetGLHelper() = 0; |
| 81 | 83 |
| 82 virtual void AddObserver(ImageTransportFactoryObserver* observer) = 0; | 84 virtual void AddObserver(ImageTransportFactoryObserver* observer) = 0; |
| 83 virtual void RemoveObserver(ImageTransportFactoryObserver* observer) = 0; | 85 virtual void RemoveObserver(ImageTransportFactoryObserver* observer) = 0; |
| 84 | 86 |
| 85 #if defined(OS_MACOSX) | 87 #if defined(OS_MACOSX) |
| 86 virtual void OnSurfaceDisplayed(int surface_id) = 0; | 88 virtual void OnGpuSwapBuffersCompleted( |
| 89 int surface_id, |
| 90 const std::vector<ui::LatencyInfo>& latency_info, |
| 91 gfx::SwapResult result) = 0; |
| 92 |
| 87 // Called with |suspended| as true when the ui::Compositor has been | 93 // Called with |suspended| as true when the ui::Compositor has been |
| 88 // disconnected from an NSView and may be attached to another one. Called | 94 // disconnected from an NSView and may be attached to another one. Called |
| 89 // with |suspended| as false after the ui::Compositor has been connected to | 95 // with |suspended| as false after the ui::Compositor has been connected to |
| 90 // a new NSView and the first commit targeted at the new NSView has | 96 // a new NSView and the first commit targeted at the new NSView has |
| 91 // completed. This ensures that content and frames intended for the old | 97 // completed. This ensures that content and frames intended for the old |
| 92 // NSView will not flash in the new NSView. | 98 // NSView will not flash in the new NSView. |
| 93 virtual void SetCompositorSuspendedForRecycle(ui::Compositor* compositor, | 99 virtual void SetCompositorSuspendedForRecycle(ui::Compositor* compositor, |
| 94 bool suspended) = 0; | 100 bool suspended) = 0; |
| 95 // Used by GpuProcessHostUIShim to determine if a frame should not be | 101 // Used by GpuProcessHostUIShim to determine if a frame should not be |
| 96 // displayed because it is targetted to an NSView that has been disconnected. | 102 // displayed because it is targetted to an NSView that has been disconnected. |
| 97 virtual bool SurfaceShouldNotShowFramesAfterSuspendForRecycle( | 103 virtual bool SurfaceShouldNotShowFramesAfterSuspendForRecycle( |
| 98 int surface_id) const = 0; | 104 int surface_id) const = 0; |
| 99 #endif | 105 #endif |
| 100 }; | 106 }; |
| 101 | 107 |
| 102 } // namespace content | 108 } // namespace content |
| 103 | 109 |
| 104 #endif // CONTENT_BROWSER_COMPOSITOR_IMAGE_TRANSPORT_FACTORY_H_ | 110 #endif // CONTENT_BROWSER_COMPOSITOR_IMAGE_TRANSPORT_FACTORY_H_ |
| OLD | NEW |