diff --git a/modules/gui/qt/maininterface/qml/MainDisplay.qml b/modules/gui/qt/maininterface/qml/MainDisplay.qml index 0be5598c01d905b66f920f7fe6fabff90751bde1..4ff89a92b16adff4a7d5820356e70aae5060153f 100644 --- a/modules/gui/qt/maininterface/qml/MainDisplay.qml +++ b/modules/gui/qt/maininterface/qml/MainDisplay.qml @@ -266,6 +266,27 @@ FocusScope { leftMargin: VLCStyle.applicationHorizontalMargin } + // This item is the root of a large hierarchy + // which requires many batches to be rendered. + // When the miniPlayer effect is active, this + // item (source item) gets rendered in an offscreen + // surface. If we don't enable layer here, + // it (along with children) gets rendered again + // in the assigned window. + // If layer is enabled, instead of rendering one + // more time with many batches, a dynamic texture + // from the offscreen surface is used. This behavior + // reduces the amount of batches from 2x to x+1. + // A side effect is having to draw a large texture + // with blending on, but this must be cheaper redrawing + // all the batches. + // TODO: Reconsider this behavior when batching is optimized. + layer.enabled: miniPlayer.visible && miniPlayer.effectAvailable + + // Enable clipping so that the effect does not sit + // on top of the source. + clip: miniPlayer.visible && miniPlayer.effectAvailable + Loader { z: 1 anchors { diff --git a/modules/gui/qt/player/qml/MiniPlayer.qml b/modules/gui/qt/player/qml/MiniPlayer.qml index 1f5a0aeb8d8b5f9cd6399f7b155bb3ce92e1b79d..289052f64a80821822f3c951127b994ee00c9857 100644 --- a/modules/gui/qt/player/qml/MiniPlayer.qml +++ b/modules/gui/qt/player/qml/MiniPlayer.qml @@ -35,6 +35,7 @@ FocusScope { property alias effectSource: effect.source property alias effectSourceRect: effect.sourceRect + property alias effectAvailable: effect.effectAvailable state: (Player.playingState === Player.PLAYING_STATE_STOPPED) ? "" : "expanded"