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

Unified Diff: services/gfx/compositor/compositor_engine.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/compositor_engine.h ('k') | services/gfx/compositor/frame_dispatcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/gfx/compositor/compositor_engine.cc
diff --git a/services/gfx/compositor/compositor_engine.cc b/services/gfx/compositor/compositor_engine.cc
index aaf569eb341dbff1d1d8fb66b056ba6c1139714b..30d747332c51b17123333bb727a6c221004ec574 100644
--- a/services/gfx/compositor/compositor_engine.cc
+++ b/services/gfx/compositor/compositor_engine.cc
@@ -215,10 +215,12 @@ void CompositorEngine::Publish(
}
void CompositorEngine::ScheduleFrame(SceneState* scene_state,
- const SceneFrameCallback& callback) {
+ const FrameCallback& callback) {
DCHECK(IsSceneStateRegisteredDebug(scene_state));
+ DVLOG(1) << "ScheduleFrame: scene=" << scene_state;
- scene_state->AddSceneFrameCallback(callback);
+ if (!scene_state->frame_dispatcher().AddCallback(callback))
+ return;
// TODO(jeffbrown): Be more selective and do this work only for scenes
// which are strongly associated with the renderer so it doesn't receive
@@ -276,6 +278,18 @@ void CompositorEngine::ClearRootScene(RendererState* renderer_state) {
}
}
+void CompositorEngine::ScheduleFrame(RendererState* renderer_state,
+ const FrameCallback& callback) {
+ DCHECK(IsRendererStateRegisteredDebug(renderer_state));
+ DVLOG(1) << "ScheduleFrame: renderer=" << renderer_state;
+
+ if (!renderer_state->frame_dispatcher().AddCallback(callback))
+ return;
+
+ ScheduleFrameForRenderer(renderer_state,
+ Scheduler::SchedulingMode::kUpdateAndSnapshot);
+}
+
void CompositorEngine::HitTest(
RendererState* renderer_state,
mojo::PointFPtr point,
@@ -481,10 +495,12 @@ void CompositorEngine::OnOutputUpdateRequest(
return;
DCHECK(IsRendererStateRegisteredDebug(renderer_state));
+ renderer_state->frame_dispatcher().DispatchCallbacks(frame_info);
+
// TODO(jeffbrown): Be more selective and do this work only for scenes
// associated with the renderer.
for (auto& pair : scenes_by_token_) {
- pair.second->DispatchSceneFrameCallbacks(frame_info);
+ pair.second->frame_dispatcher().DispatchCallbacks(frame_info);
}
}
« no previous file with comments | « services/gfx/compositor/compositor_engine.h ('k') | services/gfx/compositor/frame_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698