style: unify identifier naming per updated conventions

Automated with clang-tidy readability-identifier-naming (config added to
.clang-tidy) plus scripted passes, per the updated rules now documented
in CONTRIBUTING.md:

- types (class/struct/enum/alias/template params): PascalCase
- functions, variables, members: snake_case (incl. rational -> Rational)
- private/protected members: trailing underscore; static member
  variables likewise (instance_, available_themes_)
- constants and enum values: snake_case (kLinear -> k_linear,
  F32P -> f32p); ALL_CAPS reserved for macros
- macros: OAK_ prefix (OLIVE_ADD_TEST/OLIVE_ASSERT/OLIVE_CONFIG ->
  OAK_ADD_TEST/OAK_ASSERT/OAK_CONFIG, GL_PREAMBLE -> OAK_GL_PREAMBLE,
  include guards -> OAK_*)
- file names: all lowercase (Current/Plugin/OliveHost/OliveClip/
  OlivePluginInstance -> current/plugin/olivehost/oliveclip/
  oliveplugininstance)
- getters share the member name sans underscore, setters set_foo()
- Qt and third-party (OpenFX) virtual overrides and framework callbacks
  keep their original names (exempt in .clang-tidy)

Manual follow-ups required where automation could not reach:
- string-based QMetaObject/SIGNAL/SLOT references updated to renamed
  methods (AddTask, CreatedFile, DeleteSpecificFile, moveSelectionUp, ...)
- macro bodies referencing renamed methods (OLIVE_CONFIG,
  NODE_DEFAULT_DESTRUCTOR, MANAGEDDISPLAYWIDGET_*)
- self-shadowing locals renamed where signals/methods became same-named
  (size_changed, worker_count, selected_items, import param, filters)
- third_party OFX member/namespace usages restored (OFX::Host::*,
  _created, _clipPrefsDirty, createInstance, clearPersistentMessage)
- STL protocol aliases restored (const_iterator) with .clang-tidy
  ignore rules; qHash overloads restored

