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

Unified Diff: services/gfx/compositor/renderer_impl.cc

Issue 1997513002: Mozart: Generalize frame scheduling. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-jank2
Patch Set: add comments Created 4 years, 7 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
« no previous file with comments | « services/gfx/compositor/renderer_impl.h ('k') | services/gfx/compositor/renderer_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/gfx/compositor/renderer_impl.cc
diff --git a/services/gfx/compositor/renderer_impl.cc b/services/gfx/compositor/renderer_impl.cc
index 1a0357a0a3d52c3146168c3d1cb28fade8ad715b..547449c02dc6467d6bb0248c740d4d8e9d95bdc4 100644
--- a/services/gfx/compositor/renderer_impl.cc
+++ b/services/gfx/compositor/renderer_impl.cc
@@ -8,6 +8,13 @@
#include "base/bind_helpers.h"
namespace compositor {
+namespace {
+void RunScheduleFrameCallback(
+ const RendererImpl::ScheduleFrameCallback& callback,
+ mojo::gfx::composition::FrameInfoPtr info) {
+ callback.Run(info.Pass());
+}
+} // namespace
RendererImpl::RendererImpl(
CompositorEngine* engine,
@@ -37,6 +44,17 @@ void RendererImpl::ClearRootScene() {
engine_->ClearRootScene(state_);
}
+void RendererImpl::GetScheduler(
+ mojo::InterfaceRequest<mojo::gfx::composition::FrameScheduler>
+ scheduler_request) {
+ scheduler_bindings_.AddBinding(this, scheduler_request.Pass());
+}
+
+void RendererImpl::ScheduleFrame(const ScheduleFrameCallback& callback) {
+ engine_->ScheduleFrame(state_,
+ base::Bind(&RunScheduleFrameCallback, callback));
+}
+
void RendererImpl::HitTest(mojo::PointFPtr point,
const HitTestCallback& callback) {
engine_->HitTest(state_, point.Pass(), callback);
« no previous file with comments | « services/gfx/compositor/renderer_impl.h ('k') | services/gfx/compositor/renderer_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698