Bug 1704227. r=gfx-reviewers,lsalzman

Differential Revision: https://phabricator.services.mozilla.com/D113191
This commit is contained in:
Andrew Osmond 2021-04-26 21:04:29 +00:00
Родитель 43e5d7e69f
Коммит 77a93b91d2
1 изменённых файлов: 15 добавлений и 10 удалений

Просмотреть файл

@ -1209,29 +1209,34 @@ void wr_notifier_external_event(mozilla::wr::WrWindowId aWindowId,
std::move(evt));
}
void wr_schedule_render(mozilla::wr::WrWindowId aWindowId) {
static void NotifyScheduleRender(mozilla::wr::WrWindowId aWindowId) {
RefPtr<mozilla::layers::CompositorBridgeParent> cbp = mozilla::layers::
CompositorBridgeParent::GetCompositorBridgeParentFromWindowId(aWindowId);
if (cbp) {
cbp->ScheduleRenderOnCompositorThread();
cbp->ScheduleComposition();
}
}
static void NotifyDidSceneBuild(RefPtr<layers::CompositorBridgeParent> aBridge,
void wr_schedule_render(mozilla::wr::WrWindowId aWindowId) {
layers::CompositorThread()->Dispatch(NewRunnableFunction(
"NotifyScheduleRender", &NotifyScheduleRender, aWindowId));
}
static void NotifyDidSceneBuild(mozilla::wr::WrWindowId aWindowId,
RefPtr<const wr::WebRenderPipelineInfo> aInfo) {
aBridge->NotifyDidSceneBuild(aInfo);
RefPtr<mozilla::layers::CompositorBridgeParent> cbp = mozilla::layers::
CompositorBridgeParent::GetCompositorBridgeParentFromWindowId(aWindowId);
if (cbp) {
cbp->NotifyDidSceneBuild(aInfo);
}
}
void wr_finished_scene_build(mozilla::wr::WrWindowId aWindowId,
mozilla::wr::WrPipelineInfo* aInfo) {
RefPtr<mozilla::layers::CompositorBridgeParent> cbp = mozilla::layers::
CompositorBridgeParent::GetCompositorBridgeParentFromWindowId(aWindowId);
RefPtr<wr::WebRenderPipelineInfo> info = new wr::WebRenderPipelineInfo();
info->Raw() = std::move(*aInfo);
if (cbp) {
layers::CompositorThread()->Dispatch(NewRunnableFunction(
"NotifyDidSceneBuild", &NotifyDidSceneBuild, cbp, info));
}
layers::CompositorThread()->Dispatch(NewRunnableFunction(
"NotifyDidSceneBuild", &NotifyDidSceneBuild, aWindowId, info));
}
} // extern C