some code cleanup
Removal of translations around debug messages since these waste cycles and are likely not useful
This commit is contained in:
@@ -35,5 +35,6 @@ set(OLIVE_SOURCES
|
||||
render/backend/videorendererthreadbase.cpp
|
||||
render/backend/renderinstance.h
|
||||
render/backend/renderinstance.cpp
|
||||
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -39,7 +39,7 @@ OpenGLFramebuffer::~OpenGLFramebuffer()
|
||||
void OpenGLFramebuffer::Create(QOpenGLContext *ctx)
|
||||
{
|
||||
if (ctx == nullptr) {
|
||||
qWarning() << tr("RenderTexture::Create was passed an invalid context");
|
||||
qWarning() << "RenderTexture::Create was passed an invalid context";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -171,11 +171,11 @@ QString OpenGLShader::CodeDefaultFragment(const QString &function_name, const QS
|
||||
|
||||
frag_code.append(shader_code);
|
||||
|
||||
frag_code.append(QString(QStringLiteral("\n"
|
||||
"void main() {\n"
|
||||
" vec4 color = %1(texture2D(texture, v_texcoord));\n"
|
||||
" gl_FragColor = color;\n"
|
||||
"}\n")).arg(function_name));
|
||||
frag_code.append(QStringLiteral("\n"
|
||||
"void main() {\n"
|
||||
" vec4 color = %1(texture2D(texture, v_texcoord));\n"
|
||||
" gl_FragColor = color;\n"
|
||||
"}\n").arg(function_name));
|
||||
|
||||
}
|
||||
|
||||
@@ -207,27 +207,27 @@ QString OpenGLShader::CodeDefaultVertex()
|
||||
|
||||
QString OpenGLShader::CodeAlphaDisassociate(const QString &function_name)
|
||||
{
|
||||
return QString(QStringLiteral("vec4 %1(vec4 col) {\n"
|
||||
" if (col.a > 0.0) {\n"
|
||||
" return vec4(col.rgb / col.a, col.a);"
|
||||
" }\n"
|
||||
" return col;\n"
|
||||
"}\n")).arg(function_name);
|
||||
return QStringLiteral("vec4 %1(vec4 col) {\n"
|
||||
" if (col.a > 0.0) {\n"
|
||||
" return vec4(col.rgb / col.a, col.a);"
|
||||
" }\n"
|
||||
" return col;\n"
|
||||
"}\n").arg(function_name);
|
||||
}
|
||||
|
||||
QString OpenGLShader::CodeAlphaReassociate(const QString &function_name)
|
||||
{
|
||||
return QString(QStringLiteral("vec4 %1(vec4 col) {\n"
|
||||
" if (col.a > 0.0) {\n"
|
||||
" return vec4(col.rgb * col.a, col.a);"
|
||||
" }\n"
|
||||
" return col;\n"
|
||||
"}\n")).arg(function_name);
|
||||
return QStringLiteral("vec4 %1(vec4 col) {\n"
|
||||
" if (col.a > 0.0) {\n"
|
||||
" return vec4(col.rgb * col.a, col.a);"
|
||||
" }\n"
|
||||
" return col;\n"
|
||||
"}\n").arg(function_name);
|
||||
}
|
||||
|
||||
QString OpenGLShader::CodeAlphaAssociate(const QString &function_name)
|
||||
{
|
||||
return QString(QStringLiteral("vec4 %1(vec4 col) {\n"
|
||||
" return vec4(col.rgb * col.a, col.a);\n"
|
||||
"}\n")).arg(function_name);
|
||||
return QStringLiteral("vec4 %1(vec4 col) {\n"
|
||||
" return vec4(col.rgb * col.a, col.a);\n"
|
||||
"}\n").arg(function_name);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ void OpenGLTexture::Create(QOpenGLContext *ctx, int width, int height, const oli
|
||||
void OpenGLTexture::Create(QOpenGLContext *ctx, int width, int height, const olive::PixelFormat &format, const OpenGLTexture::Type &type, void *data)
|
||||
{
|
||||
if (ctx == nullptr) {
|
||||
qWarning() << tr("RenderTexture::Create was passed an invalid context");
|
||||
qWarning() << "RenderTexture::Create was passed an invalid context";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ void OpenGLTexture::SwapFrontAndBack()
|
||||
void OpenGLTexture::Upload(const void *data)
|
||||
{
|
||||
if (!IsCreated()) {
|
||||
qWarning() << tr("RenderTexture::Upload() called while it wasn't created");
|
||||
qWarning() << "RenderTexture::Upload() called while it wasn't created";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ void OpenGLTexture::Upload(const void *data)
|
||||
width_,
|
||||
height_,
|
||||
info.pixel_format,
|
||||
info.pixel_type,
|
||||
info.gl_pixel_type,
|
||||
data);
|
||||
|
||||
Release();
|
||||
@@ -174,7 +174,7 @@ void OpenGLTexture::Upload(const void *data)
|
||||
uchar *OpenGLTexture::Download() const
|
||||
{
|
||||
if (!IsCreated()) {
|
||||
qWarning() << tr("RenderTexture::Download() called while it wasn't created");
|
||||
qWarning() << "RenderTexture::Download() called while it wasn't created";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ uchar *OpenGLTexture::Download() const
|
||||
|
||||
uchar* data = new uchar[PixelService::GetBufferSize(format_, width_, height_)];
|
||||
|
||||
f->glReadPixels(0, 0, width_, height_, format_info.pixel_format, format_info.pixel_type, data);
|
||||
f->glReadPixels(0, 0, width_, height_, format_info.pixel_format, format_info.gl_pixel_type, data);
|
||||
|
||||
f->glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
|
||||
|
||||
@@ -212,7 +212,7 @@ void OpenGLTexture::CreateInternal(GLuint* tex, void *data)
|
||||
|
||||
// Verify texture
|
||||
if (texture_ == 0) {
|
||||
qWarning() << tr("OpenGL texture creation failed");
|
||||
qWarning() << "OpenGL texture creation failed";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -230,7 +230,7 @@ void OpenGLTexture::CreateInternal(GLuint* tex, void *data)
|
||||
height_,
|
||||
0,
|
||||
bit_depth.pixel_format,
|
||||
bit_depth.pixel_type,
|
||||
bit_depth.gl_pixel_type,
|
||||
data
|
||||
);
|
||||
|
||||
|
||||
@@ -61,13 +61,13 @@ bool RenderInstance::Start()
|
||||
|
||||
// Create OpenGL context (automatically destroys any existing if there is one)
|
||||
if (!ctx_->create()) {
|
||||
qWarning() << tr("Failed to create OpenGL context in thread %1").arg(reinterpret_cast<quintptr>(this));
|
||||
qWarning() << QStringLiteral("Failed to create OpenGL context in thread %1").arg(reinterpret_cast<quintptr>(this));
|
||||
return false;
|
||||
}
|
||||
|
||||
// Make context current on that surface
|
||||
if (!ctx_->makeCurrent(&surface_)) {
|
||||
qWarning() << tr("Failed to makeCurrent() on offscreen surface in thread %1").arg(reinterpret_cast<quintptr>(this));
|
||||
qWarning() << QStringLiteral("Failed to makeCurrent() on offscreen surface in thread %1").arg(reinterpret_cast<quintptr>(this));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -279,7 +279,7 @@ QString VideoRendererProcessor::CachePathName(const QByteArray &hash)
|
||||
QDir this_cache_dir = QDir(GetMediaCacheLocation()).filePath(cache_id_);
|
||||
this_cache_dir.mkpath(".");
|
||||
|
||||
QString filename = QString("%1.exr").arg(QString(hash.toHex()));
|
||||
QString filename = QStringLiteral("%1.exr").arg(QString(hash.toHex()));
|
||||
|
||||
return this_cache_dir.filePath(filename);
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ void VideoRendererDownloadThread::ProcessLoop()
|
||||
entry.texture->width(),
|
||||
entry.texture->height(),
|
||||
format_info.pixel_format,
|
||||
format_info.pixel_type,
|
||||
format_info.gl_pixel_type,
|
||||
data_buffer.data());
|
||||
|
||||
xf->glFramebufferTexture2D(GL_READ_FRAMEBUFFER,
|
||||
@@ -116,7 +116,7 @@ void VideoRendererDownloadThread::ProcessLoop()
|
||||
|
||||
emit Downloaded(entry.hash);
|
||||
} else {
|
||||
qWarning() << tr("Failed to open output file \"%1\"").arg(entry.filename);
|
||||
qWarning() << QStringLiteral("Failed to open output file \"%1\"").arg(entry.filename);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,25 +38,25 @@ PixelFormatInfo PixelService::GetPixelFormatInfo(const olive::PixelFormat &forma
|
||||
case olive::PIX_FMT_RGBA8:
|
||||
info.name = tr("8-bit");
|
||||
info.internal_format = GL_RGBA8;
|
||||
info.pixel_type = GL_UNSIGNED_BYTE;
|
||||
info.gl_pixel_type = GL_UNSIGNED_BYTE;
|
||||
info.oiio_desc = OIIO::TypeDesc::UINT8;
|
||||
break;
|
||||
case olive::PIX_FMT_RGBA16U:
|
||||
info.name = tr("16-bit Integer");
|
||||
info.internal_format = GL_RGBA16;
|
||||
info.pixel_type = GL_UNSIGNED_SHORT;
|
||||
info.gl_pixel_type = GL_UNSIGNED_SHORT;
|
||||
info.oiio_desc = OIIO::TypeDesc::UINT16;
|
||||
break;
|
||||
case olive::PIX_FMT_RGBA16F:
|
||||
info.name = tr("Half-Float (16-bit)");
|
||||
info.internal_format = GL_RGBA16F;
|
||||
info.pixel_type = GL_HALF_FLOAT;
|
||||
info.gl_pixel_type = GL_HALF_FLOAT;
|
||||
info.oiio_desc = OIIO::TypeDesc::HALF;
|
||||
break;
|
||||
case olive::PIX_FMT_RGBA32F:
|
||||
info.name = tr("Full-Float (32-bit)");
|
||||
info.internal_format = GL_RGBA32F;
|
||||
info.pixel_type = GL_FLOAT;
|
||||
info.gl_pixel_type = GL_FLOAT;
|
||||
info.oiio_desc = OIIO::TypeDesc::FLOAT;
|
||||
break;
|
||||
case olive::PIX_FMT_INVALID:
|
||||
@@ -273,7 +273,7 @@ FramePtr PixelService::ConvertPixelFormat(FramePtr frame, const olive::PixelForm
|
||||
return converted;
|
||||
}
|
||||
|
||||
qWarning() << tr("Invalid parameters called for pixel format conversion");
|
||||
qWarning() << "Invalid parameters called for pixel format conversion";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ struct PixelFormatInfo {
|
||||
QString name;
|
||||
GLint internal_format;
|
||||
GLenum pixel_format;
|
||||
GLenum pixel_type;
|
||||
GLenum gl_pixel_type;
|
||||
int bytes_per_pixel;
|
||||
OIIO::TypeDesc oiio_desc;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user