Commit 46875806 authored by Sharaf Zaman's avatar Sharaf Zaman

Merge branch 'master' into sh-zam/T10784-android-port

parents f04e0e1a 6f9eb1ef
#
# .lgtml.yml configuration file for C++ analysis of Krita on https://lgtm.com/projects/g/KDE/krita/
#
path_classifiers:
test:
- tests
extraction:
cpp:
prepare:
packages:
- gettext
- build-essential
- cmake
- libboost-dev
- libboost-system-dev
- libeigen3-dev
- libexiv2-dev
- libfftw3-dev
- libfontconfig1-dev
- libfreetype6-dev
- libgl1-mesa-dev
- libglew-dev
- libglib2.0-dev
- libglu1-mesa-dev
- libgsf-1-dev
- libgsl-dev
- libjpeg-dev
- liblcms2-dev
- libopenexr-dev
- libpng-dev
- libpoppler-qt5-dev
- libtiff5-dev
- libvc-dev
- libopencolorio-dev
- libx11-dev
- libxml2-dev
- libxslt1-dev
- libxi-dev
- pkg-config
- vc-dev
- zlib1g-dev
- libkf5kdcraw-dev
- shared-mime-info
- libopenimageio-dev
- extra-cmake-modules
- libkf5archive-dev
- libkf5coreaddons-dev
- libkf5guiaddons-dev
- libkf5itemmodels-dev
- libkf5itemviews-dev
- libkf5widgetsaddons-dev
- libkf5i18n-dev
- libkf5windowsystem-dev
- libkf5completion-dev
- libkf5iconthemes-dev
- libkf5kiocore5
- libqt5svg5-dev
- libqt5x11extras5-dev
- libqt5opengl5-dev
- libquazip5-dev
configure:
command:
- mkdir build
- cd build
- cmake ..
index:
build_command:
- cd build
- make
......@@ -60,9 +60,13 @@ if (MINGW)
else (DEFINED ENV{WindowsSdkDir})
message(FATAL_ERROR "Environment variable 'WindowsSdkDir' not set! Please set it to path of Windows 10 SDK or disable QT_ENABLE_DYNAMIC_OPENGL")
endif ()
endif ()
endif ()
endif (MINGW)
if (WIN32)
option(USE_QT_TABLET_WINDOWS "Do not use Krita's forked Wintab and Windows Ink support on Windows, but leave everything to Qt." ON)
endif ()
set(SECURITY_EXE_LINKER_FLAGS "")
set(SECURITY_SHARED_LINKER_FLAGS "")
set(SECURITY_MODULE_LINKER_FLAGS "")
......@@ -208,5 +212,10 @@ if (NOT APPLE)
add_subdirectory( ext_gmic )
endif ()
if(UNIX)
add_subdirectory( ext_pkgconfig )
add_subdirectory( ext_heif )
endif()
add_subdirectory(ext_giflib)
add_subdirectory(ext_quazip)
This diff is collapsed.
......@@ -9,9 +9,10 @@ ExternalProject_Add( ext_exiv2
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/tzname.patch
COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/patch_mingw.patch
COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/disable_exiv_apps.diff
COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/gcccheck.patch
INSTALL_DIR ${PREFIX_ext_exiv2}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PREFIX_ext_exiv2} -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} ${GLOBAL_PROFILE} -DEXIV2_ENABLE_BUILD_SAMPLES=OFF -DEXIV2_ENABLE_BUILD_PO=OFF -DEXIV2_ENABLE_NLS=OFF -DICONV_INCLUDE_DIR=${PREFIX_ext_exiv2}/include -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DANDROID_PLATFORM=${ANDROID_PLATFORM} -DEXPAT_LIBRARY=$ENV{KRITA_ROOT}/i/lib/libexpat.so -DEXPAT_INCLUDE_DIR=$ENV{KRITA_ROOT}/i/include
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PREFIX_ext_exiv2} -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} ${GLOBAL_PROFILE} -DEXIV2_ENABLE_BUILD_SAMPLES=OFF -DEXIV2_ENABLE_BUILD_PO=OFF -DEXIV2_ENABLE_NLS=OFF -DICONV_INCLUDE_DIR=${PREFIX_ext_exiv2}/include -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DANDROID_PLATFORM=${ANDROID_PLATFORM} -DEXPAT_LIBRARY=$ENV{BUILD_ROOT}/i/lib/libexpat.so -DEXPAT_INCLUDE_DIR=$ENV{BUILD_ROOT}/i/include
UPDATE_COMMAND ""
DEPENDS ext_iconv ext_expat
......@@ -27,7 +28,8 @@ ExternalProject_Add( ext_exiv2
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/tzname.patch
COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/patch_mingw.patch
COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/disable_exiv_apps.diff
COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/gcccheck.patch
INSTALL_DIR ${PREFIX_ext_exiv2}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PREFIX_ext_exiv2} -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} ${GLOBAL_PROFILE} -DEXIV2_ENABLE_BUILD_SAMPLES=OFF -DEXIV2_ENABLE_BUILD_PO=OFF -DEXIV2_ENABLE_NLS=OFF -DICONV_INCLUDE_DIR=${PREFIX_ext_exiv2}/include
......
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7034bb6..9115197 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -73,25 +73,10 @@ IF( MINGW OR UNIX )
-Wmissing-format-attribute
-Woverloaded-virtual
-W
+ -std=c++98
)
ENDIF()
- execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version OUTPUT_VARIABLE COMPILER_VERSION)
- string(REGEX MATCHALL "[a-z\+]+" GCC_COMPILER_COMPONENTS ${COMPILER_VERSION})
- list(GET GCC_COMPILER_COMPONENTS 0 COMPILER)
-
- execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
- string(REGEX MATCHALL "[0-9]+" GCC_VERSION_COMPONENTS ${GCC_VERSION})
- list(GET GCC_VERSION_COMPONENTS 0 GCC_MAJOR)
- list(GET GCC_VERSION_COMPONENTS 1 GCC_MINOR)
-
- message(STATUS Compiler: ${COMPILER} " Major:" ${GCC_MAJOR} " Minor:" ${GCC_MINOR})
-
- IF ( CYGWIN OR ( ${GCC_MAJOR} GREATER 5 ))
- ADD_DEFINITIONS( -std=gnu++98 ) # to support snprintf
- ELSE()
- ADD_DEFINITIONS( -std=c++98 )
- ENDIF()
ENDIF( MINGW OR UNIX )
SET(PREFIX_ext_gettext "${EXTPREFIX}" )
if (MINGW)
ExternalProject_Add(
ext_gettext
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://files.kde.org/krita/build/dependencies/gettext-0.18.tar.gz
URL_MD5 d52a3e061032a1ed13856d42fc86f0fd
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
ExternalProject_Add(ext_gettext_bin
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://files.kde.org/krita/build/dependencies/gettext0.19.8.1-iconv1.15-static-64.zip
URL_MD5 3f8298041738b8ec1f7278d147b7cd3d
PATCH_COMMAND ${PATCH_COMMAND} --binary -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/gettext-0.18-20130319.diff
INSTALL_DIR ${PREFIX_ext_gettext}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PREFIX_ext_gettext} -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} ${GLOBAL_PROFILE}
BUILD_COMMAND ${CMAKE_COMMAND} -E echo Deploying gettext 64-bit dependencies
CONFIGURE_COMMAND ""
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory <SOURCE_DIR> ${PREFIX_ext_gettext}
UPDATE_COMMAND ""
)
else("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
ExternalProject_Add(ext_gettext_bin
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://files.kde.org/krita/build/dependencies/gettext0.19.8.1-iconv1.15-static-32.zip
URL_MD5 970afaea0d433a73a996d709d5c22f6d
UPDATE_COMMAND ""
DEPENDS ext_patch ext_iconv
)
BUILD_COMMAND ${CMAKE_COMMAND} -E echo Deploying gettext 64-bit dependencies
CONFIGURE_COMMAND ""
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory <SOURCE_DIR> ${PREFIX_ext_gettext}
UPDATE_COMMAND ""
)
endif()
ExternalProject_Add (
ext_gettext_lib
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL https://ftp.gnu.org/gnu/gettext/gettext-0.18.tar.gz
URL_MD5 d52a3e061032a1ed13856d42fc86f0fd
PATCH_COMMAND ${PATCH_COMMAND} --binary -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/gettext-0.18-20130319.diff
INSTALL_DIR ${PREFIX_ext_gettext}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PREFIX_ext_gettext} -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} ${GLOBAL_PROFILE}
UPDATE_COMMAND ""
DEPENDS ext_patch ext_iconv
)
add_custom_target(ext_gettext)
add_dependencies(ext_gettext ext_gettext_bin ext_gettext_lib)
else (MINGW)
ExternalProject_Add( ext_gettext
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://files.kde.org/krita/build/dependencies/gettext-0.19.8.tar.gz
URL_MD5 e4fffc004f21596becd1055cf36be31d
INSTALL_DIR ${PREFIX_ext_gettext}
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=${PREFIX_ext_gettext} --disable-java ${GLOBAL_AUTOMAKE_PROFILE} --disable-native-java
BUILD_COMMAND make
INSTALL_COMMAND make install
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://files.kde.org/krita/build/dependencies/gettext-0.19.8.tar.gz
URL_MD5 e4fffc004f21596becd1055cf36be31d
INSTALL_DIR ${PREFIX_ext_gettext}
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=${PREFIX_ext_gettext} --disable-java ${GLOBAL_AUTOMAKE_PROFILE} --disable-native-java
BUILD_COMMAND make
INSTALL_COMMAND make install
UPDATE_COMMAND ""
DEPENDS ext_iconv
UPDATE_COMMAND ""
DEPENDS ext_iconv
)
endif (MINGW)
......@@ -3,8 +3,8 @@ SET(PREFIX_ext_gmic "${EXTPREFIX}" )
# Download the gmic sources
ExternalProject_Add( ext_gmic_base
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL https://gmic.eu/files/source/gmic_2.4.5.tar.gz
URL_MD5 e1bc34379800d9b1330419a695824caf
URL https://gmic.eu/files/source/gmic_2.5.6.tar.gz
URL_MD5 8deabebc29081657986ae6531e3fc1d7
SOURCE_DIR gmic
......@@ -19,8 +19,8 @@ ExternalProject_Add( ext_gmic_base
# FIXME: Forcing CMAKE_BUILD_TYPE to Release
ExternalProject_Add( ext_gmic_qt
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL https://github.com/c-koi/gmic-qt/archive/v.2.4.5.tar.gz
URL_MD5 664ecce5516c2f7995882487b317dcb0
URL https://github.com/c-koi/gmic-qt/archive/v.2.5.6.tar.gz
URL_MD5 4e7cf71d6348d44f98d3c132433c358c
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/desktop_icon.diff
SOURCE_DIR gmic-qt
......
SET(EXTPREFIX_heif "${EXTPREFIX}" )
ExternalProject_Add(
ext_libde265
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL https://github.com/strukturag/libde265/releases/download/v1.0.3/libde265-1.0.3.tar.gz
URL_MD5 0e1e26ffcb2177c3749c748e20fcd588
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=${EXTPREFIX_heif} ${GLOBAL_AUTOMAKE_PROFILE}
BUILD_COMMAND make
INSTALL_COMMAND make install
UPDATE_COMMAND ""
)
ExternalProject_Add(
ext_yasm
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
URL_MD5 fc9e586751ff789b34b1f21d572d96af
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=${EXTPREFIX_heif} ${GLOBAL_AUTOMAKE_PROFILE}
BUILD_COMMAND make
INSTALL_COMMAND make install
UPDATE_COMMAND ""
)
ExternalProject_Add(
ext_nasm
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL https://www.nasm.us/pub/nasm/releasebuilds/2.14.03rc2/nasm-2.14.03rc2.tar.gz
URL_MD5 4cd1fe6788cd15d08c1a8f18b6d2428e
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=${EXTPREFIX_heif} ${GLOBAL_AUTOMAKE_PROFILE}
BUILD_COMMAND make
INSTALL_COMMAND make install
UPDATE_COMMAND ""
)
ExternalProject_Add(
ext_libx265
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://ftp.videolan.org/pub/videolan/x265/x265_3.0.tar.gz
URL_MD5 8ff1780246bb7ac8506239f6129c04ec
INSTALL_DIR ${EXTPREFIX_heif}
SOURCE_SUBDIR source/
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_heif}
BUILD_COMMAND make
INSTALL_COMMAND make install
UPDATE_COMMAND ""
DEPENDS ext_yasm ext_nasm
)
ExternalProject_Add(
ext_libheif
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL https://github.com/strukturag/libheif/releases/download/v1.4.0/libheif-1.4.0.tar.gz
URL_MD5 b3c726609a8750c5fc1687a7b193adff
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=${EXTPREFIX_heif} ${GLOBAL_AUTOMAKE_PROFILE}
BUILD_COMMAND CXXFLAGS="-Wno-error" make
INSTALL_COMMAND make install
UPDATE_COMMAND ""
DEPENDS ext_libde265 ext_libx265 ext_pkgconfig
)
......@@ -11,3 +11,16 @@ index b05c7e4..8577e54 100644
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
endif(CMAKE_COMPILER_IS_GNUCXX)
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 1eb691b..cff9bd8 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -23,8 +23,6 @@ if(WIN32)
if("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
set(EXTERNAL_COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS} /WX")
endif()
-else()
- set(EXTERNAL_COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS} -Werror")
endif()
# SHARED
SET(PREFIX_ext_openssl "${EXTPREFIX}" )
ExternalProject_Add( ext_openssl
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL https://www.openssl.org/source/openssl-1.1.1b.tar.gz
URL_HASH SHA1=e9710abf5e95c48ebf47991b10cbb48c09dae102
if (WIN32)
CONFIGURE_COMMAND <SOURCE_DIR>/config --prefix=${PREFIX_ext_openssl} --openssldir=ssl
# Use the binaries from curl for Windows (https://github.com/curl/curl-for-win).
# The original source URLs are:
# - https://curl.haxx.se/windows/dl-7.64.1/openssl-1.1.1b-win64-mingw.zip
# - https://curl.haxx.se/windows/dl-7.64.1/openssl-1.1.1b-win32-mingw.zip
if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
ExternalProject_Add(ext_openssl
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL https://files.kde.org/krita/build/dependencies/openssl-1.1.1b-win64-mingw.zip
URL_MD5 2dd7041cdcdfb44ad395fd6d4db216a2
BUILD_COMMAND make depend COMMAND make
INSTALL_COMMAND make install
BUILD_COMMAND ${CMAKE_COMMAND} -E echo Deploying openssl 64-bit dependencies
CONFIGURE_COMMAND ""
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory <SOURCE_DIR>/include ${PREFIX_ext_openssl}/include
COMMAND ${CMAKE_COMMAND} -E copy <SOURCE_DIR>/lib/libcrypto.dll.a ${PREFIX_ext_openssl}/lib
COMMAND ${CMAKE_COMMAND} -E copy <SOURCE_DIR>/lib/libssl.dll.a ${PREFIX_ext_openssl}/lib
COMMAND ${CMAKE_COMMAND} -E copy <SOURCE_DIR>/libcrypto-1_1-x64.dll ${PREFIX_ext_openssl}/bin
COMMAND ${CMAKE_COMMAND} -E copy <SOURCE_DIR>/libssl-1_1-x64.dll ${PREFIX_ext_openssl}/bin
UPDATE_COMMAND ""
)
else ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
ExternalProject_Add(ext_openssl
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL https://files.kde.org/krita/build/dependencies/openssl-1.1.1b-win32-mingw.zip
URL_MD5 24021021fb27c357f0728844cfce3927
INSTALL_DIR ${PREFIX_ext_openssl}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PREFIX_ext_fftw3} -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} ${GLOBAL_PROFILE}
BUILD_COMMAND ${CMAKE_COMMAND} -E echo Deploying openssl 32-bit dependencies
CONFIGURE_COMMAND ""
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory <SOURCE_DIR>/include ${PREFIX_ext_openssl}/include
COMMAND ${CMAKE_COMMAND} -E copy <SOURCE_DIR>/lib/libcrypto.dll.a ${PREFIX_ext_openssl}/lib
COMMAND ${CMAKE_COMMAND} -E copy <SOURCE_DIR>/lib/libssl.dll.a ${PREFIX_ext_openssl}/lib
COMMAND ${CMAKE_COMMAND} -E copy <SOURCE_DIR>/libcrypto-1_1.dll ${PREFIX_ext_openssl}/bin
COMMAND ${CMAKE_COMMAND} -E copy <SOURCE_DIR>/libssl-1_1.dll ${PREFIX_ext_openssl}/bin
UPDATE_COMMAND ""
)
endif ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
UPDATE_COMMAND ""
)
\ No newline at end of file
else (WIN32)
ExternalProject_Add( ext_openssl
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL https://www.openssl.org/source/openssl-1.1.1b.tar.gz
URL_HASH SHA1=e9710abf5e95c48ebf47991b10cbb48c09dae102
CONFIGURE_COMMAND <SOURCE_DIR>/config --prefix=${PREFIX_ext_openssl} --openssldir=ssl
BUILD_COMMAND make depend COMMAND make
INSTALL_COMMAND make install
INSTALL_DIR ${PREFIX_ext_openssl}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PREFIX_ext_fftw3} -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} ${GLOBAL_PROFILE}
UPDATE_COMMAND ""
)
endif (WIN32)
SET(PREFIX_pkgconfig "${EXTPREFIX}" )
ExternalProject_Add( ext_pkgconfig
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://pkgconfig.freedesktop.org/releases/pkg-config-0.29.1.tar.gz
URL_MD5 f739a28cae4e0ca291f82d1d41ef107d
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=${PREFIX_pkgconfig} ${GLOBAL_AUTOMAKE_PROFILE} --with-internal-glib
BUILD_COMMAND make
INSTALL_COMMAND make install
)
SET(PREFIX_ext_pyqt "${EXTPREFIX}" )
if (UNIX)
SET(PYTHON_EXECUTABLE_PATH ${PREFIX_ext_sip}/bin/python3)
SET(PYTHON_EXECUTABLE_PATH ${PREFIX_ext_pyqt}/bin/python3)
if(NOT EXISTS ${PYTHON_EXECUTABLE_PATH})
message("WARNING: using system python3!")
SET(PYTHON_EXECUTABLE_PATH python3)
endif()
ExternalProject_Add( ext_pyqt
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL https://www.riverbankcomputing.com/static/Downloads/PyQt5/PyQt5_gpl-5.12.zip
URL_MD5 102062aff7435c03114e02c456dfd01f
URL https://www.riverbankcomputing.com/static/Downloads/PyQt5/5.12.1/PyQt5_gpl-5.12.1.tar.gz
URL_MD5 67508b652098d2e05c4c2b5baeb170cc
CONFIGURE_COMMAND ${PYTHON_EXECUTABLE_PATH} <SOURCE_DIR>/configure.py --confirm-license --qmake ${PREFIX_ext_pyqt}/bin/qmake --sip ${PREFIX_ext_pyqt}/bin/sip --sip-incdir ${PREFIX_ext_pyqt}/include --sipdir ${PREFIX_ext_pyqt}/share/sip
BUILD_COMMAND make
......@@ -37,8 +37,9 @@ elseif(MINGW)
)
ExternalProject_Add( ext_pyqt
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL https://www.riverbankcomputing.com/static/Downloads/PyQt5/PyQt5_gpl-5.12.tar.gz
URL_MD5 757161fc19a2da788962fbc5d18480c0
URL https://www.riverbankcomputing.com/static/Downloads/PyQt5/5.12.1/PyQt5_gpl-5.12.1.zip
URL_MD5 0b2912828a4d59e13d86decdce1687e6
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/pyqt-configure-fix.patch
CONFIGURE_COMMAND ${PYTHON_EXECUTABLE} <SOURCE_DIR>/configure.py ${_PYQT_conf}
......
From 9ef8cb9a95962864dc4bd506b9a2cdb462b0c908 Mon Sep 17 00:00:00 2001
From: Dmitry Kazakov <dimula73@gmail.com>
Date: Thu, 4 Apr 2019 19:11:47 +0300
Subject: [PATCH] Fix swizzling when rendering QPainter on QOpenGLWidget with
Angle
OpenGLES specification does not support GL_TEXTURE_SWIZZLE_RGBA,
it supports only per-channel calls. And since Qt supports QpenGLES,
it should use the latter approach only.
The regression was introduced in Qt 5.12 by commit
ede3791df8330ed8daae6667d025ad40219a9f5f
Task-number: QTBUG-74968
---
src/gui/opengl/qopengltexture.cpp | 12 ++++----
src/gui/opengl/qopengltextureuploader.cpp | 36 ++++++++++-------------
2 files changed, 22 insertions(+), 26 deletions(-)
diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp
index 5b7956d3..a33d4763 100644
--- a/src/gui/opengl/qopengltexture.cpp
+++ b/src/gui/opengl/qopengltexture.cpp
@@ -4015,12 +4015,12 @@ void QOpenGLTexture::setSwizzleMask(SwizzleValue r, SwizzleValue g,
qWarning("QOpenGLTexture::setSwizzleMask() requires OpenGL >= 3.3");
return;
}
- GLint swizzleMask[] = {GLint(r), GLint(g), GLint(b), GLint(a)};
- d->swizzleMask[0] = r;
- d->swizzleMask[1] = g;
- d->swizzleMask[2] = b;
- d->swizzleMask[3] = a;
- d->texFuncs->glTextureParameteriv(d->textureId, d->target, d->bindingTarget, GL_TEXTURE_SWIZZLE_RGBA, swizzleMask);
+
+ d->texFuncs->glTextureParameteri(d->textureId, d->target, d->bindingTarget, GL_TEXTURE_SWIZZLE_R, GLint(r));
+ d->texFuncs->glTextureParameteri(d->textureId, d->target, d->bindingTarget, GL_TEXTURE_SWIZZLE_G, GLint(g));
+ d->texFuncs->glTextureParameteri(d->textureId, d->target, d->bindingTarget, GL_TEXTURE_SWIZZLE_B, GLint(b));
+ d->texFuncs->glTextureParameteri(d->textureId, d->target, d->bindingTarget, GL_TEXTURE_SWIZZLE_A, GLint(a));
+
return;
}
#else
diff --git a/src/gui/opengl/qopengltextureuploader.cpp b/src/gui/opengl/qopengltextureuploader.cpp
index 42e309b7..8d204ddc 100644
--- a/src/gui/opengl/qopengltextureuploader.cpp
+++ b/src/gui/opengl/qopengltextureuploader.cpp
@@ -77,10 +77,6 @@
#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
#endif
-#ifndef GL_TEXTURE_SWIZZLE_RGBA
-#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46
-#endif
-
#ifndef GL_SRGB
#define GL_SRGB 0x8C40
#endif
@@ -114,14 +110,10 @@ qsizetype QOpenGLTextureUploader::textureImage(GLenum target, const QImage &imag
externalFormat = GL_BGRA;
internalFormat = GL_RGBA;
pixelType = GL_UNSIGNED_INT_8_8_8_8_REV;
- } else if (funcs->hasOpenGLExtension(QOpenGLExtensions::TextureSwizzle)) {
-#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
- GLint swizzle[4] = { GL_BLUE, GL_GREEN, GL_RED, GL_ALPHA };
- funcs->glTexParameteriv(target, GL_TEXTURE_SWIZZLE_RGBA, swizzle);
-#else
- GLint swizzle[4] = { GL_GREEN, GL_BLUE, GL_ALPHA, GL_RED };
- funcs->glTexParameteriv(target, GL_TEXTURE_SWIZZLE_RGBA, swizzle);
-#endif
+ } else if (funcs->hasOpenGLExtension(QOpenGLExtensions::TextureSwizzle) && (isOpenGL12orBetter || isOpenGLES3orBetter)) {
+ funcs->glTexParameteri(target, GL_TEXTURE_SWIZZLE_B, GL_RED);
+ funcs->glTexParameteri(target, GL_TEXTURE_SWIZZLE_R, GL_BLUE);
+
externalFormat = internalFormat = GL_RGBA;
pixelType = GL_UNSIGNED_BYTE;
} else {
@@ -173,8 +165,8 @@ qsizetype QOpenGLTextureUploader::textureImage(GLenum target, const QImage &imag
pixelType = GL_UNSIGNED_INT_2_10_10_10_REV;
externalFormat = GL_RGBA;
internalFormat = GL_RGB10_A2;
- GLint swizzle[4] = { GL_BLUE, GL_GREEN, GL_RED, GL_ALPHA };
- funcs->glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, swizzle);
+ funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED);
+ funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_BLUE);
targetFormat = image.format();
}
break;
@@ -231,9 +223,11 @@ qsizetype QOpenGLTextureUploader::textureImage(GLenum target, const QImage &imag
externalFormat = internalFormat = GL_ALPHA;
pixelType = GL_UNSIGNED_BYTE;
targetFormat = image.format();
- } else if (funcs->hasOpenGLExtension(QOpenGLExtensions::TextureSwizzle)) {
- GLint swizzle[4] = { GL_ZERO, GL_ZERO, GL_ZERO, GL_RED };
- funcs->glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, swizzle);
+ } else if (funcs->hasOpenGLExtension(QOpenGLExtensions::TextureSwizzle) && (isOpenGL12orBetter || isOpenGLES3orBetter)) {
+ funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_ALPHA);
+ funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, GL_ZERO);
+ funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_ZERO);
+ funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_ZERO);
externalFormat = internalFormat = GL_RED;
pixelType = GL_UNSIGNED_BYTE;
targetFormat = image.format();
@@ -251,9 +245,11 @@ qsizetype QOpenGLTextureUploader::textureImage(GLenum target, const QImage &imag
externalFormat = internalFormat = GL_LUMINANCE;
pixelType = GL_UNSIGNED_BYTE;
targetFormat = image.format();
- } else if (funcs->hasOpenGLExtension(QOpenGLExtensions::TextureSwizzle)) {
- GLint swizzle[4] = { GL_RED, GL_RED, GL_RED, GL_ONE };
- funcs->glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, swizzle);
+ } else if (funcs->hasOpenGLExtension(QOpenGLExtensions::TextureSwizzle) && (isOpenGL12orBetter || isOpenGLES3orBetter)) {
+ funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_RED);
+ funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, GL_RED);
+ funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED);
+ funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_ONE);
externalFormat = internalFormat = GL_RED;
pixelType = GL_UNSIGNED_BYTE;
targetFormat = image.format();
--
2.20.1.windows.1