public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Andreas Sturmlechner" <asturm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/subtitlecomposer/, media-video/subtitlecomposer/files/
Date: Mon,  9 May 2022 21:56:06 +0000 (UTC)	[thread overview]
Message-ID: <1652133313.a38de3c946c83c6148450c6aa4d9c7152d37b429.asturm@gentoo> (raw)

commit:     a38de3c946c83c6148450c6aa4d9c7152d37b429
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Mon May  9 06:17:05 2022 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Mon May  9 21:55:13 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a38de3c9

media-video/subtitlecomposer: Fix build with dev-qt/qtgui[gles2-only]

Closes: https://bugs.gentoo.org/820035
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../subtitlecomposer-0.7.1-gles-support.patch      | 122 +++++++++++++++++++++
 .../subtitlecomposer/subtitlecomposer-0.7.1.ebuild |   7 +-
 2 files changed, 127 insertions(+), 2 deletions(-)

diff --git a/media-video/subtitlecomposer/files/subtitlecomposer-0.7.1-gles-support.patch b/media-video/subtitlecomposer/files/subtitlecomposer-0.7.1-gles-support.patch
new file mode 100644
index 000000000000..98de494cf306
--- /dev/null
+++ b/media-video/subtitlecomposer/files/subtitlecomposer-0.7.1-gles-support.patch
@@ -0,0 +1,122 @@
+From 167a941f8070f4a9abacb3aa2f61ee6ee00d6cb8 Mon Sep 17 00:00:00 2001
+From: Mladen Milinkovic <maxrd2@smoothware.net>
+Date: Thu, 7 Oct 2021 19:37:23 +0200
+Subject: [PATCH] GLRenderer: added GLES support
+
+---
+ src/videoplayer/backend/glrenderer.cpp | 44 ++++++++++++++++++++++----
+ 1 file changed, 38 insertions(+), 6 deletions(-)
+
+diff --git a/src/videoplayer/backend/glrenderer.cpp b/src/videoplayer/backend/glrenderer.cpp
+index 7c9c38b..5cb985d 100644
+--- a/src/videoplayer/backend/glrenderer.cpp
++++ b/src/videoplayer/backend/glrenderer.cpp
+@@ -20,6 +20,7 @@ extern "C" {
+ }
+ 
+ #define DEBUG_GL 0
++#define FORCE_GLES 0
+ #define OPENGL_CORE 0
+ #define OPENGL_VER 2,0
+ 
+@@ -33,6 +34,17 @@ extern "C" {
+ #define asGL(glCall) glCall
+ #endif
+ 
++#if defined(GL_ES_VERSION_2_0) || FORCE_GLES
++#define USE_GLES
++#define TEXTURE_RGB_FORMAT GL_RGBA
++// NOTE: we don't currently support more than 8bpp on GLES
++#define TEXTURE_U16_FORMAT GL_R8
++#else
++#undef USE_GLES
++#define TEXTURE_RGB_FORMAT GL_BGRA
++#define TEXTURE_U16_FORMAT GL_R16
++#endif
++
+ using namespace SubtitleComposer;
+ 
+ enum { ID_Y, ID_U, ID_V, ID_OVR, ID_SIZE };
+@@ -82,6 +94,9 @@ void
+ GLRenderer::setupProfile()
+ {
+ 	QSurfaceFormat format(QSurfaceFormat::defaultFormat());
++#if FORCE_GLES
++	format.setRenderableType(QSurfaceFormat::OpenGLES);
++#endif
+ 	format.setVersion(OPENGL_VER);
+ #if DEBUG_GL
+ 	format.setOption(QSurfaceFormat::DebugContext);
+@@ -126,7 +141,7 @@ GLRenderer::setFrameFormat(int width, int height, int compBits, int crWidthShift
+ 	m_crHeight = crHeight;
+ 
+ 	m_glType = compBytes == 1 ? GL_UNSIGNED_BYTE : GL_UNSIGNED_SHORT;
+-	m_glFormat = compBytes == 1 ? GL_R8 : GL_R16;
++	m_glFormat = compBytes == 1 ? GL_R8 : TEXTURE_U16_FORMAT;
+ 
+ 	delete[] m_bufYUV;
+ 	m_bufSize = bufSize;
+@@ -261,7 +276,11 @@ GLRenderer::initShader()
+ 	delete m_vertShader;
+ 	m_vertShader = new QOpenGLShader(QOpenGLShader::Vertex, this);
+ 	bool success = m_vertShader->compileSourceCode(
++#ifdef USE_GLES
++		"#version 100\n"
++#else
+ 		"#version 120\n"
++#endif
+ 		"attribute vec4 vPos;"
+ 		"attribute vec2 vVidTex;"
+ 		"attribute vec2 vOvrTex;"
+@@ -288,7 +307,13 @@ GLRenderer::initShader()
+ 		csms.append(QString::number(csm[i], 'g', 10));
+ 	}
+ 
+-	success = m_fragShader->compileSourceCode(QStringLiteral("#version 120\n"
++	success = m_fragShader->compileSourceCode(QStringLiteral(
++#ifdef USE_GLES
++		"#version 100\n"
++		"precision mediump float;\n"
++#else
++		"#version 120\n"
++#endif
+ 		"varying vec2 vfVidTex;"
+ 		"varying vec2 vfOvrTex;"
+ 		"uniform sampler2D texY;"
+@@ -348,8 +373,15 @@ GLRenderer::initializeGL()
+ 	QMutexLocker l(&m_texMutex);
+ 
+ 	initializeOpenGLFunctions();
+-	qDebug() << "OpenGL version: " << reinterpret_cast<const char *>(glGetString(GL_VERSION));
+-	qDebug() << "GLSL version: " << reinterpret_cast<const char *>(glGetString(GL_SHADING_LANGUAGE_VERSION));
++	qDebug().nospace() << "GL API: OpenGL " << (format().renderableType() == QSurfaceFormat::OpenGLES ? "ES" : "Desktop")
++		<< ' ' << format().majorVersion() << "." << format().minorVersion()
++#ifdef USE_GLES
++		<< " (compiled for OpenGL ES)";
++#else
++		<< " (compiled for OpenGL Desktop)";
++#endif
++	qDebug() << "OpenGL version:" << reinterpret_cast<const char *>(glGetString(GL_VERSION));
++	qDebug() << "GLSL version:" << reinterpret_cast<const char *>(glGetString(GL_SHADING_LANGUAGE_VERSION));
+ 
+ 	if(m_vao.create())
+ 		m_vao.bind();
+@@ -453,13 +485,13 @@ GLRenderer::uploadMM(int texWidth, int texHeight, T *texBuf, const T *texSrc)
+ 			if(D == 1) {
+ 				asGL(glTexImage2D(GL_TEXTURE_2D, level, m_glFormat, texWidth, texHeight, 0, GL_RED, m_glType, texSrc));
+ 			} else { // D == 4
+-				asGL(glTexImage2D(GL_TEXTURE_2D, level, GL_RGBA8, texWidth, texHeight, 0, GL_BGRA, GL_UNSIGNED_BYTE, texSrc));
++				asGL(glTexImage2D(GL_TEXTURE_2D, level, GL_RGBA8, texWidth, texHeight, 0, TEXTURE_RGB_FORMAT, GL_UNSIGNED_BYTE, texSrc));
+ 			}
+ 		} else {
+ 			if(D == 1) {
+ 				asGL(glTexSubImage2D(GL_TEXTURE_2D, level, 0, 0, texWidth, texHeight, GL_RED, m_glType, texSrc));
+ 			} else { // D == 4
+-				asGL(glTexSubImage2D(GL_TEXTURE_2D, level, 0, 0, texWidth, texHeight, GL_BGRA, GL_UNSIGNED_BYTE, texSrc));
++				asGL(glTexSubImage2D(GL_TEXTURE_2D, level, 0, 0, texWidth, texHeight, TEXTURE_RGB_FORMAT, GL_UNSIGNED_BYTE, texSrc));
+ 			}
+ 		}
+ 
+-- 
+GitLab
+

diff --git a/media-video/subtitlecomposer/subtitlecomposer-0.7.1.ebuild b/media-video/subtitlecomposer/subtitlecomposer-0.7.1.ebuild
index aef529fbf604..3ff7e5e962a5 100644
--- a/media-video/subtitlecomposer/subtitlecomposer-0.7.1.ebuild
+++ b/media-video/subtitlecomposer/subtitlecomposer-0.7.1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -43,7 +43,10 @@ BDEPEND="
 	virtual/pkgconfig
 "
 
-PATCHES=( "${FILESDIR}/${P}-tests-optional.patch" )
+PATCHES=(
+	"${FILESDIR}/${P}-tests-optional.patch"
+	"${FILESDIR}/${P}-gles-support.patch" # bug 820035
+)
 
 src_configure() {
 	local mycmakeargs=(


             reply	other threads:[~2022-05-09 21:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-09 21:56 Andreas Sturmlechner [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-04-01 21:15 [gentoo-commits] repo/gentoo:master commit in: media-video/subtitlecomposer/, media-video/subtitlecomposer/files/ Andreas Sturmlechner
2024-06-30 21:42 Andreas Sturmlechner
2023-09-02 21:08 Andreas Sturmlechner
2023-07-25 12:35 Andreas Sturmlechner
2023-03-29 13:53 Andreas Sturmlechner
2022-05-18 12:50 Andreas Sturmlechner
2020-12-25 19:54 Andreas Sturmlechner
2020-09-29 15:02 Andreas Sturmlechner
2019-07-24 21:22 Andreas Sturmlechner
2018-11-01  9:45 Maciej Mrozowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1652133313.a38de3c946c83c6148450c6aa4d9c7152d37b429.asturm@gentoo \
    --to=asturm@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox