viewerglwidget: fix bug that didn't clear the viewport correctly on empty frames
This commit is contained in:
@@ -38,7 +38,8 @@ bool ViewerGLWidget::nouveau_check_done_ = false;
|
|||||||
ViewerGLWidget::ViewerGLWidget(QWidget *parent) :
|
ViewerGLWidget::ViewerGLWidget(QWidget *parent) :
|
||||||
QOpenGLWidget(parent),
|
QOpenGLWidget(parent),
|
||||||
ocio_lut_(0),
|
ocio_lut_(0),
|
||||||
color_manager_(nullptr)
|
color_manager_(nullptr),
|
||||||
|
has_image_(false)
|
||||||
{
|
{
|
||||||
setContextMenuPolicy(Qt::CustomContextMenu);
|
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
}
|
}
|
||||||
@@ -78,6 +79,8 @@ void ViewerGLWidget::SetImage(const QString &fn)
|
|||||||
{
|
{
|
||||||
OIIO::ImageBuf* in;
|
OIIO::ImageBuf* in;
|
||||||
|
|
||||||
|
has_image_ = false;
|
||||||
|
|
||||||
if (fn.isEmpty()) {
|
if (fn.isEmpty()) {
|
||||||
// Backend had no filename
|
// Backend had no filename
|
||||||
goto end;
|
goto end;
|
||||||
@@ -109,6 +112,8 @@ void ViewerGLWidget::SetImage(const QString &fn)
|
|||||||
|
|
||||||
doneCurrent();
|
doneCurrent();
|
||||||
|
|
||||||
|
has_image_ = true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
qWarning() << "OIIO Error:" << OIIO::geterror().c_str();
|
qWarning() << "OIIO Error:" << OIIO::geterror().c_str();
|
||||||
}
|
}
|
||||||
@@ -201,7 +206,7 @@ void ViewerGLWidget::paintGL()
|
|||||||
f->glClear(GL_COLOR_BUFFER_BIT);
|
f->glClear(GL_COLOR_BUFFER_BIT);
|
||||||
|
|
||||||
// We only draw if we have a pipeline
|
// We only draw if we have a pipeline
|
||||||
if (!pipeline_ || !texture_.IsCreated()) {
|
if (!has_image_ || !pipeline_ || !texture_.IsCreated()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -195,6 +195,8 @@ private:
|
|||||||
static bool nouveau_check_done_;
|
static bool nouveau_check_done_;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
bool has_image_;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
/**
|
/**
|
||||||
* @brief Slot to connect just before the OpenGL context is destroyed to clean up resources
|
* @brief Slot to connect just before the OpenGL context is destroyed to clean up resources
|
||||||
|
|||||||
Reference in New Issue
Block a user