fixed viewer on wayland
This commit is contained in:
@@ -42,6 +42,7 @@ public:
|
|||||||
custom_shader_src_ = nullptr;
|
custom_shader_src_ = nullptr;
|
||||||
input_alpha_association_ = kAlphaNone;
|
input_alpha_association_ = kAlphaNone;
|
||||||
clear_destination_ = true;
|
clear_destination_ = true;
|
||||||
|
force_opaque_ = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ColorTransformJob(const NodeValueRow &row) :
|
ColorTransformJob(const NodeValueRow &row) :
|
||||||
@@ -95,6 +96,9 @@ public:
|
|||||||
const QString &GetFunctionName() const { return function_name_; }
|
const QString &GetFunctionName() const { return function_name_; }
|
||||||
void SetFunctionName(const QString &function_name = QString()) { function_name_ = function_name; };
|
void SetFunctionName(const QString &function_name = QString()) { function_name_ = function_name; };
|
||||||
|
|
||||||
|
bool GetForceOpaque() const { return force_opaque_; }
|
||||||
|
void SetForceOpaque(bool e) { force_opaque_ = e; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ColorProcessorPtr processor_;
|
ColorProcessorPtr processor_;
|
||||||
QString id_;
|
QString id_;
|
||||||
@@ -114,6 +118,8 @@ private:
|
|||||||
|
|
||||||
QString function_name_;
|
QString function_name_;
|
||||||
|
|
||||||
|
bool force_opaque_;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -296,6 +296,7 @@ void Renderer::BlitColorManaged(const ColorTransformJob &color_job, Texture *des
|
|||||||
job.Insert(QStringLiteral("ove_mvpmat"), NodeValue(NodeValue::kMatrix, color_job.GetTransformMatrix()));
|
job.Insert(QStringLiteral("ove_mvpmat"), NodeValue(NodeValue::kMatrix, color_job.GetTransformMatrix()));
|
||||||
job.Insert(QStringLiteral("ove_cropmatrix"), NodeValue(NodeValue::kMatrix, color_job.GetCropMatrix().inverted()));
|
job.Insert(QStringLiteral("ove_cropmatrix"), NodeValue(NodeValue::kMatrix, color_job.GetCropMatrix().inverted()));
|
||||||
job.Insert(QStringLiteral("ove_maintex_alpha"), NodeValue(NodeValue::kInt, int(color_job.GetInputAlphaAssociation())));
|
job.Insert(QStringLiteral("ove_maintex_alpha"), NodeValue(NodeValue::kInt, int(color_job.GetInputAlphaAssociation())));
|
||||||
|
job.Insert(QStringLiteral("ove_force_opaque"), NodeValue(NodeValue::kBoolean, color_job.GetForceOpaque()));
|
||||||
job.Insert(color_job.GetValues());
|
job.Insert(color_job.GetValues());
|
||||||
|
|
||||||
foreach (const ColorContext::LUT& l, color_ctx.lut3d_textures) {
|
foreach (const ColorContext::LUT& l, color_ctx.lut3d_textures) {
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ public:
|
|||||||
|
|
||||||
virtual void PostInit() = 0;
|
virtual void PostInit() = 0;
|
||||||
|
|
||||||
virtual void ClearDestination(olive::Texture *texture = nullptr, double r = 0.0, double g = 0.0, double b = 0.0, double a = 0.0) = 0;
|
virtual void ClearDestination(olive::Texture *texture = nullptr, double r = 0.0, double g = 0.0, double b = 0.0, double a = 1.0) = 0;
|
||||||
|
|
||||||
virtual QVariant CreateNativeShader(olive::ShaderCode code) = 0;
|
virtual QVariant CreateNativeShader(olive::ShaderCode code) = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
uniform sampler2D ove_maintex;
|
uniform sampler2D ove_maintex;
|
||||||
uniform int ove_maintex_alpha;
|
uniform int ove_maintex_alpha;
|
||||||
uniform mat4 ove_cropmatrix;
|
uniform mat4 ove_cropmatrix;
|
||||||
|
uniform bool ove_force_opaque;
|
||||||
|
|
||||||
// Macros defining `ove_maintex_alpha` state
|
// Macros defining `ove_maintex_alpha` state
|
||||||
// Matches `AlphaAssociated` C++ enum
|
// Matches `AlphaAssociated` C++ enum
|
||||||
@@ -53,5 +54,9 @@ void main() {
|
|||||||
col = assoc(col);
|
col = assoc(col);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ove_force_opaque) {
|
||||||
|
col.a = 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
frag_color = col;
|
frag_color = col;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ ManagedDisplayWidget::ManagedDisplayWidget(QWidget *parent) :
|
|||||||
if (RenderManager::instance()->backend() == RenderManager::kOpenGL) {
|
if (RenderManager::instance()->backend() == RenderManager::kOpenGL) {
|
||||||
// Create OpenGL widget
|
// Create OpenGL widget
|
||||||
inner_widget_ = new ManagedDisplayWidgetOpenGL();
|
inner_widget_ = new ManagedDisplayWidgetOpenGL();
|
||||||
|
inner_widget_->setAttribute(Qt::WA_TranslucentBackground, false);
|
||||||
connect(static_cast<ManagedDisplayWidgetOpenGL*>(inner_widget_),
|
connect(static_cast<ManagedDisplayWidgetOpenGL*>(inner_widget_),
|
||||||
&ManagedDisplayWidgetOpenGL::OnInit,
|
&ManagedDisplayWidgetOpenGL::OnInit,
|
||||||
this, &ManagedDisplayWidget::OnInit, Qt::DirectConnection);
|
this, &ManagedDisplayWidget::OnInit, Qt::DirectConnection);
|
||||||
|
|||||||
@@ -437,6 +437,7 @@ void ViewerDisplayWidget::OnPaint()
|
|||||||
ctj.SetClearDestinationEnabled(false);
|
ctj.SetClearDestinationEnabled(false);
|
||||||
ctj.SetTransformMatrix(combined_matrix_flipped_);
|
ctj.SetTransformMatrix(combined_matrix_flipped_);
|
||||||
ctj.SetCropMatrix(crop_matrix_);
|
ctj.SetCropMatrix(crop_matrix_);
|
||||||
|
ctj.SetForceOpaque(true);
|
||||||
|
|
||||||
renderer()->BlitColorManaged(ctj, device_params);
|
renderer()->BlitColorManaged(ctj, device_params);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user