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

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

Issue 423773002: Unified BeginFrame scheduling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 2 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 <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 10 matching lines...) Expand all
21 #include "content/browser/compositor/image_transport_factory.h" 21 #include "content/browser/compositor/image_transport_factory.h"
22 #include "content/browser/compositor/owned_mailbox.h" 22 #include "content/browser/compositor/owned_mailbox.h"
23 #include "content/browser/renderer_host/render_widget_host_view_base.h" 23 #include "content/browser/renderer_host/render_widget_host_view_base.h"
24 #include "content/common/content_export.h" 24 #include "content/common/content_export.h"
25 #include "content/common/cursors/webcursor.h" 25 #include "content/common/cursors/webcursor.h"
26 #include "third_party/skia/include/core/SkRegion.h" 26 #include "third_party/skia/include/core/SkRegion.h"
27 #include "ui/aura/client/cursor_client_observer.h" 27 #include "ui/aura/client/cursor_client_observer.h"
28 #include "ui/aura/client/focus_change_observer.h" 28 #include "ui/aura/client/focus_change_observer.h"
29 #include "ui/aura/window_delegate.h" 29 #include "ui/aura/window_delegate.h"
30 #include "ui/aura/window_tree_host_observer.h" 30 #include "ui/aura/window_tree_host_observer.h"
31 #include "ui/base/compositor/compositor_begin_frame_observer.h"
31 #include "ui/base/ime/text_input_client.h" 32 #include "ui/base/ime/text_input_client.h"
32 #include "ui/gfx/display_observer.h" 33 #include "ui/gfx/display_observer.h"
33 #include "ui/gfx/insets.h" 34 #include "ui/gfx/insets.h"
34 #include "ui/gfx/rect.h" 35 #include "ui/gfx/rect.h"
35 #include "ui/wm/public/activation_change_observer.h" 36 #include "ui/wm/public/activation_change_observer.h"
36 #include "ui/wm/public/activation_delegate.h" 37 #include "ui/wm/public/activation_delegate.h"
37 38
38 struct ViewHostMsg_TextInputState_Params; 39 struct ViewHostMsg_TextInputState_Params;
39 40
40 namespace aura { 41 namespace aura {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 : public RenderWidgetHostViewBase, 82 : public RenderWidgetHostViewBase,
82 public DelegatedFrameHostClient, 83 public DelegatedFrameHostClient,
83 public ui::TextInputClient, 84 public ui::TextInputClient,
84 public gfx::DisplayObserver, 85 public gfx::DisplayObserver,
85 public aura::WindowTreeHostObserver, 86 public aura::WindowTreeHostObserver,
86 public aura::WindowDelegate, 87 public aura::WindowDelegate,
87 public aura::client::ActivationDelegate, 88 public aura::client::ActivationDelegate,
88 public aura::client::ActivationChangeObserver, 89 public aura::client::ActivationChangeObserver,
89 public aura::client::FocusChangeObserver, 90 public aura::client::FocusChangeObserver,
90 public aura::client::CursorClientObserver, 91 public aura::client::CursorClientObserver,
92 public ui::CompositorBeginFrameObserver,
91 public base::SupportsWeakPtr<RenderWidgetHostViewAura> { 93 public base::SupportsWeakPtr<RenderWidgetHostViewAura> {
92 public: 94 public:
93 // Displays and controls touch editing elements such as selection handles. 95 // Displays and controls touch editing elements such as selection handles.
94 class TouchEditingClient { 96 class TouchEditingClient {
95 public: 97 public:
96 TouchEditingClient() {} 98 TouchEditingClient() {}
97 99
98 // Tells the client to start showing touch editing handles. 100 // Tells the client to start showing touch editing handles.
99 virtual void StartTouchEditing() = 0; 101 virtual void StartTouchEditing() = 0;
100 102
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 virtual bool IsSurfaceAvailableForCopy() const OVERRIDE; 150 virtual bool IsSurfaceAvailableForCopy() const OVERRIDE;
149 virtual void Show() OVERRIDE; 151 virtual void Show() OVERRIDE;
150 virtual void Hide() OVERRIDE; 152 virtual void Hide() OVERRIDE;
151 virtual bool IsShowing() OVERRIDE; 153 virtual bool IsShowing() OVERRIDE;
152 virtual gfx::Rect GetViewBounds() const OVERRIDE; 154 virtual gfx::Rect GetViewBounds() const OVERRIDE;
153 virtual void SetBackgroundOpaque(bool opaque) OVERRIDE; 155 virtual void SetBackgroundOpaque(bool opaque) OVERRIDE;
154 virtual gfx::Size GetVisibleViewportSize() const OVERRIDE; 156 virtual gfx::Size GetVisibleViewportSize() const OVERRIDE;
155 virtual void SetInsets(const gfx::Insets& insets) OVERRIDE; 157 virtual void SetInsets(const gfx::Insets& insets) OVERRIDE;
156 158
157 // Overridden from RenderWidgetHostViewBase: 159 // Overridden from RenderWidgetHostViewBase:
160 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
158 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, 161 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view,
159 const gfx::Rect& pos) OVERRIDE; 162 const gfx::Rect& pos) OVERRIDE;
160 virtual void InitAsFullscreen( 163 virtual void InitAsFullscreen(
161 RenderWidgetHostView* reference_host_view) OVERRIDE; 164 RenderWidgetHostView* reference_host_view) OVERRIDE;
162 virtual void WasShown() OVERRIDE; 165 virtual void WasShown() OVERRIDE;
163 virtual void WasHidden() OVERRIDE; 166 virtual void WasHidden() OVERRIDE;
164 virtual void MovePluginWindows( 167 virtual void MovePluginWindows(
165 const std::vector<WebPluginGeometry>& moves) OVERRIDE; 168 const std::vector<WebPluginGeometry>& moves) OVERRIDE;
166 virtual void Focus() OVERRIDE; 169 virtual void Focus() OVERRIDE;
167 virtual void Blur() OVERRIDE; 170 virtual void Blur() OVERRIDE;
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 virtual void OnCursorVisibilityChanged(bool is_visible) OVERRIDE; 320 virtual void OnCursorVisibilityChanged(bool is_visible) OVERRIDE;
318 321
319 // Overridden from aura::client::FocusChangeObserver: 322 // Overridden from aura::client::FocusChangeObserver:
320 virtual void OnWindowFocused(aura::Window* gained_focus, 323 virtual void OnWindowFocused(aura::Window* gained_focus,
321 aura::Window* lost_focus) OVERRIDE; 324 aura::Window* lost_focus) OVERRIDE;
322 325
323 // Overridden from aura::WindowTreeHostObserver: 326 // Overridden from aura::WindowTreeHostObserver:
324 virtual void OnHostMoved(const aura::WindowTreeHost* host, 327 virtual void OnHostMoved(const aura::WindowTreeHost* host,
325 const gfx::Point& new_origin) OVERRIDE; 328 const gfx::Point& new_origin) OVERRIDE;
326 329
330 // Overridden from ui::CompositorBeginFrameObserver:
331 virtual void OnSendBeginFrame(const cc::BeginFrameArgs& args) OVERRIDE;
332
327 #if defined(OS_WIN) 333 #if defined(OS_WIN)
328 // Sets the cutout rects from constrained windows. These are rectangles that 334 // Sets the cutout rects from constrained windows. These are rectangles that
329 // windowed NPAPI plugins shouldn't paint in. Overwrites any previous cutout 335 // windowed NPAPI plugins shouldn't paint in. Overwrites any previous cutout
330 // rects. 336 // rects.
331 void UpdateConstrainedWindowRects(const std::vector<gfx::Rect>& rects); 337 void UpdateConstrainedWindowRects(const std::vector<gfx::Rect>& rects);
332 338
333 // Updates the cursor clip region. Used for mouse locking. 339 // Updates the cursor clip region. Used for mouse locking.
334 void UpdateMouseLockRegion(); 340 void UpdateMouseLockRegion();
335 341
336 // Notification that the LegacyRenderWidgetHostHWND was destroyed. 342 // Notification that the LegacyRenderWidgetHostHWND was destroyed.
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 470
465 // Converts |rect| from window coordinate to screen coordinate. 471 // Converts |rect| from window coordinate to screen coordinate.
466 gfx::Rect ConvertRectToScreen(const gfx::Rect& rect) const; 472 gfx::Rect ConvertRectToScreen(const gfx::Rect& rect) const;
467 473
468 // Converts |rect| from screen coordinate to window coordinate. 474 // Converts |rect| from screen coordinate to window coordinate.
469 gfx::Rect ConvertRectFromScreen(const gfx::Rect& rect) const; 475 gfx::Rect ConvertRectFromScreen(const gfx::Rect& rect) const;
470 476
471 // Helper function to set keyboard focus to the main window. 477 // Helper function to set keyboard focus to the main window.
472 void SetKeyboardFocus(); 478 void SetKeyboardFocus();
473 479
480 // Called when RenderWidget want to start BeginFrame scheduling or stop.
481 void OnSetNeedsBeginFrame(bool enabled);
482
474 RenderFrameHostImpl* GetFocusedFrame(); 483 RenderFrameHostImpl* GetFocusedFrame();
475 484
476 // The model object. 485 // The model object.
477 RenderWidgetHostImpl* host_; 486 RenderWidgetHostImpl* host_;
478 487
479 aura::Window* window_; 488 aura::Window* window_;
480 489
481 scoped_ptr<DelegatedFrameHost> delegated_frame_host_; 490 scoped_ptr<DelegatedFrameHost> delegated_frame_host_;
482 491
483 scoped_ptr<WindowObserver> window_observer_; 492 scoped_ptr<WindowObserver> window_observer_;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 617
609 // The last scroll offset of the view. 618 // The last scroll offset of the view.
610 gfx::Vector2dF last_scroll_offset_; 619 gfx::Vector2dF last_scroll_offset_;
611 620
612 gfx::Insets insets_; 621 gfx::Insets insets_;
613 622
614 std::vector<ui::LatencyInfo> software_latency_info_; 623 std::vector<ui::LatencyInfo> software_latency_info_;
615 624
616 scoped_ptr<aura::client::ScopedTooltipDisabler> tooltip_disabler_; 625 scoped_ptr<aura::client::ScopedTooltipDisabler> tooltip_disabler_;
617 626
627 // True when RenderWidget needs a BeginFrame.
628 bool needs_begin_frame_;
629
630 // True when unified BeginFrame scheduling is used.
631 bool begin_frame_scheduling_is_enabled_;
632
633 // Pass |last_begin_frame_args_| to BeginFrameManager when |this| is added
634 // as its observer. With this, BeginFrameManager can determine whether latest
635 // BeginFrameArgs is used immediately or not.
636 cc::BeginFrameArgs last_begin_frame_args_;
637
618 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_; 638 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_;
619 639
620 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); 640 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura);
621 }; 641 };
622 642
623 } // namespace content 643 } // namespace content
624 644
625 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ 645 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698