Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.h

Issue 10052018: Drop frontbuffers with ui-use-gpu-process, synchronized with browser, decoupled from backbuffer dro… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Storing the list of thumbnail callbacks, so that we can issue them upon RWHVA destruction. Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_
7 7
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/memory/linked_ptr.h" 12 #include "base/memory/linked_ptr.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/memory/weak_ptr.h"
14 #include "content/browser/renderer_host/image_transport_factory.h" 15 #include "content/browser/renderer_host/image_transport_factory.h"
15 #include "content/browser/renderer_host/render_widget_host_view_base.h" 16 #include "content/browser/renderer_host/render_widget_host_view_base.h"
16 #include "content/common/content_export.h" 17 #include "content/common/content_export.h"
17 #include "ui/aura/client/activation_delegate.h" 18 #include "ui/aura/client/activation_delegate.h"
18 #include "ui/aura/window_delegate.h" 19 #include "ui/aura/window_delegate.h"
19 #include "ui/base/ime/text_input_client.h" 20 #include "ui/base/ime/text_input_client.h"
20 #include "ui/compositor/compositor_observer.h" 21 #include "ui/compositor/compositor_observer.h"
21 #include "ui/gfx/rect.h" 22 #include "ui/gfx/rect.h"
22 #include "webkit/glue/webcursor.h" 23 #include "webkit/glue/webcursor.h"
23 24
(...skipping 18 matching lines...) Expand all
42 class RenderWidgetHostImpl; 43 class RenderWidgetHostImpl;
43 class RenderWidgetHostView; 44 class RenderWidgetHostView;
44 45
45 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. 46 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h.
46 class RenderWidgetHostViewAura 47 class RenderWidgetHostViewAura
47 : public RenderWidgetHostViewBase, 48 : public RenderWidgetHostViewBase,
48 public ui::CompositorObserver, 49 public ui::CompositorObserver,
49 public ui::TextInputClient, 50 public ui::TextInputClient,
50 public aura::WindowDelegate, 51 public aura::WindowDelegate,
51 public aura::client::ActivationDelegate, 52 public aura::client::ActivationDelegate,
52 public ImageTransportFactoryObserver { 53 public ImageTransportFactoryObserver,
54 public base::SupportsWeakPtr<RenderWidgetHostViewAura> {
53 public: 55 public:
54 // RenderWidgetHostView implementation. 56 // RenderWidgetHostView implementation.
55 virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE; 57 virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE;
56 virtual RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE; 58 virtual RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE;
57 virtual void SetSize(const gfx::Size& size) OVERRIDE; 59 virtual void SetSize(const gfx::Size& size) OVERRIDE;
58 virtual void SetBounds(const gfx::Rect& rect) OVERRIDE; 60 virtual void SetBounds(const gfx::Rect& rect) OVERRIDE;
59 virtual gfx::NativeView GetNativeView() const OVERRIDE; 61 virtual gfx::NativeView GetNativeView() const OVERRIDE;
60 virtual gfx::NativeViewId GetNativeViewId() const OVERRIDE; 62 virtual gfx::NativeViewId GetNativeViewId() const OVERRIDE;
61 virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE; 63 virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE;
62 virtual bool HasFocus() const OVERRIDE; 64 virtual bool HasFocus() const OVERRIDE;
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 234
233 // Insert a sync point into the compositor's command stream and acknowledge 235 // Insert a sync point into the compositor's command stream and acknowledge
234 // that we have presented the accelerated surface buffer. 236 // that we have presented the accelerated surface buffer.
235 static void InsertSyncPointAndACK(int32 route_id, 237 static void InsertSyncPointAndACK(int32 route_id,
236 int gpu_host_id, 238 int gpu_host_id,
237 ui::Compositor* compositor); 239 ui::Compositor* compositor);
238 240
239 // Called when window_ is removed from the window tree. 241 // Called when window_ is removed from the window tree.
240 void RemovingFromRootWindow(); 242 void RemovingFromRootWindow();
241 243
244 // After clearing |current_surface_|, and waiting for the compositor to finish
245 // using it, call this to inform the gpu process.
246 void SetSurfaceNotInUseByCompositor(ui::Compositor* compositor);
247
248 // This is called every time |current_surface_| usage changes (by thumbnailer,
249 // compositor draws, and tab visibility). Every time usage of current surface
250 // changes between "may be used" and "certain to not be used" by the ui, we
251 // inform the gpu process.
252 void AdjustSurfaceProtection();
253
254 // Called after async thumbnailer task completes. Used to call
255 // AdjustSurfaceProtection.
256 void CopyFromCompositingSurfaceFinished(base::Callback<void(bool)> callback,
257 bool result);
258
242 ui::Compositor* GetCompositor(); 259 ui::Compositor* GetCompositor();
243 260
244 // Detaches |this| from the input method object. 261 // Detaches |this| from the input method object.
245 void DetachFromInputMethod(); 262 void DetachFromInputMethod();
246 263
247 // Converts |rect| from window coordinate to screen coordinate. 264 // Converts |rect| from window coordinate to screen coordinate.
248 gfx::Rect ConvertRectToScreen(const gfx::Rect& rect); 265 gfx::Rect ConvertRectToScreen(const gfx::Rect& rect);
249 266
250 // The model object. 267 // The model object.
251 RenderWidgetHostImpl* host_; 268 RenderWidgetHostImpl* host_;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 on_compositing_did_commit_callbacks_; 317 on_compositing_did_commit_callbacks_;
301 318
302 std::vector< base::Callback<void(ui::Compositor*)> > 319 std::vector< base::Callback<void(ui::Compositor*)> >
303 on_compositing_will_start_callbacks_; 320 on_compositing_will_start_callbacks_;
304 321
305 std::map<uint64, scoped_refptr<ui::Texture> > 322 std::map<uint64, scoped_refptr<ui::Texture> >
306 image_transport_clients_; 323 image_transport_clients_;
307 324
308 uint64 current_surface_; 325 uint64 current_surface_;
309 326
327 // Protected means that the |current_surface_| may be in use by ui and cannot
328 // be safely discarded. Things to consider are thumbnailer, compositor draw,
329 // and tab visibility.
330 bool current_surface_is_protected_;
331 bool current_surface_in_use_by_compositor_;
332
333 std::vector<base::Callback<void(bool)> > pending_thumbnail_tasks_;
334
335 // This id increments every time surface_is_protected changes. We tag IPC
336 // messages which rely on protection state with this id to stay in sync.
337 uint32 protection_state_id_;
338
339 int32 surface_route_id_;
340
310 gfx::GLSurfaceHandle shared_surface_handle_; 341 gfx::GLSurfaceHandle shared_surface_handle_;
311 342
312 // If non-NULL we're in OnPaint() and this is the supplied canvas. 343 // If non-NULL we're in OnPaint() and this is the supplied canvas.
313 gfx::Canvas* paint_canvas_; 344 gfx::Canvas* paint_canvas_;
314 345
315 // Used to record the last position of the mouse. 346 // Used to record the last position of the mouse.
316 // While the mouse is locked, they store the last known position just as mouse 347 // While the mouse is locked, they store the last known position just as mouse
317 // lock was entered. 348 // lock was entered.
318 // Relative to the upper-left corner of the view. 349 // Relative to the upper-left corner of the view.
319 gfx::Point unlocked_mouse_position_; 350 gfx::Point unlocked_mouse_position_;
(...skipping 22 matching lines...) Expand all
342 373
343 // This lock is for waiting for a front surface to become available to draw. 374 // This lock is for waiting for a front surface to become available to draw.
344 scoped_refptr<aura::CompositorLock> released_front_lock_; 375 scoped_refptr<aura::CompositorLock> released_front_lock_;
345 376
346 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); 377 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura);
347 }; 378 };
348 379
349 } // namespace content 380 } // namespace content
350 381
351 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ 382 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698