aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAriadne Conill <ariadne@dereferenced.org>2020-05-22 02:25:17 -0600
committerAriadne Conill <ariadne@dereferenced.org>2020-05-22 02:26:11 -0600
commitfe98a738679fe38fa256cd1d964919966448222c (patch)
tree057b1e8cc7244cd8cba7a5adf76fe71de165e971
parentd967d92c01b5b6ab66ef884a5f414bcbf537b8b9 (diff)
downloadalpine_aports-fe98a738679fe38fa256cd1d964919966448222c.tar.bz2
alpine_aports-fe98a738679fe38fa256cd1d964919966448222c.tar.xz
alpine_aports-fe98a738679fe38fa256cd1d964919966448222c.zip
community/krita: fix up texture management by using OpenGLES approach in all cases
-rw-r--r--community/krita/APKBUILD2
-rw-r--r--community/krita/pure-opengles-compat.patch88
2 files changed, 80 insertions, 10 deletions
diff --git a/community/krita/APKBUILD b/community/krita/APKBUILD
index 0a6acf3661..e54ea44900 100644
--- a/community/krita/APKBUILD
+++ b/community/krita/APKBUILD
@@ -37,4 +37,4 @@ package() {
37 37
38sha512sums="66eef3d1b5647e62551276662ef4332f15abc022f1032f27a2ad695a8d2dc5fa758146492a9da2b8cbd4a52e47c576473029d2aa9728dea3bec869b8173f08c0 krita-4.2.9.tar.xz 38sha512sums="66eef3d1b5647e62551276662ef4332f15abc022f1032f27a2ad695a8d2dc5fa758146492a9da2b8cbd4a52e47c576473029d2aa9728dea3bec869b8173f08c0 krita-4.2.9.tar.xz
39e7a9117d012df4181e05de970f2210264b8685ee76c98b33795f8095d9a17b24b20e6ce920f944b4b5cb940cf672af5ba5fd0ffae9f53085a4f97da61b1e69f6 fix-crash-with-c-locale.patch 39e7a9117d012df4181e05de970f2210264b8685ee76c98b33795f8095d9a17b24b20e6ce920f944b4b5cb940cf672af5ba5fd0ffae9f53085a4f97da61b1e69f6 fix-crash-with-c-locale.patch
405743461739a658bb471dd6b5434f3a396048cd17cd54127feb4572fa6b3a414d48658aa15b52f7f9c1b6d787caec1af1db1739176f7d6a259b2c32396603fd17 pure-opengles-compat.patch" 40078f8ac6c8dfbd27202aca8a068fa77ca37c92aaa36fb725a8a9b7b97801da042f3dfd52fb115cea1c4cbb2984a9cb16e8a611a4507fffacdc4b4d8a85c091fa pure-opengles-compat.patch"
diff --git a/community/krita/pure-opengles-compat.patch b/community/krita/pure-opengles-compat.patch
index 43d6886cb7..abd7b5f87b 100644
--- a/community/krita/pure-opengles-compat.patch
+++ b/community/krita/pure-opengles-compat.patch
@@ -1,6 +1,9 @@
1Consistently use OpenGLES functions instead of OpenGL 2.1 functions.
2
3Upstream: Pending submission
1diff -urN krita-4.2.9.orig/libs/ui/opengl/kis_opengl_canvas2.cpp krita-4.2.9/libs/ui/opengl/kis_opengl_canvas2.cpp 4diff -urN krita-4.2.9.orig/libs/ui/opengl/kis_opengl_canvas2.cpp krita-4.2.9/libs/ui/opengl/kis_opengl_canvas2.cpp
2--- krita-4.2.9.orig/libs/ui/opengl/kis_opengl_canvas2.cpp 2020-05-22 01:52:07.430282697 -0600 5--- krita-4.2.9.orig/libs/ui/opengl/kis_opengl_canvas2.cpp 2020-05-22 02:19:15.233324983 -0600
3+++ krita-4.2.9/libs/ui/opengl/kis_opengl_canvas2.cpp 2020-05-22 01:53:24.310617820 -0600 6+++ krita-4.2.9/libs/ui/opengl/kis_opengl_canvas2.cpp 2020-05-22 02:20:49.730356628 -0600
4@@ -46,10 +46,6 @@ 7@@ -46,10 +46,6 @@
5 #include "KisOpenGLModeProber.h" 8 #include "KisOpenGLModeProber.h"
6 #include <KoColorModelStandardIds.h> 9 #include <KoColorModelStandardIds.h>
@@ -40,17 +43,84 @@ diff -urN krita-4.2.9.orig/libs/ui/opengl/kis_opengl_canvas2.cpp krita-4.2.9/lib
40 43
41 KisConfig cfg(true); 44 KisConfig cfg(true);
42 d->openGLImageTextures->setProofingConfig(canvas()->proofingConfiguration()); 45 d->openGLImageTextures->setProofingConfig(canvas()->proofingConfiguration());
43@@ -446,13 +428,7 @@ 46@@ -442,21 +424,8 @@
44 glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); 47 modelMatrix = projectionMatrix * modelMatrix;
48 d->solidColorShader->setUniformValue(d->solidColorShader->location(Uniform::ModelViewProjection), modelMatrix);
45 49
46 glEnable(GL_COLOR_LOGIC_OP); 50- if (!KisOpenGL::hasOpenGLES()) {
51- glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
52-
53- glEnable(GL_COLOR_LOGIC_OP);
47-#ifndef Q_OS_MACOS 54-#ifndef Q_OS_MACOS
48- if (d->glFn201) { 55- if (d->glFn201) {
49- d->glFn201->glLogicOp(GL_XOR); 56- d->glFn201->glLogicOp(GL_XOR);
50- } 57- }
51-#else 58-#else
52 glLogicOp(GL_XOR); 59- glLogicOp(GL_XOR);
53-#endif 60-#endif
54 } else { 61- } else {
55 glEnable(GL_BLEND); 62- glEnable(GL_BLEND);
56 glBlendFuncSeparate(GL_ONE_MINUS_DST_COLOR, GL_ZERO, GL_ONE, GL_ONE); 63- glBlendFuncSeparate(GL_ONE_MINUS_DST_COLOR, GL_ZERO, GL_ONE, GL_ONE);
64- }
65+ glEnable(GL_BLEND);
66+ glBlendFuncSeparate(GL_ONE_MINUS_DST_COLOR, GL_ZERO, GL_ONE, GL_ONE);
67
68 d->solidColorShader->setUniformValue(
69 d->solidColorShader->location(Uniform::FragmentColor),
70@@ -497,11 +466,7 @@
71 d->outlineVAO.release();
72 }
73
74- if (!KisOpenGL::hasOpenGLES()) {
75- glDisable(GL_COLOR_LOGIC_OP);
76- } else {
77- glDisable(GL_BLEND);
78- }
79+ glDisable(GL_BLEND);
80
81 d->solidColorShader->release();
82 }
83diff -urN krita-4.2.9.orig/libs/ui/opengl/kis_opengl_image_textures.cpp krita-4.2.9/libs/ui/opengl/kis_opengl_image_textures.cpp
84--- krita-4.2.9.orig/libs/ui/opengl/kis_opengl_image_textures.cpp 2020-05-22 02:19:15.233324983 -0600
85+++ krita-4.2.9/libs/ui/opengl/kis_opengl_image_textures.cpp 2020-05-22 02:23:39.357678451 -0600
86@@ -473,36 +473,16 @@
87 namespace {
88 void initializeRGBA16FTextures(QOpenGLContext *ctx, KisGLTexturesInfo &texturesInfo, KoID &destinationColorDepthId)
89 {
90- if (KisOpenGL::hasOpenGLES() || KisOpenGL::hasOpenGL3()) {
91- texturesInfo.internalFormat = GL_RGBA16F;
92- dbgUI << "Using half (GLES or GL3)";
93- } else if (ctx->hasExtension("GL_ARB_texture_float")) {
94- texturesInfo.internalFormat = GL_RGBA16F_ARB;
95- dbgUI << "Using ARB half";
96- }
97- else if (ctx->hasExtension("GL_ATI_texture_float")) {
98- texturesInfo.internalFormat = GL_RGBA_FLOAT16_ATI;
99- dbgUI << "Using ATI half";
100- }
101+ texturesInfo.internalFormat = GL_RGBA16F;
102+ dbgUI << "Using half (GLES or GL3)";
103
104 bool haveBuiltInOpenExr = false;
105 #ifdef HAVE_OPENEXR
106 haveBuiltInOpenExr = true;
107 #endif
108
109- if (haveBuiltInOpenExr && (KisOpenGL::hasOpenGLES() || KisOpenGL::hasOpenGL3())) {
110- texturesInfo.type = GL_HALF_FLOAT;
111- destinationColorDepthId = Float16BitsColorDepthID;
112- dbgUI << "Pixel type half (GLES or GL3)";
113- } else if (haveBuiltInOpenExr && ctx->hasExtension("GL_ARB_half_float_pixel")) {
114- texturesInfo.type = GL_HALF_FLOAT_ARB;
115- destinationColorDepthId = Float16BitsColorDepthID;
116- dbgUI << "Pixel type half";
117- } else {
118- texturesInfo.type = GL_FLOAT;
119- destinationColorDepthId = Float32BitsColorDepthID;
120- dbgUI << "Pixel type float";
121- }
122+ texturesInfo.type = GL_HALF_FLOAT;
123+ destinationColorDepthId = Float16BitsColorDepthID;
124 texturesInfo.format = GL_RGBA;
125 }
126 }