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();
}
}
+18 -19
View File
@@ -25,46 +25,45 @@
#include "render/colorprocessor.h"
#include "widget/manageddisplay/manageddisplay.h"
namespace olive {
class ScopeBase : public ManagedDisplayWidget
namespace olive
{
public:
ScopeBase(QWidget* parent = nullptr);
MANAGEDDISPLAYWIDGET_DEFAULT_DESTRUCTOR(ScopeBase)
class ScopeBase : public ManagedDisplayWidget {
public:
ScopeBase(QWidget *parent = nullptr);
MANAGEDDISPLAYWIDGET_DEFAULT_DESTRUCTOR(ScopeBase)
public slots:
void SetBuffer(TexturePtr frame);
void SetBuffer(TexturePtr frame);
protected slots:
virtual void OnInit() override;
virtual void OnInit() override;
virtual void OnPaint() override;
virtual void OnPaint() override;
virtual void OnDestroy() override;
virtual void OnDestroy() override;
protected:
virtual void showEvent(QShowEvent* e) override;
virtual void showEvent(QShowEvent *e) override;
virtual ShaderCode GenerateShaderCode() = 0;
virtual ShaderCode GenerateShaderCode() = 0;
/**
/**
* @brief Draw function
*
* Override this if your sub-class scope needs extra drawing.
*/
virtual void DrawScope(TexturePtr managed_tex, QVariant pipeline);
virtual void DrawScope(TexturePtr managed_tex, QVariant pipeline);
private:
QVariant pipeline_;
QVariant pipeline_;
TexturePtr texture_;
TexturePtr texture_;
TexturePtr managed_tex_;
bool managed_tex_up_to_date_;
TexturePtr managed_tex_;
bool managed_tex_up_to_date_;
};
}