fixed viewer on wayland

This commit is contained in:
itsmattkc
2023-05-29 12:31:57 -07:00
parent 383b1d69b5
commit 4d953adc4b
6 changed files with 15 additions and 1 deletions
+6
View File
@@ -42,6 +42,7 @@ public:
custom_shader_src_ = nullptr;
input_alpha_association_ = kAlphaNone;
clear_destination_ = true;
force_opaque_ = false;
}
ColorTransformJob(const NodeValueRow &row) :
@@ -95,6 +96,9 @@ public:
const QString &GetFunctionName() const { return 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:
ColorProcessorPtr processor_;
QString id_;
@@ -114,6 +118,8 @@ private:
QString function_name_;
bool force_opaque_;
};
}
+1
View File
@@ -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_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_force_opaque"), NodeValue(NodeValue::kBoolean, color_job.GetForceOpaque()));
job.Insert(color_job.GetValues());
foreach (const ColorContext::LUT& l, color_ctx.lut3d_textures) {
+1 -1
View File
@@ -84,7 +84,7 @@ public:
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;
+5
View File
@@ -2,6 +2,7 @@
uniform sampler2D ove_maintex;
uniform int ove_maintex_alpha;
uniform mat4 ove_cropmatrix;
uniform bool ove_force_opaque;
// Macros defining `ove_maintex_alpha` state
// Matches `AlphaAssociated` C++ enum
@@ -53,5 +54,9 @@ void main() {
col = assoc(col);
}
if (ove_force_opaque) {
col.a = 1.0;
}
frag_color = col;
}
@@ -43,6 +43,7 @@ ManagedDisplayWidget::ManagedDisplayWidget(QWidget *parent) :
if (RenderManager::instance()->backend() == RenderManager::kOpenGL) {
// Create OpenGL widget
inner_widget_ = new ManagedDisplayWidgetOpenGL();
inner_widget_->setAttribute(Qt::WA_TranslucentBackground, false);
connect(static_cast<ManagedDisplayWidgetOpenGL*>(inner_widget_),
&ManagedDisplayWidgetOpenGL::OnInit,
this, &ManagedDisplayWidget::OnInit, Qt::DirectConnection);
+1
View File
@@ -437,6 +437,7 @@ void ViewerDisplayWidget::OnPaint()
ctj.SetClearDestinationEnabled(false);
ctj.SetTransformMatrix(combined_matrix_flipped_);
ctj.SetCropMatrix(crop_matrix_);
ctj.SetForceOpaque(true);
renderer()->BlitColorManaged(ctj, device_params);
}