Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions src/src/previewopenglwidget.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co.,Ltd.
// Copyright (C) 2020 - 2026 Uniontech Software Technology Co.,Ltd.
// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later
Expand All @@ -13,7 +13,9 @@
#include <QOpenGLTexture>
#endif

#include <malloc.h>

Check warning on line 16 in src/src/previewopenglwidget.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <malloc.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include "ddlog.h"
using namespace DDLog;

namespace {

Expand Down Expand Up @@ -97,14 +99,14 @@
PreviewOpenglWidget::PreviewOpenglWidget(QWidget *parent)
: QOpenGLWidget(parent)
{
qDebug() << "Function started: PreviewOpenglWidget constructor";
qCDebug(appLog) << "Function started: PreviewOpenglWidget constructor";
m_textureY = nullptr;
m_textureU = nullptr;
m_textureV = nullptr;
m_program = nullptr;
m_videoWidth = 0;
m_videoHeight = 0;
qDebug() << "Function completed: PreviewOpenglWidget constructor";
qCDebug(appLog) << "Function completed: PreviewOpenglWidget constructor";
}

int PreviewOpenglWidget::getFrameHeight()
Expand Down Expand Up @@ -137,7 +139,7 @@

void PreviewOpenglWidget::initializeGL()
{
qDebug() << "Function started: initializeGL";
qCDebug(appLog) << "Function started: initializeGL";

makeCurrent();
initializeOpenGLFunctions();
Expand Down Expand Up @@ -182,22 +184,22 @@
if (1 == is_forceGles()) {
programOk = tryLink(kVsrcLegacy, makeLegacyFragmentShader(true));
if (!programOk) {
qWarning() << "PreviewOpenglWidget: GLES shader failed, fallback to legacy GLSL:" << m_program->log();
qCWarning(appLog) << "PreviewOpenglWidget: GLES shader failed, fallback to legacy GLSL:" << m_program->log();
delete m_program;
m_program = new QOpenGLShaderProgram(this);
programOk = tryLink(kVsrcLegacy, makeLegacyFragmentShader(false));
}
} else {
programOk = tryLink(kVsrcModern, makeModernFragmentShader());
if (!programOk) {
qWarning() << "PreviewOpenglWidget: core-profile shader failed, fallback to legacy GLSL:" << m_program->log();
qCWarning(appLog) << "PreviewOpenglWidget: core-profile shader failed, fallback to legacy GLSL:" << m_program->log();
delete m_program;
m_program = new QOpenGLShaderProgram(this);
programOk = tryLink(kVsrcLegacy, makeLegacyFragmentShader(false));
}
}
if (!programOk) {
qWarning() << "PreviewOpenglWidget: shader program link failed:" << m_program->log();
qCWarning(appLog) << "PreviewOpenglWidget: shader program link failed:" << m_program->log();
}

m_program->bind();
Expand Down Expand Up @@ -231,7 +233,7 @@
glBindTexture(GL_TEXTURE_2D, 0);

glClearColor(0.0, 0.0, 0.0, 1.0);
qDebug() << "Function completed: initializeGL";
qCDebug(appLog) << "Function completed: initializeGL";
}

void PreviewOpenglWidget::resizeGL(int w, int h)
Expand Down
Loading
Loading