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

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

Issue 548153004: Unified BeginFrame scheduling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git cl format 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 fa84570a1fbf5daa61320b5fccd4b671b75a9a13..e539387b6722730d78302eca7f79b9952119ce55 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;
@@ -207,7 +208,11 @@ class CONTENT_EXPORT RenderWidgetHostViewMac
public DelegatedFrameHostClient,
public BrowserCompositorViewMacClient,
public IPC::Sender,
- public gfx::DisplayObserver {
+ public SoftwareFrameManagerClient,
+ public CompositingIOSurfaceLayerClient,
+ 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
@@ -336,6 +341,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);
@@ -465,8 +477,8 @@ class CONTENT_EXPORT RenderWidgetHostViewMac
void OnStartPluginIme();
void OnGetRenderedTextCompleted(const std::string& text);
- // Send updated vsync parameters to the renderer.
- void SendVSyncParametersToRenderer();
+ // Called when RenderWidget want to get BeginFrame message.
+ void OnSetNeedsBeginFrame(bool enabled);
// Dispatches a TTS session.
void SpeakText(const std::string& text);
@@ -518,6 +530,19 @@ class CONTENT_EXPORT RenderWidgetHostViewMac
// The current caret bounds.
gfx::Rect caret_rect_;
+ // 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