зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1432309 - ensure the GL context is current when updating wr. r=sotaro
To avoid future issues, this is done by combining the Render and Update methods into a single call. As a minor side-effect, timing in the parent method now includes the time to run update. MozReview-Commit-ID: GJ0l049eFRj --HG-- extra : rebase_source : f9b4ee6f34bc45d87b3df40e5a25f3bfb2ec8068
This commit is contained in:
Родитель
3cbbdda385
Коммит
291824030e
|
@ -220,11 +220,9 @@ RenderThread::UpdateAndRender(wr::WindowId aWindowId)
|
|||
}
|
||||
|
||||
auto& renderer = it->second;
|
||||
renderer->Update();
|
||||
|
||||
TimeStamp start = TimeStamp::Now();
|
||||
|
||||
bool ret = renderer->Render();
|
||||
bool ret = renderer->UpdateAndRender();
|
||||
if (!ret) {
|
||||
// Render did not happen, do not call NotifyDidRender.
|
||||
return;
|
||||
|
|
|
@ -81,14 +81,8 @@ RendererOGL::GetExternalImageHandler()
|
|||
};
|
||||
}
|
||||
|
||||
void
|
||||
RendererOGL::Update()
|
||||
{
|
||||
wr_renderer_update(mRenderer);
|
||||
}
|
||||
|
||||
bool
|
||||
RendererOGL::Render()
|
||||
RendererOGL::UpdateAndRender()
|
||||
{
|
||||
uint32_t flags = gfx::gfxVars::WebRenderDebugFlags();
|
||||
|
||||
|
@ -117,6 +111,8 @@ RendererOGL::Render()
|
|||
return false;
|
||||
}
|
||||
|
||||
wr_renderer_update(mRenderer);
|
||||
|
||||
auto size = mCompositor->GetClientSize();
|
||||
|
||||
if (!wr_renderer_render(mRenderer, size.width, size.height)) {
|
||||
|
|
|
@ -50,10 +50,7 @@ public:
|
|||
wr::WrExternalImageHandler GetExternalImageHandler();
|
||||
|
||||
/// This can be called on the render thread only.
|
||||
void Update();
|
||||
|
||||
/// This can be called on the render thread only.
|
||||
bool Render();
|
||||
bool UpdateAndRender();
|
||||
|
||||
/// This can be called on the render thread only.
|
||||
bool RenderToTarget(gfx::DrawTarget& aTarget);
|
||||
|
|
Загрузка…
Ссылка в новой задаче