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

Unified Diff: content/browser/renderer_host/render_widget_host_view_mac.h

Issue 423773002: Unified BeginFrame scheduling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_host_view_mac.h
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h
index 16368ff58b4cdc0aaaa2251a4bc6e8636ff3b102..e91118fa7f1fe206dbc5de47c8b9f10bd5992348 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.h
+++ b/content/browser/renderer_host/render_widget_host_view_mac.h
@@ -31,6 +31,7 @@
#include "third_party/WebKit/public/web/WebCompositionUnderline.h"
#include "ui/base/cocoa/base_view.h"
#include "ui/base/cocoa/remote_layer_api.h"
+#include "ui/base/compositor/compositor_begin_frame_observer.h"
#include "ui/gfx/display_observer.h"
struct ViewHostMsg_TextInputState_Params;
@@ -221,7 +222,9 @@ class CONTENT_EXPORT RenderWidgetHostViewMac
public IPC::Sender,
public SoftwareFrameManagerClient,
public CompositingIOSurfaceLayerClient,
- public gfx::DisplayObserver {
+ public gfx::DisplayObserver,
+ public DisplayLinkMac::Observer,
+ public ui::CompositorBeginFrameObserver {
public:
// The view will associate itself with the given widget. The native view must
// be hooked up immediately to the view hierarchy, or else when it is
@@ -359,6 +362,13 @@ class CONTENT_EXPORT RenderWidgetHostViewMac
virtual void OnDisplayMetricsChanged(const gfx::Display& display,
uint32_t metrics) OVERRIDE;
+ // DisplayLinkMac::Observer implementation.
+ virtual void OnVSync(base::TimeTicks timebase,
+ base::TimeDelta interval) OVERRIDE;
+
+ // ui::CompositorBeginFrameObserver implementation.
+ virtual void OnSendBeginFrame(const cc::BeginFrameArgs& args) OVERRIDE;
+
// Forwards the mouse event to the renderer.
void ForwardMouseEvent(const blink::WebMouseEvent& event);
@@ -582,8 +592,8 @@ class CONTENT_EXPORT RenderWidgetHostViewMac
// the OpenGL coordinate (lower-left origin) and scale for HiDPI displays.
gfx::Rect GetScaledOpenGLPixelRect(const gfx::Rect& rect);
- // Send updated vsync parameters to the renderer.
- void SendVSyncParametersToRenderer();
+ // Called when RenderWidget want to get BeginFrame message.
+ void OnSetNeedsBeginFrame(bool enabled);
brianderson 2014/09/04 18:45:46 Should this be grouped with OnSendBeginFrame?
// The associated view. This is weak and is inserted into the view hierarchy
// to own this RenderWidgetHostViewMac object. Set to nil at the start of the
@@ -632,6 +642,14 @@ class CONTENT_EXPORT RenderWidgetHostViewMac
// Subscriber that listens to frame presentation events.
scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_;
+ // True when corresponding RenderWidget needs BeginFrame.
+ bool needs_begin_frame_;
+
+ // Pass |last_begin_frame_args_| to BeginFrameManager when |this| is added
+ // as its observer. With this, BeginFrameManager can determine whether latest
+ // BeginFrameArgs is used immediately or not.
+ cc::BeginFrameArgs last_begin_frame_args_;
+
base::WeakPtrFactory<RenderWidgetHostViewMac>
software_frame_weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac);

Powered by Google App Engine
This is Rietveld 408576698