Added rendering of empty frame

This commit is contained in:
r.kuznetsov 2018-07-24 15:15:15 +03:00 committed by Roman Kuznetsov
parent cb090dc088
commit 5da10d8e7f
2 changed files with 19 additions and 0 deletions

View file

@ -1466,6 +1466,21 @@ void FrontendRenderer::RenderSearchMarksLayer(ScreenBase const & modelView)
RenderUserMarksLayer(modelView, RenderState::SearchMarkLayer);
}
void FrontendRenderer::RenderEmptyFrame(dp::OGLContext * context)
{
if (!context->validate())
return;
context->setDefaultFramebuffer();
auto const c = dp::Extract(drule::rules().GetBgColor(1 /* scale */), 0);
GLFunctions::glClearColor(c.GetRedF(), c.GetGreenF(), c.GetBlueF(), 1.0f);
m_viewport.Apply();
GLFunctions::glClear(gl_const::GLColorBit);
context->present();
}
void FrontendRenderer::BuildOverlayTree(ScreenBase const & modelView)
{
static std::vector<RenderState::DepthLayer> layers = {RenderState::OverlayLayer,
@ -1933,6 +1948,9 @@ void FrontendRenderer::OnContextCreate()
GLFunctions::Init(m_apiVersion);
// Render empty frame here to avoid black initialization screen.
RenderEmptyFrame(context);
GLFunctions::glPixelStore(gl_const::GLUnpackAlignment, 1);
GLFunctions::glClearDepthValue(1.0);

View file

@ -169,6 +169,7 @@ private:
void RenderRouteLayer(ScreenBase const & modelView);
void RenderSearchMarksLayer(ScreenBase const & modelView);
void RenderTransitBackground();
void RenderEmptyFrame(dp::OGLContext * context);
bool HasTransitRouteData() const;
bool HasRouteData() const;