Chromium Code Reviews| Index: content/browser/renderer_host/render_widget_host_view_aura.h |
| diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h |
| index 70d244f43ec88b2ca9a0f63c98f8571270d4adba..ce502f5126e8a5b707071dcef63244b55c251eca 100644 |
| --- a/content/browser/renderer_host/render_widget_host_view_aura.h |
| +++ b/content/browser/renderer_host/render_widget_host_view_aura.h |
| @@ -12,6 +12,7 @@ |
| #include "base/gtest_prod_util.h" |
| #include "base/memory/linked_ptr.h" |
| #include "base/memory/ref_counted.h" |
| +#include "base/memory/scoped_ptr.h" |
| #include "base/memory/weak_ptr.h" |
| #include "content/browser/renderer_host/image_transport_factory.h" |
| #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| @@ -120,7 +121,8 @@ class RenderWidgetHostViewAura |
| virtual void AcceleratedSurfaceNew( |
| int32 width_in_pixel, |
| int32 height_in_pixel, |
| - uint64 surface_id) OVERRIDE; |
| + uint64 surface_id, |
| + const std::vector<signed char>& mailbox_name) OVERRIDE; |
| virtual void AcceleratedSurfaceRelease(uint64 surface_id) OVERRIDE; |
| virtual void GetScreenInfo(WebKit::WebScreenInfo* results) OVERRIDE; |
| virtual gfx::Rect GetBoundsInRootWindow() OVERRIDE; |
| @@ -240,31 +242,26 @@ class RenderWidgetHostViewAura |
| bool ShouldMoveToCenter(); |
| // Run the compositing callbacks. |
| - void RunCompositingDidCommitCallbacks(ui::Compositor* compositor); |
| - void RunCompositingWillStartCallbacks(ui::Compositor* compositor); |
| + void RunCompositingDidCommitCallbacks(); |
| + void RunCompositingWillStartCallbacks(); |
| // Insert a sync point into the compositor's command stream and acknowledge |
| // that we have presented the accelerated surface buffer. |
| static void InsertSyncPointAndACK(int32 route_id, |
| int gpu_host_id, |
| - ui::Compositor* compositor); |
| + scoped_refptr<ui::Texture> texture); |
| // Called when window_ is removed from the window tree. |
| void RemovingFromRootWindow(); |
| - // After clearing |current_surface_|, and waiting for the compositor to finish |
| - // using it, call this to inform the gpu process. |
| - void SetSurfaceNotInUseByCompositor(ui::Compositor* compositor); |
| + // Called after commit for the last reference to the texture going away |
| + // after it was released as the frontbuffer. |
| + void SetSurfaceNotInUseByCompositor(scoped_refptr<ui::Texture>); |
| - // This is called every time |current_surface_| usage changes (by thumbnailer, |
| - // compositor draws, and tab visibility). Every time usage of current surface |
| - // changes between "may be used" and "certain to not be used" by the ui, we |
| - // inform the gpu process. |
| - void AdjustSurfaceProtection(); |
| - |
| - // Called after async thumbnailer task completes. Used to call |
| - // AdjustSurfaceProtection. |
| + // Called after async thumbnailer task completes. |
| + // Holds a reference to the texture through the bound argument. |
| void CopyFromCompositingSurfaceFinished(base::Callback<void(bool)> callback, |
| + scoped_refptr<ui::Texture>, |
| bool result); |
| ui::Compositor* GetCompositor(); |
| @@ -275,6 +272,10 @@ class RenderWidgetHostViewAura |
| // Converts |rect| from window coordinate to screen coordinate. |
| gfx::Rect ConvertRectToScreen(const gfx::Rect& rect); |
| + void SwapBuffersBegin(const gfx::Size& surface_size); |
| + void SwapBuffersCompleted(int gpu_host_id, |
| + int route_id, |
| + scoped_refptr<ui::Texture> pending_surface); |
| // The model object. |
| RenderWidgetHostImpl* host_; |
| @@ -327,31 +328,20 @@ class RenderWidgetHostViewAura |
| // The scale factor of the display the renderer is currently on. |
| float device_scale_factor_; |
| - std::vector< base::Callback<void(ui::Compositor*)> > |
| - on_compositing_did_commit_callbacks_; |
| + std::vector<base::Closure> on_compositing_did_commit_callbacks_; |
| - std::vector< base::Callback<void(ui::Compositor*)> > |
| - on_compositing_will_start_callbacks_; |
| + std::vector<base::Closure> on_compositing_will_start_callbacks_; |
| - std::map<uint64, scoped_refptr<ui::Texture> > |
| - image_transport_clients_; |
| + // The current frontbuffer |
| + scoped_refptr<ui::Texture> current_surface_; |
| - uint64 current_surface_; |
| + // The buffer pending to become our new frontbuffer during a swap |
|
no sievers
2012/11/02 01:29:14
Actually this is the previous one, the one to be r
|
| + scoped_refptr<ui::Texture> pending_surface_; |
| - // Protected means that the |current_surface_| may be in use by ui and cannot |
| - // be safely discarded. Things to consider are thumbnailer, compositor draw, |
| - // and tab visibility. |
| - bool current_surface_is_protected_; |
| - bool current_surface_in_use_by_compositor_; |
| + std::vector<signed char> mailbox_name_; |
| std::vector<base::Callback<void(bool)> > pending_thumbnail_tasks_; |
| - // This id increments every time surface_is_protected changes. We tag IPC |
| - // messages which rely on protection state with this id to stay in sync. |
| - uint32 protection_state_id_; |
| - |
| - int32 surface_route_id_; |
| - |
| gfx::GLSurfaceHandle shared_surface_handle_; |
| // If non-NULL we're in OnPaint() and this is the supplied canvas. |