From bf39f1038141df4f5c507f332ed2116e78ecc5cd Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 16 May 2021 17:43:18 +0200 Subject: [PATCH] Optimized by skipping some unnecessary rendering when the media viewer is active. --- es-core/src/Window.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/es-core/src/Window.cpp b/es-core/src/Window.cpp index bab3ce712..79b9c9196 100644 --- a/es-core/src/Window.cpp +++ b/es-core/src/Window.cpp @@ -339,11 +339,22 @@ void Window::render() bottom->stopAllAnimations(); } - // Don't render the system view or gamelist view if the video or slideshow screensaver - // is running, unless the fallback screensaver is active due to lack of images or videos. - if ((mRenderScreensaver && mScreensaver->isFallbackScreensaver()) || - (!(mRenderScreensaver && (Settings::getInstance()->getString("ScreensaverType") == - "video" || Settings::getInstance()->getString("ScreensaverType") == "slideshow")))) + // Don't render the system view or gamelist view if the media viewer is active or if the + // video or slideshow screensaver is running. The exception is if the fallback screensaver + // is active due to a lack of videos or images. + bool renderBottom = true; + if (mRenderMediaViewer) + renderBottom = false; + else if (mRenderScreensaver && mScreensaver->isFallbackScreensaver()) + renderBottom = true; + else if (mRenderScreensaver && + Settings::getInstance()->getString("ScreensaverType") == "video") + renderBottom = false; + else if (mRenderScreensaver && + Settings::getInstance()->getString("ScreensaverType") == "slideshow") + renderBottom = false; + + if (renderBottom) bottom->render(transform); if (bottom != top) {