mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-02-16 02:30:52 +00:00
Remove superfluous Session checks in prepareToRender()
prepareToRender() is only called with a live Session.
This commit is contained in:
@@ -297,17 +297,8 @@ void DrmRenderer::prepareToRender()
|
||||
// can get spurious SDL_WINDOWEVENT events that will cause us to (again) recreate our
|
||||
// renderer. This can lead to an infinite to renderer recreation, so discard all
|
||||
// SDL_WINDOWEVENT events after SDL_CreateRenderer().
|
||||
Session* session = Session::get();
|
||||
if (session != nullptr) {
|
||||
// If we get here during a session, we need to synchronize with the event loop
|
||||
// to ensure we don't drop any important events.
|
||||
session->flushWindowEvents();
|
||||
}
|
||||
else {
|
||||
// If we get here prior to the start of a session, just pump and flush ourselves.
|
||||
SDL_PumpEvents();
|
||||
SDL_FlushEvent(SDL_WINDOWEVENT);
|
||||
}
|
||||
SDL_assert(Session::get());
|
||||
Session::get()->flushWindowEvents();
|
||||
|
||||
SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE);
|
||||
SDL_RenderClear(renderer);
|
||||
|
||||
@@ -77,17 +77,8 @@ void MmalRenderer::prepareToRender()
|
||||
// can get spurious SDL_WINDOWEVENT events that will cause us to (again) recreate our
|
||||
// renderer. This can lead to an infinite to renderer recreation, so discard all
|
||||
// SDL_WINDOWEVENT events after SDL_CreateRenderer().
|
||||
Session* session = Session::get();
|
||||
if (session != nullptr) {
|
||||
// If we get here during a session, we need to synchronize with the event loop
|
||||
// to ensure we don't drop any important events.
|
||||
session->flushWindowEvents();
|
||||
}
|
||||
else {
|
||||
// If we get here prior to the start of a session, just pump and flush ourselves.
|
||||
SDL_PumpEvents();
|
||||
SDL_FlushEvent(SDL_WINDOWEVENT);
|
||||
}
|
||||
SDL_assert(Session::get());
|
||||
Session::get()->flushWindowEvents();
|
||||
|
||||
SDL_SetRenderDrawColor(m_BackgroundRenderer, 0, 0, 0, SDL_ALPHA_OPAQUE);
|
||||
SDL_RenderClear(m_BackgroundRenderer);
|
||||
|
||||
Reference in New Issue
Block a user