Merge master into branch

This commit is contained in:
Thomas Wilshaw
2020-08-17 18:42:58 +01:00
316 changed files with 13821 additions and 4934 deletions
+14 -32
View File
@@ -39,10 +39,6 @@
OLIVE_NAMESPACE_ENTER
#ifdef Q_OS_LINUX
bool ViewerDisplayWidget::nouveau_check_done_ = false;
#endif
ViewerDisplayWidget::ViewerDisplayWidget(QWidget *parent) :
ManagedDisplayWidget(parent),
signal_cursor_color_(false),
@@ -50,7 +46,8 @@ ViewerDisplayWidget::ViewerDisplayWidget(QWidget *parent) :
gizmo_click_(false),
last_loaded_buffer_(nullptr),
zoomed_(false),
hand_tool_clicked_(false)
hand_tool_clicked_(false),
deinterlace_(false)
{
connect(Core::instance(), &Core::ToolChanged, this, &ViewerDisplayWidget::ToolChanged);
// Initilises hand_tool_ based on currently selected tool.
@@ -139,6 +136,12 @@ void ViewerDisplayWidget::SetImage(FramePtr in_buffer)
update();
}
void ViewerDisplayWidget::SetDeinterlacing(bool e)
{
deinterlace_ = e;
update();
}
const ViewerSafeMarginInfo &ViewerDisplayWidget::GetSafeMargin() const
{
return safe_margin_;
@@ -321,21 +324,6 @@ void ViewerDisplayWidget::initializeGL()
ManagedDisplayWidget::initializeGL();
connect(context(), &QOpenGLContext::aboutToBeDestroyed, this, &ViewerDisplayWidget::ContextCleanup, Qt::DirectConnection);
#ifdef Q_OS_LINUX
if (!nouveau_check_done_) {
const char* vendor = reinterpret_cast<const char*>(context()->functions()->glGetString(GL_VENDOR));
if (!strcmp(vendor, "nouveau")) {
// Working with Qt widgets in this function segfaults, so we queue the messagebox for later
QMetaObject::invokeMethod(this,
"ShowNouveauWarning",
Qt::QueuedConnection);
}
nouveau_check_done_ = true;
}
#endif
}
void ViewerDisplayWidget::paintGL()
@@ -353,6 +341,12 @@ void ViewerDisplayWidget::paintGL()
// Bind retrieved texture
f->glBindTexture(GL_TEXTURE_2D, texture_.texture());
// Set some parameters
color_service()->pipeline()->bind();
color_service()->pipeline()->setUniformValue("ove_resolution", texture_.width(), texture_.height());
color_service()->pipeline()->setUniformValue("ove_deinterlace", deinterlace_);
color_service()->pipeline()->release();
// Blit using the color service
color_service()->ProcessOpenGL(true, GetCompleteMatrixFlippedYTranslation());
@@ -432,18 +426,6 @@ rational ViewerDisplayWidget::GetGizmoTime()
return GetAdjustedTime(GetTimeTarget(), gizmos_, time_, NodeParam::kInput);
}
#ifdef Q_OS_LINUX
void ViewerDisplayWidget::ShowNouveauWarning()
{
QMessageBox::warning(this,
tr("Driver Warning"),
tr("Olive has detected your system is using the Nouveau graphics driver.\n\nThis driver is "
"known to have stability and performance issues with Olive. It is highly recommended "
"you install the proprietary NVIDIA driver before continuing to use Olive."),
QMessageBox::Ok);
}
#endif
void ViewerDisplayWidget::ContextCleanup()
{
makeCurrent();