Commit 5bcb3b2d authored by Alvin Wong's avatar Alvin Wong 🤔
Browse files

Merge branch 'alvin/T6976-angle-3.3' into krita/3.3

This adds canvas rendering with Direct3D11 via ANGLE on Windows.

ANGLE is a library which translates OpenGL ES rendering functions to
other hardware rendering APIs, including Direct3D. It is supported by
the Windows build of Qt.

This aims to improve the compatibility of the OpenGL canvas with buggy
Windows Intel drivers by allowing the use of the Direct3D11 rendering
backend of ANGLE.

Krita can still be used with a Qt build without dynamic OpenGL support,
but it will only be able to use native desktop OpenGL. To enable ANGLE,
`ext_qt` will need to be rebuilt. `ext_qt` target on Windows is also
upgraded to Qt 5.9.1, and to build it with ANGLE properly one would need
to use mingw-w64 7.1 and have Windows 10 SDK installed.

CCMAIL: kimageshop@kde.org
CCBUG: 360601
Maniphest Tasks: T5883, T6696, T6728, T6976
parents 17e2cf0b ebeeb080
......@@ -11,6 +11,10 @@ project (krita-and-all-its-deps)
cmake_minimum_required(VERSION 2.8.6)
if(NOT SUBMAKE_JOBS)
set(SUBMAKE_JOBS 1)
endif(NOT SUBMAKE_JOBS)
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "Compiling in the source directory is not supported. Use for example 'mkdir build; cd build; cmake ..'.")
endif (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
......@@ -47,6 +51,18 @@ message( STATUS "CMAKE_CL_64: ${CMAKE_CL_64}")
set(GLOBAL_BUILD_TYPE RelWithDebInfo)
set(GLOBAL_PROFILE ${GLOBAL_PROFILE} -DBUILD_TESTING=false)
if (MINGW)
option(QT_ENABLE_DEBUG_INFO "Build Qt with debug info included" OFF)
option(QT_ENABLE_DYNAMIC_OPENGL "Build Qt with dynamic ANGLE support '-opengl dynamic -angle' (needs env var 'WindowsSdkDir' set to path of Windows 10 SDK)" ON)
if (QT_ENABLE_DYNAMIC_OPENGL)
if (DEFINED ENV{WindowsSdkDir})
message(STATUS "WindowsSdkDir is set to '$ENV{WindowsSdkDir}'")
else (DEFINED ENV{WindowsSdkDir})
message(FATAL_ERROR "Environemnt variable 'WindowsSdkDir' not set! Please set it to path of Windows 10 SDK or disable QT_ENABLE_DYNAMIC_OPENGL")
endif (DEFINED ENV{WindowsSdkDir})
endif (QT_ENABLE_DYNAMIC_OPENGL)
endif (MINGW)
if (MSVC)
set(GLOBAL_PROFILE ${GLOBAL_PROFILE} -DCMAKE_EXE_LINKER_FLAGS=/PROFILE -DCMAKE_SHARED_LINKER_FLAGS=/PROFILE)
set(PATCH_COMMAND myptch)
......
......@@ -25,8 +25,15 @@ Note: on all operating systems the entire procedure is done in a terminal window
3. Make sure you have a compiler:
* Linux: gcc, minimum version 4.8
* OSX: clang, you need to install xcode for this
* Windows: (http://tdm-gcc.tdragon.net/, version 5.1). MSVC cannot build G'Mic correctly. Remember to install the OpenMP plugin in tdm-gcc. Make sure mingw's bin folder is in your path.
4. If you compile Qt on Windows, you will also need Python: https://www.python.org. Make sure to have python.exe in your path.
* Windows: mingw-w64 7.1 (by mingw-builds)
- 32-bit (x86) target: https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/7.1.0/threads-posix/dwarf/
- 64-bit (x64) target: https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/7.1.0/threads-posix/seh/
Make sure mingw's bin folder is in your path. It might be a good
idea to create a batch file which sets the path and start cmd.
MSVC is *not* supported at the moment.
4. On Windows, if you want to compile Qt with ANGLE support, you will need to install Windows 10 SDK and have the environment variable `WindowsSdkDir` set to it (typically `C:\Program Files (x86)\Windows Kits\10`)
== Setup your environment ==
......@@ -66,17 +73,16 @@ Note: on all operating systems the entire procedure is done in a terminal window
-DINSTALL_ROOT=$BUILDROOT/i
* Windows 32 bits:
TODO
* Windows 64 bits:
* Windows 32-bit / 64-bit:
Note that the cmake command needs to point to your BUILDROOT like /dev/d, not c:\dev\d.
set PATH=BUILDROOT\i\bin\;BUILDROOT\i\lib;%PATH%
cmake ..\krita\3rdparty -DEXTERNALS_DOWNLOAD_DIR=/dev/d -DINSTALL_ROOT=/dev/i -G "MinGW Makefiles"
- If you don't have Windows 10 SDK and don't want to build Qt with ANGLE, add
`-DQT_ENABLE_DYNAMIC_OPENGL=OFF` to the CMake command line args.
3. build the packages:
With a judicious application of DEPENDS statements, it's possible to build it all in one go, but in my experience that fails always, so it's better to build the dependencies independently.
......@@ -98,13 +104,6 @@ On all operating systems:
cmake --build . --config RelWithDebInfo --target ext_eigen3
cmake --build . --config RelWithDebInfo --target ext_exiv2
cmake --build . --config RelWithDebInfo --target ext_fftw3
On Windows:
set FFTW_LIB_DIR=%BUILDROOT%\i\lib
dlltool.exe -k --output-lib %FFTW_LIB_DIR%\libfftw3-3.a --input-def %FFTW_LIB_DIR%\libfftw3-3.def
dlltool.exe -k --output-lib %FFTW_LIB_DIR%\libfftw3f-3.a --input-def %FFTW_LIB_DIR%\libfftw3f-3.def
dlltool.exe -k --output-lib %FFTW_LIB_DIR%\libfftw3l-3.a --input-def %FFTW_LIB_DIR%\libfftw3l-3.def
On all operating systems
......
......@@ -8,7 +8,7 @@ if (MSVC)
URL_MD5 015ae4afa6f3e597232bfe1dab949ace
CONFIGURE_COMMAND <SOURCE_DIR>/bootstrap.bat --prefix=${PREFIX_ext_boost}
BUILD_COMMAND <SOURCE_DIR>/b2.exe --with-system --build-dir=build-dir --prefix=${PREFIX_ext_boost} toolset=msvc-14.0 variant=release link=shared threading=multi architecture=x86 address-model=64 variant=release install
BUILD_COMMAND <SOURCE_DIR>/b2.exe -j${SUBMAKE_JOBS} --with-system --build-dir=build-dir --prefix=${PREFIX_ext_boost} toolset=msvc-14.0 variant=release link=shared threading=multi architecture=x86 address-model=64 variant=release install
INSTALL_COMMAND ""
INSTALL_DIR ${EXTPREFIX_boost}
......@@ -32,7 +32,7 @@ if (MSVC)
URL_MD5 015ae4afa6f3e597232bfe1dab949ace
CONFIGURE_COMMAND <SOURCE_DIR>/bootstrap.bat --prefix=${PREFIX_ext_boost}
BUILD_COMMAND <SOURCE_DIR>/b2.exe --with-system --build-dir=build-dir --prefix=${PREFIX_ext_boost} toolset=msvc-14.0 variant=release link=shared threading=multi architecture=x86 variant=release install
BUILD_COMMAND <SOURCE_DIR>/b2.exe -j${SUBMAKE_JOBS} --with-system --build-dir=build-dir --prefix=${PREFIX_ext_boost} toolset=msvc-14.0 variant=release link=shared threading=multi architecture=x86 variant=release install
INSTALL_COMMAND ""
INSTALL_DIR ${EXTPREFIX_boost}
......@@ -58,7 +58,7 @@ elseif(MINGW)
URL_MD5 015ae4afa6f3e597232bfe1dab949ace
CONFIGURE_COMMAND <SOURCE_DIR>/bootstrap.bat gcc --prefix=${PREFIX_ext_boost}
BUILD_COMMAND <SOURCE_DIR>/b2.exe --with-system --build-dir=build-dir --prefix=${PREFIX_ext_boost} toolset=gcc variant=release link=shared threading=multi architecture=x86 variant=release install
BUILD_COMMAND <SOURCE_DIR>/b2.exe -j${SUBMAKE_JOBS} --with-system --build-dir=build-dir --prefix=${PREFIX_ext_boost} toolset=gcc variant=release link=shared threading=multi architecture=x86 variant=release install
INSTALL_COMMAND ""
INSTALL_DIR ${EXTPREFIX_boost}
......@@ -79,7 +79,7 @@ else()
URL_MD5 6095876341956f65f9d35939ccea1a9f
CONFIGURE_COMMAND <SOURCE_DIR>/bootstrap.sh --prefix=${PREFIX_ext_boost} --with-libraries=system
BUILD_COMMAND <SOURCE_DIR>/b2 install
BUILD_COMMAND <SOURCE_DIR>/b2 -j${SUBMAKE_JOBS} install
INSTALL_COMMAND ""
INSTALL_DIR ${PREFIX_ext_boost}
......
......@@ -109,6 +109,7 @@ ExternalProject_Add(
URL_MD5 2885878625b19ad0300ef3770b897112
INSTALL_DIR ${EXTPREFIX_frameworks}
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/desktoptojson.diff
COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/kcoreaddons-compile-fix.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_frameworks}
-DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE}
${GLOBAL_PROFILE}
......
commit e0ea4199bc4da359eb91ab51274785d17a4f2909
Author: Ralf Habacker <ralf.habacker@freenet.de>
Date: Wed Sep 21 13:38:03 2016 +0200
Windows compile fix.
diff --git a/src/lib/util/kuser_win.cpp b/src/lib/util/kuser_win.cpp
index 1d77f89..5c3fa45 100644
--- a/src/lib/util/kuser_win.cpp
+++ b/src/lib/util/kuser_win.cpp
@@ -853,7 +853,7 @@ static std::unique_ptr<char[]> queryProcessInformation(TOKEN_INFORMATION_CLASS t
HANDLE _token;
if (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &_token)) {
qWarning("Failed to get the token for the current process: %d", (int)GetLastError());
- return false;
+ return nullptr;
}
ScopedHANDLE token(_token, handleCloser);
// query required size
SET(EXTPREFIX_qt "${EXTPREFIX}")
if (WIN32)
list(APPEND _QT_conf -skip qt3d -skip qtactiveqt -skip qtcanvas3d
-skip qtconnectivity -skip qtdoc -skip qtenginio -skip qtgraphicaleffects
-skip qtlocation -skip qtsensors -skip qtserialport -skip qtwayland
-skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview
-skip qtxmlpatterns -no-sql-sqlite -nomake examples -nomake tools
-no-compile-examples -no-dbus -no-iconv -no-qml-debug -no-ssl
-no-openssl -no-libproxy -no-system-proxies -no-icu -no-mtdev
-skip qtcharts -skip qtdatavis3d -skip qtgamepad -skip qtnetworkauth
-skip qtpurchasing -skip qtremoteobjects -skip qtscxml -skip qtserialbus
-skip qtspeech -skip qtvirtualkeyboard
#
-qt-zlib -qt-pcre -qt-libpng -qt-libjpeg
#
-opensource -confirm-license
#
-release -platform win32-g++ -prefix ${EXTPREFIX_qt}
)
if (QT_ENABLE_DEBUG_INFO)
# Set the option to build Qt with debugging info enabled
list(APPEND _QT_conf -force-debug-info)
endif(QT_ENABLE_DEBUG_INFO)
if (QT_ENABLE_DYNAMIC_OPENGL)
list(APPEND _QT_conf -opengl dynamic -angle)
else (QT_ENABLE_DYNAMIC_OPENGL)
list(APPEND _QT_conf -opengl desktop -no-angle)
endif (QT_ENABLE_DYNAMIC_OPENGL)
ExternalProject_Add(
ext_qt
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL https://download.qt.io/official_releases/qt/5.6/5.6.1-1/single/qt-everywhere-opensource-src-5.6.1-1.zip
URL_MD5 9d7ea0cadcec7b5a63e8e83686756978
URL https://download.qt.io/archive/qt/5.9/5.9.1/single/qt-everywhere-opensource-src-5.9.1.zip
URL_MD5 3f2e538ccc468d28bcfdefac96d1e975
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/disable-wintab.diff
COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/qtgui-private-headers.diff
COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/0001-Don-t-request-the-MIME-image-every-time-Windows-asks.patch
COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/0002-Hack-always-return-we-support-DIBV5.patch
COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/0003-Hack-for-fullscreen-workaround.patch
COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/qopengldebug-gles.patch
COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/gerrit-189539-ANGLE-mingw-fix.patch
COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/gerrit-198123-dialog-shortcut-fix.patch
INSTALL_DIR ${EXTPREFIX_qt}
CONFIGURE_COMMAND <SOURCE_DIR>/configure.bat -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdoc -skip qtenginio -skip qtgraphicaleffects -skip qtlocation -skip qtsensors -skip qtserialport -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip qtxmlpatterns -no-sql-sqlite -nomake examples -nomake tools -no-compile-examples -no-dbus -no-iconv -no-angle -no-ssl -no-openssl -no-wmf-backend -no-qml-debug -no-libproxy -no-system-proxies -no-nis -no-icu -no-mtdev -opensource -confirm-license -release -opengl desktop -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -prefix ${EXTPREFIX_qt} -platform win32-g++
CONFIGURE_COMMAND <SOURCE_DIR>/configure.bat ${_QT_conf}
# use this line for building Qt with debugging info enabled
#CONFIGURE_COMMAND <SOURCE_DIR>/configure.bat -release -force-debug-info -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdoc -skip qtenginio -skip qtgraphicaleffects -skip qtlocation -skip qtsensors -skip qtserialport -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip qtxmlpatterns -no-sql-sqlite -nomake examples -nomake tools -no-compile-examples -no-dbus -no-iconv -no-angle -no-ssl -no-openssl -no-wmf-backend -no-qml-debug -no-libproxy -no-system-proxies -no-nis -no-icu -no-mtdev -opensource -confirm-license -release -opengl desktop -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -prefix ${EXTPREFIX_qt} -platform win32-g++
BUILD_COMMAND mingw32-make
INSTALL_COMMAND mingw32-make install
BUILD_COMMAND mingw32-make -j${SUBMAKE_JOBS}
INSTALL_COMMAND mingw32-make -j${SUBMAKE_JOBS} install
UPDATE_COMMAND ""
BUILD_IN_SOURCE 1
ALWAYS 0
# Use a short name to reduce the chance of exceeding path length limit
SOURCE_DIR s
BINARY_DIR b
DEPENDS ext_patch
)
elseif (NOT APPLE)
......
......@@ -2,21 +2,21 @@ diff --git a/qtbase/src/plugins/platforms/windows/qwindowscontext.cpp b/qtbase/s
index 4934b6c..613e8fe 100644
--- a/qtbase/src/plugins/platforms/windows/qwindowscontext.cpp
+++ b/qtbase/src/plugins/platforms/windows/qwindowscontext.cpp
@@ -299,9 +299,6 @@ struct QWindowsContextPrivate {
@@ -238,9 +238,6 @@
QWindowsMimeConverter m_mimeConverter;
QWindowsScreenManager m_screenManager;
QSharedPointer<QWindowCreationContext> m_creationContext;
-#if !defined(QT_NO_TABLETEVENT) && !defined(Q_OS_WINCE)
-#if QT_CONFIG(tabletevent)
- QScopedPointer<QWindowsTabletSupport> m_tabletSupport;
-#endif
const HRESULT m_oleInitializeResult;
const QByteArray m_eventType;
QWindow *m_lastActiveWindow;
@@ -346,17 +343,10 @@ QWindowsContext::QWindowsContext() :
QWindow *m_lastActiveWindow = nullptr;
@@ -279,17 +276,10 @@
const QByteArray bv = qgetenv("QT_QPA_VERBOSE");
if (!bv.isEmpty())
QLoggingCategory::setFilterRules(QString::fromLocal8Bit(bv));
-#if !defined(QT_NO_TABLETEVENT) && !defined(Q_OS_WINCE)
-#if QT_CONFIG(tabletevent)
- d->m_tabletSupport.reset(QWindowsTabletSupport::create());
- qCDebug(lcQpaTablet) << "Tablet support: " << (d->m_tabletSupport.isNull() ? QStringLiteral("None") : d->m_tabletSupport->description());
-#endif
......@@ -24,17 +24,17 @@ index 4934b6c..613e8fe 100644
QWindowsContext::~QWindowsContext()
{
-#if !defined(QT_NO_TABLETEVENT) && !defined(Q_OS_WINCE)
-#if QT_CONFIG(tabletevent)
- d->m_tabletSupport.reset(); // Destroy internal window before unregistering classes.
-#endif
unregisterWindowClasses();
if (d->m_oleInitializeResult == S_OK || d->m_oleInitializeResult == S_FALSE)
OleUninitialize();
@@ -397,12 +387,7 @@ bool QWindowsContext::initTouch(unsigned integrationOptions)
@@ -335,12 +325,7 @@
void QWindowsContext::setTabletAbsoluteRange(int a)
{
-#if !defined(QT_NO_TABLETEVENT) && !defined(Q_OS_WINCE)
-#if QT_CONFIG(tabletevent)
- if (!d->m_tabletSupport.isNull())
- d->m_tabletSupport->setAbsoluteRange(a);
-#else
......@@ -43,11 +43,11 @@ index 4934b6c..613e8fe 100644
}
int QWindowsContext::processDpiAwareness()
@@ -792,11 +777,7 @@ QWindowsScreenManager &QWindowsContext::screenManager()
@@ -700,11 +685,7 @@
QWindowsTabletSupport *QWindowsContext::tabletSupport() const
{
-#if !defined(QT_NO_TABLETEVENT) && !defined(Q_OS_WINCE)
-#if QT_CONFIG(tabletevent)
- return d->m_tabletSupport.data();
-#else
return 0;
......@@ -55,7 +55,7 @@ index 4934b6c..613e8fe 100644
}
/*!
@@ -1166,10 +1147,6 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
@@ -1077,10 +1058,6 @@
*result = LRESULT(MA_NOACTIVATE);
return true;
}
......@@ -64,5 +64,5 @@ index 4934b6c..613e8fe 100644
- d->m_tabletSupport->notifyActivate();
-#endif // !QT_NO_TABLETEVENT
if (platformWindow->testFlag(QWindowsWindow::BlockedByModal))
if (const QWindow *modalWindow = QGuiApplication::modalWindow())
QWindowsWindow::baseWindowOf(modalWindow)->alertWindow();
if (const QWindow *modalWindow = QGuiApplication::modalWindow()) {
QWindowsWindow *platformWindow = QWindowsWindow::windowsWindowOf(modalWindow);
diff --git a/qtbase/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp b/qtbase/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp
index 972c289412..cbb813b83f 100644
--- a/qtbase/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp
+++ b/qtbase/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp
@@ -20,7 +20,7 @@ typedef struct D3D11_QUERY_DATA_SO_STATISTICS {
} D3D11_QUERY_DATA_SO_STATISTICS;
#endif // ANGLE_MINGW32_COMPAT
-#ifdef __MINGW32__
+#if defined __MINGW32__ && __GNUC__ < 6L
typedef struct D3D11_QUERY_DATA_TIMESTAMP_DISJOINT {
UINT64 Frequency;
BOOL Disjoint;
diff --git a/qtbase/src/angle/src/common/common.pri b/qtbase/src/angle/src/common/common.pri
index 7305362d86..c1f6e22a87 100644
--- a/qtbase/src/angle/src/common/common.pri
+++ b/qtbase/src/angle/src/common/common.pri
@@ -21,20 +21,6 @@ lib_replace.replace = \$\$\$\$[QT_INSTALL_LIBS]
lib_replace.CONFIG = path
QMAKE_PRL_INSTALL_REPLACE += lib_replace
-# DirectX is included in the Windows 8 Kit, but everything else requires the DX SDK.
-winrt|msvc {
- FXC = fxc.exe
-} else {
- DX_DIR = $$(DXSDK_DIR)
- isEmpty(DX_DIR) {
- error("Cannot determine DirectX SDK location. Please set DXSDK_DIR environment variable.")
- }
-
- equals(QMAKE_TARGET.arch, x86_64) {
- FXC = \"$${DX_DIR}Utilities\\bin\\x64\\fxc.exe\"
- } else {
- FXC = \"$${DX_DIR}Utilities\\bin\\x86\\fxc.exe\"
- }
-}
+FXC = $$QMAKE_FXC_LOCATION
static: DEFINES *= LIBGLESV2_EXPORT_H_ ANGLE_EXPORT=
diff --git a/qtbase/src/gui/configure.json b/qtbase/src/gui/configure.json
index 2fb03a452a..a5f85e54ba 100644
--- a/qtbase/src/gui/configure.json
+++ b/qtbase/src/gui/configure.json
@@ -330,11 +330,14 @@
"label": "DirectX SDK",
"type": "directX",
"files": [
- "d3dcompiler.h",
- "d3d11.lib",
- "fxc.exe"
+ "d3dcompiler.h"
]
},
+ "fxc": {
+ "label": "DirectX Shader Compiler",
+ "type": "fxc",
+ "log": "value"
+ },
"egl-x11": {
"label": "EGL on X11",
"type": "compile",
@@ -440,10 +443,11 @@
"angle": {
"label": "ANGLE",
"autoDetect": "features.opengles2 || features.opengl-dynamic",
- "condition": "config.win32 && tests.directx",
+ "condition": "config.win32 && tests.directx && tests.fxc",
"output": [
"publicFeature",
- { "type": "define", "name": "QT_OPENGL_ES_2_ANGLE" }
+ { "type": "define", "name": "QT_OPENGL_ES_2_ANGLE" },
+ { "type": "varAssign", "name": "QMAKE_FXC_LOCATION", "value": "tests.fxc.value" }
]
},
"combined-angle-lib": {
diff --git a/qtbase/src/gui/configure.pri b/qtbase/src/gui/configure.pri
index aaffa835dc..c048129f55 100644
--- a/qtbase/src/gui/configure.pri
+++ b/qtbase/src/gui/configure.pri
@@ -15,22 +15,12 @@ defineTest(qtConfLibrary_freetype) {
return(true)
}
-# Check for Direct X SDK (include, lib, and direct shader compiler 'fxc').
-# Up to Direct X SDK June 2010 and for MinGW, this is pointed to by the
-# DXSDK_DIR variable. Starting with Windows Kit 8, it is included in
-# the Windows SDK. Checking for the header is not sufficient, since it
-# is also present in MinGW.
+# For MSVC everything DirectX related is included in Windows Kit >= 8,
+# so we do not do any magic in this case.
+# For MinGW we need the shader compiler (fxc.exe), which
+# are not part of MinGW. They can either be obtained from a DirectX SDK
+# (keep the old approach working) or Windows Kit (>= 8).
defineTest(qtConfTest_directX) {
- dxdir = $$getenv("DXSDK_DIR")
- !isEmpty(dxdir) {
- EXTRA_INCLUDEPATH += $$dxdir/include
- equals(QT_ARCH, x86_64): \
- EXTRA_LIBDIR += $$dxdir/lib/x64
- else: \
- EXTRA_LIBDIR += $$dxdir/lib/x86
- EXTRA_PATH += $$dxdir/Utilities/bin/x86
- }
-
$$qtConfEvaluate("features.sse2") {
ky = $$size($${1}.files._KEYS_)
$${1}.files._KEYS_ += $$ky
@@ -42,6 +32,50 @@ defineTest(qtConfTest_directX) {
return(false)
}
+defineTest(qtConfTest_fxc) {
+ !mingw {
+ fxc = $$qtConfFindInPath("fxc.exe")
+ } else {
+ dxdir = $$getenv("DXSDK_DIR")
+ winkitdir = $$getenv("WindowsSdkDir")
+ !isEmpty(dxdir) {
+ equals(QT_ARCH, x86_64): \
+ fxc = $$dxdir/Utilities/bin/x64/fxc.exe
+ else: \
+ fxc = $$dxdir/Utilities/bin/x86/fxc.exe
+ } else: !isEmpty(winkitdir) {
+ equals(QT_ARCH, x86_64): \
+ fxc = $$winkitdir/bin/x64/fxc.exe
+ else: \
+ fxc = $$winkitdir/bin/x86/fxc.exe
+
+ !exists($$fxc) {
+ binsubdirs = $$files($$winkitdir/bin/*)
+ for (dir, binsubdirs) {
+ equals(QT_ARCH, x86_64): \
+ finalBinDir = $$dir/x64
+ else: \
+ finalBinDir = $$dir/x86
+
+ fxc = $${finalBinDir}/fxc.exe
+ exists($$fxc) {
+ break()
+ }
+ }
+ }
+ }
+ }
+
+ !isEmpty(fxc):exists($$fxc) {
+ $${1}.value = $$fxc
+ export($${1}.value)
+ $${1}.cache += value
+ export($${1}.cache)
+ return(true)
+ }
+ return(false)
+}
+
defineTest(qtConfTest_xkbConfigRoot) {
qtConfTest_getPkgConfigVariable($${1}): return(true)
commit 7ef58de78af89438bf0c2875d8d02b6b0fb71f9a
Author: Kai Uwe Broulik <kde@privat.broulik.de>
Date: Wed Jun 21 10:49:59 2017 +0200
QDialogButtonBox: Don't overwrite shortcut with standardButtonShortcut
de63bbd2f806b0219a60775017899cedb121581f introduced a new
QPlatformTheme::standardButtonShortcut which would then unconditionally
overwrite the QPushButton shortcut, even when empty, breaking activating
mnemonics potentially included in the button's text.
Task-number: QTBUG-61197
Change-Id: I2a5a460a820a5ab4054eb44f349066aaeca1436f
Reviewed-by: Marco Martin <notmart@gmail.com>
Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru>
Reviewed-by: Tor Arne Vestb繪 <tor.arne.vestbo@qt.io>
diff --git a/qtbase/src/widgets/widgets/qdialogbuttonbox.cpp b/qtbase/src/widgets/widgets/qdialogbuttonbox.cpp
index a3e55114bb..90cb17da59 100644
--- a/qtbase/src/widgets/widgets/qdialogbuttonbox.cpp
+++ b/qtbase/src/widgets/widgets/qdialogbuttonbox.cpp
@@ -411,7 +411,9 @@ QPushButton *QDialogButtonBoxPrivate::createButton(QDialogButtonBox::StandardBut
else
addButton(button, static_cast<QDialogButtonBox::ButtonRole>(role), doLayout);
#if QT_CONFIG(shortcut)
- button->setShortcut(QGuiApplicationPrivate::platformTheme()->standardButtonShortcut(sbutton));
+ const QKeySequence standardShortcut = QGuiApplicationPrivate::platformTheme()->standardButtonShortcut(sbutton);
+ if (!standardShortcut.isEmpty())
+ button->setShortcut(standardShortcut);
#endif
return button;
}
diff --git a/qtbase/src/gui/opengl/qopengldebug.cpp b/qtbase/src/gui/opengl/qopengldebug.cpp
index f6c3af37dd..70bf7530e1 100644
--- a/qtbase/src/gui/opengl/qopengldebug.cpp
+++ b/qtbase/src/gui/opengl/qopengldebug.cpp
@@ -1413,7 +1413,7 @@ bool QOpenGLDebugLogger::initialize()
#define GET_DEBUG_PROC_ADDRESS(procName) \
d->procName = reinterpret_cast< qt_ ## procName ## _t >( \
- d->context->getProcAddress(#procName) \
+ d->context->getProcAddress(d->context->isOpenGLES() ? (#procName "KHR") : (#procName)) \
);
GET_DEBUG_PROC_ADDRESS(glDebugMessageControl);
SET(PREFIX_ext_vc "${EXTPREFIX}" )
ExternalProject_Add( ext_vc
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://files.kde.org/krita/build/dependencies/Vc-1.2.0.tar.gz
URL_MD5 f2a213ae4bad0dcf4ec6469e4dad41c1
URL https://github.com/VcDevel/Vc/releases/download/1.3.2/Vc-1.3.2.tar.gz
URL_HASH SHA1=2a87ff94dd18836cd3934b54180b15b3505bd50c
INSTALL_DIR ${PREFIX_ext_vc}
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/vc1.2_malloc_free.patch
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PREFIX_ext_vc} -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} ${GLOBAL_PROFILE} -DCMAKE_SYSTEM_PROCESSOR=x86
UPDATE_COMMAND ""
ALWAYS 0
)
--- a/common/malloc.h
+++ b/common/malloc.h
@@ -90,6 +90,12 @@
{
#ifdef __MIC__
_mm_free(p);
+#elif defined(_WIN32)
+# ifdef __GNUC__
+ return __mingw_aligned_free(p);
+# else
+ return _aligned_free(p);
+# endif
#else
std::free(p);
#endif
......@@ -28,13 +28,13 @@
#include <QDesktopServices>
#include <QDir>
#include <QDate>
#include <QLoggingCategory>
#include <QLocale>
#include <QSettings>
#include <time.h>
#include <KisApplication.h>
#include <KisLoggingManager.h>
#include <KoConfig.h>
#include <KoResourcePaths.h>
......@@ -98,18 +98,7 @@ extern "C" int main(int argc, char **argv)
qputenv("QT_QPA_PLATFORM", "xcb");
#endif
/**
* Disable debug output by default. (krita.input enables tablet debugging.)
* Debug logs can be controlled by an environment variable QT_LOGGING_RULES.
*
* As an example, to get full debug output, run the following:
* export QT_LOGGING_RULES="krita*=true"; krita
*
* See: http://doc.qt.io/qt-5/qloggingcategory.html
*/
QLoggingCategory::setFilterRules("krita*.debug=false\n"
"krita*.warning=true\n"
"krita.tabletlog=true");
KisLoggingManager::initialize();
// A per-user unique string, without /, because QLocalServer cannot use names with a / in it
QString key = "Krita3" + QDesktopServices::storageLocation(QDesktopServices::HomeLocation).replace("/", "_");
......@@ -144,8 +133,20 @@ extern "C" int main(int argc, char **argv)
if (enableOpenGLDebug && (qgetenv("KRITA_OPENGL_DEBUG") == "sync" || kritarc.value("OpenGLDebugSynchronous", false).toBool())) {
openGLDebugSynchronous = true;
}
KisOpenGL::setDefaultFormat(enableOpenGLDebug, openGLDebugSynchronous);
#ifdef Q_OS_WIN
QString preferredOpenGLRenderer = kritarc.value("OpenGLRenderer", "auto").toString();
// Force ANGLE to use Direct3D11. D3D9 doesn't support OpenGL ES 3 and WARP
// might get weird crashes atm.
qputenv("QT_ANGLE_PLATFORM", "d3d11");
// Probe QPA auto OpenGL detection
KisOpenGL::probeWindowsQpaOpenGL(argc, argv, preferredOpenGLRenderer);
#endif
}
KisOpenGL::setDefaultFormat(enableOpenGLDebug, openGLDebugSynchronous);
KLocalizedString::setApplicationDomain("krita");
......
......@@ -20,7 +20,7 @@
const QLoggingCategory &FLAKE_LOG() \
{
static const QLoggingCategory category("krita.lib.flake");
static const QLoggingCategory category("krita.lib.flake", QtInfoMsg);
return category;
}
......
......@@ -13,6 +13,7 @@ set(kritaglobal_LIB_SRCS
kis_shared.cpp
kis_dom_utils.cpp
kis_painting_tweaks.cpp
KisLoggingManager.cpp
)
add_library(kritaglobal SHARED ${kritaglobal_LIB_SRCS} )
......
/*
* Copyright (c) 2017 Alvin Wong <alvinhochun@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/