Full build and test suite pass: ctest 4/4, ~1960 gtest cases green.
This commit is contained in:
2026-07-19 16:10:54 +08:00
parent cb1718a103
commit bb40b4923e
1014 changed files with 44257 additions and 44220 deletions
+41 -41
View File
@@ -19,8 +19,8 @@
***/
#ifndef RENDERCONTEXT_H
#define RENDERCONTEXT_H
#ifndef OAK_RENDERCONTEXT_H
#define OAK_RENDERCONTEXT_H
#include <QMutex>
#include <QObject>
@@ -51,81 +51,81 @@ public:
Renderer(QObject *parent = nullptr);
virtual ~Renderer() override;
virtual bool Init() = 0;
virtual bool init() = 0;
TexturePtr CreateTexture(const VideoParams &params,
TexturePtr create_texture(const VideoParams &params,
const void *data = nullptr, int linesize = 0);
void DestroyTexture(Texture *texture);
void destroy_texture(Texture *texture);
virtual void BlitToTexture(QVariant shader, olive::AcceleratedJob &job,
virtual void blit_to_texture(QVariant shader, olive::AcceleratedJob &job,
olive::Texture *destination,
bool clear_destination = true)
{
Blit(shader, job, destination, destination->params(),
blit(shader, job, destination, destination->params(),
clear_destination);
}
void Blit(QVariant shader, olive::AcceleratedJob &job,
void blit(QVariant shader, olive::AcceleratedJob &job,
olive::VideoParams params, bool clear_destination = true)
{
Blit(shader, job, nullptr, params, clear_destination);
blit(shader, job, nullptr, params, clear_destination);
}
void BlitColorManaged(const ColorTransformJob &color_job,
void blit_color_managed(const ColorTransformJob &color_job,
Texture *destination, const VideoParams &params);
void BlitColorManaged(const ColorTransformJob &job, Texture *destination)
void blit_color_managed(const ColorTransformJob &job, Texture *destination)
{
BlitColorManaged(job, destination, destination->params());
blit_color_managed(job, destination, destination->params());
}
void BlitColorManaged(const ColorTransformJob &job,
void blit_color_managed(const ColorTransformJob &job,
const VideoParams &params)
{
BlitColorManaged(job, nullptr, params);
blit_color_managed(job, nullptr, params);
}
TexturePtr InterlaceTexture(TexturePtr top, TexturePtr bottom,
TexturePtr interlace_texture(TexturePtr top, TexturePtr bottom,
const VideoParams &params);
QVariant GetDefaultShader();
QVariant get_default_shader();
void Destroy();
void destroy();
virtual void PostDestroy() = 0;
virtual void post_destroy() = 0;
virtual void PostInit() = 0;
virtual void post_init() = 0;
virtual void ClearDestination(olive::Texture *texture = nullptr,
virtual void clear_destination(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 create_native_shader(olive::ShaderCode code) = 0;
virtual void DestroyNativeShader(QVariant shader) = 0;
virtual void destroy_native_shader(QVariant shader) = 0;
virtual void UploadToTexture(const QVariant &handle,
virtual void upload_to_texture(const QVariant &handle,
const VideoParams &params, const void *data,
int linesize) = 0;
virtual void DownloadFromTexture(const QVariant &handle,
virtual void download_from_texture(const QVariant &handle,
const VideoParams &params, void *data,
int linesize) = 0;
virtual void Flush() = 0;
virtual void flush() = 0;
virtual Color GetPixelFromTexture(olive::Texture *texture,
virtual Color get_pixel_from_texture(olive::Texture *texture,
const QPointF &pt) = 0;
std::shared_ptr<RendererLifetime> GetLifetime() const
std::shared_ptr<RendererLifetime> get_lifetime() const
{
return lifetime_;
}
virtual bool IsOpenGL() const
virtual bool is_open_gl() const
{
return false;
}
virtual bool IsVulkan() const
virtual bool is_vulkan() const
{
return false;
}
@@ -137,7 +137,7 @@ public:
* Default implementation is a no-op. OpenGL-based renderers override this
* to bind the texture as a framebuffer render target.
*/
virtual void AttachOutputTexture(olive::Texture *texture)
virtual void attach_output_texture(olive::Texture *texture)
{
(void)texture;
}
@@ -147,23 +147,23 @@ public:
*
* Default implementation is a no-op.
*/
virtual void DetachOutputTexture()
virtual void detach_output_texture()
{
}
protected:
virtual void Blit(QVariant shader, olive::AcceleratedJob &job,
virtual void blit(QVariant shader, olive::AcceleratedJob &job,
olive::Texture *destination,
olive::VideoParams destination_params,
bool clear_destination) = 0;
virtual QVariant CreateNativeTexture(int width, int height, int depth,
virtual QVariant create_native_texture(int width, int height, int depth,
PixelFormat format, int channel_count,
const void *data = nullptr,
int linesize = 0) = 0;
virtual void DestroyNativeTexture(QVariant texture) = 0;
virtual void destroy_native_texture(QVariant texture) = 0;
virtual void DestroyInternal() = 0;
virtual void destroy_internal() = 0;
private:
std::atomic<bool> destroyed_{ false };
@@ -180,12 +180,12 @@ private:
QVector<LUT> lut1d_textures;
};
TexturePtr CreateTextureFromNativeHandle(const QVariant &v,
TexturePtr create_texture_from_native_handle(const QVariant &v,
const VideoParams &params);
bool GetColorContext(const ColorTransformJob &color_job, ColorContext *ctx);
bool get_color_context(const ColorTransformJob &color_job, ColorContext *ctx);
void ClearOldTextures();
void clear_old_textures();
QHash<QString, ColorContext> color_cache_;
@@ -199,8 +199,8 @@ private:
qint64 accessed;
};
static const int MAX_TEXTURE_LIFE = 5000;
static const bool USE_TEXTURE_CACHE = true;
static const int max_texture_life = 5000;
static const bool use_texture_cache = true;
std::list<CachedTexture> texture_cache_;
QMutex color_cache_mutex_;
@@ -214,4 +214,4 @@ private:
}
#endif // RENDERCONTEXT_H
#endif // OAK_RENDERCONTEXT_H