Commit bf278e5d authored by Val Doroshchuk's avatar Val Doroshchuk

QSG_VIDEOOUTPUT_PUNCH_HOLE

parent dd047492
......@@ -39,10 +39,10 @@
#include "qtransparentvideobackend.h"
#include <private/qdeclarativevideooutput_p.h>
#include <private/qdeclarativevideooutput_render_p.h>
#include <private/qquickwindow_p.h>
#include <private/qsgadaptationlayer_p.h>
#include <private/qdeclarativevideooutput_p.h>
class QTransparentVideoRendererBackend : public QDeclarativeVideoRendererBackend
{
......@@ -65,7 +65,8 @@ void QTransparentVideoRendererBackend::itemChange(QQuickItem::ItemChange change,
if (!changeData.window)
return;
m_context = static_cast<QQuickWindowPrivate *>(QObjectPrivate::get(changeData.window))->context->sceneGraphContext();
if (!m_context)
m_context = static_cast<QQuickWindowPrivate *>(QObjectPrivate::get(changeData.window))->context->sceneGraphContext();
QSurfaceFormat fmt = changeData.window->requestedFormat();
if (fmt.alphaBufferSize() != 8) {
......@@ -94,5 +95,7 @@ QSGNode *QTransparentVideoRendererBackend::updatePaintNode(QSGNode *oldNode,
QDeclarativeVideoBackend *QTransparentVideoNodeBackend::create(QDeclarativeVideoOutput *parent)
{
return parent->punchHole() ? new QTransparentVideoRendererBackend(parent) : nullptr;
static QByteArray punch = qgetenv("QSG_VIDEOOUTPUT_PUNCH_HOLE");
static bool hole = (punch == "1" || punch == "true");
return hole ? new QTransparentVideoRendererBackend(parent) : nullptr;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment