change: change code style to Linux style except indent.

This commit is contained in:
Mike Solar
2025-08-03 03:09:40 +08:00
parent 65ab76edc8
commit 74f73ab3be
789 changed files with 77113 additions and 68888 deletions
+38 -35
View File
@@ -22,76 +22,79 @@
#include "config/config.h"
namespace olive {
namespace olive
{
#define super ManagedDisplayWidget
ScopeBase::ScopeBase(QWidget* parent) :
super(parent),
texture_(nullptr),
managed_tex_up_to_date_(false)
ScopeBase::ScopeBase(QWidget *parent)
: super(parent)
, texture_(nullptr)
, managed_tex_up_to_date_(false)
{
EnableDefaultContextMenu();
EnableDefaultContextMenu();
}
void ScopeBase::SetBuffer(TexturePtr frame)
{
texture_ = frame;
managed_tex_up_to_date_ = false;
update();
texture_ = frame;
managed_tex_up_to_date_ = false;
update();
}
void ScopeBase::showEvent(QShowEvent* e)
void ScopeBase::showEvent(QShowEvent *e)
{
super::showEvent(e);
super::showEvent(e);
}
void ScopeBase::DrawScope(TexturePtr managed_tex, QVariant pipeline)
{
ShaderJob job;
ShaderJob job;
job.Insert(QStringLiteral("ove_maintex"), NodeValue(NodeValue::kTexture, QVariant::fromValue(managed_tex)));
job.Insert(QStringLiteral("ove_maintex"),
NodeValue(NodeValue::kTexture,
QVariant::fromValue(managed_tex)));
renderer()->Blit(pipeline, job, GetViewportParams());
renderer()->Blit(pipeline, job, GetViewportParams());
}
void ScopeBase::OnInit()
{
super::OnInit();
super::OnInit();
pipeline_ = renderer()->CreateNativeShader(GenerateShaderCode());
pipeline_ = renderer()->CreateNativeShader(GenerateShaderCode());
}
void ScopeBase::OnPaint()
{
// Clear display surface
renderer()->ClearDestination();
// Clear display surface
renderer()->ClearDestination();
if (texture_) {
// Convert reference frame to display space
if (!managed_tex_ || !managed_tex_up_to_date_
|| managed_tex_->params() != texture_->params()) {
managed_tex_ = renderer()->CreateTexture(texture_->params());
if (texture_) {
// Convert reference frame to display space
if (!managed_tex_ || !managed_tex_up_to_date_ ||
managed_tex_->params() != texture_->params()) {
managed_tex_ = renderer()->CreateTexture(texture_->params());
ColorTransformJob job;
job.SetColorProcessor(color_service());
job.SetInputTexture(texture_);
job.SetInputAlphaAssociation(kAlphaNone);
ColorTransformJob job;
job.SetColorProcessor(color_service());
job.SetInputTexture(texture_);
job.SetInputAlphaAssociation(kAlphaNone);
renderer()->BlitColorManaged(job, managed_tex_.get());
}
renderer()->BlitColorManaged(job, managed_tex_.get());
}
DrawScope(managed_tex_, pipeline_);
}
DrawScope(managed_tex_, pipeline_);
}
}
void ScopeBase::OnDestroy()
{
managed_tex_ = nullptr;
texture_ = nullptr;
pipeline_.clear();
managed_tex_ = nullptr;
texture_ = nullptr;
pipeline_.clear();
super::OnDestroy();
super::OnDestroy();
}
}