...
 
Commits (579)

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

*.orig
__pycache__
*.trace
build
......@@ -25,3 +26,4 @@ GRTAGS
GSYMS
BROWSE
*.kate-swp
/po/
......@@ -36,6 +36,7 @@ ExternalProject_Add(
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://download.kde.org/stable/frameworks/5.44/karchive-5.44.0.zip
URL_MD5 c60a8e22b88cc7328610041638459689
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/karchive.diff
INSTALL_DIR ${EXTPREFIX_frameworks}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_frameworks}
-DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE}
......
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2441977..2a20a13 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,20 +29,20 @@ set_package_properties(ZLIB PROPERTIES
PURPOSE "Required by the core KDE libraries and some critical kioslaves"
)
-find_package(BZip2)
-set_package_properties(BZip2 PROPERTIES
- URL "http://www.bzip.org"
- DESCRIPTION "Support for BZip2 compressed files and data streams"
- TYPE RECOMMENDED
- PURPOSE "Support for BZip2 compressed files and data streams"
-)
-
-find_package(LibLZMA)
-set_package_properties(LibLZMA PROPERTIES
- URL "http://tukaani.org/xz/"
- DESCRIPTION "Support for xz compressed files and data streams"
- PURPOSE "Support for xz compressed files and data streams"
-)
+#find_package(BZip2)
+#set_package_properties(BZip2 PROPERTIES
+# URL "http://www.bzip.org"
+# DESCRIPTION "Support for BZip2 compressed files and data streams"
+# TYPE RECOMMENDED
+# PURPOSE "Support for BZip2 compressed files and data streams"
+#)
+
+#find_package(LibLZMA)
+#set_package_properties(LibLZMA PROPERTIES
+# URL "http://tukaani.org/xz/"
+# DESCRIPTION "Support for xz compressed files and data streams"
+# PURPOSE "Support for xz compressed files and data streams"
+#)
include_directories(
${ZLIB_INCLUDE_DIR}
)
......@@ -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.2.3.tar.gz
URL_HASH SHA1=43f975a462a842be5eeff70d8d372476547163b0
URL https://gmic.eu/files/source/gmic_2.3.0.tar.gz
URL_HASH SHA1=fb994a625c0757fd21af7dc14fb717f08ced76b3
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.2.3.tar.gz
URL_HASH SHA1=a3c889de09031d34754c9bb3bd1004a2f67713c6
URL https://github.com/c-koi/gmic-qt/archive/v.2.3.0.tar.gz
URL_HASH SHA1=485fdcd67a89bc33fafa9c9335c80ca515be242a
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/desktop_icon.diff
SOURCE_DIR gmic-qt
......
......@@ -48,6 +48,9 @@ if (POLICY CMP0064)
cmake_policy(SET CMP0064 OLD)
endif()
if (POLICY CMP0071)
cmake_policy(SET CMP0071 OLD)
endif()
if (APPLE)
set(APPLE_SUPPRESS_X11_WARNING TRUE)
......@@ -58,7 +61,7 @@ if (APPLE)
endif()
if (CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9 AND NOT WIN32)
add_definitions(-Werror=delete-incomplete)
endif()
######################
......@@ -69,22 +72,22 @@ endif()
# define common versions of Krita applications, used to generate kritaversion.h
# update these version for every release:
set(KRITA_VERSION_STRING "4.1.0-pre-alpha")
set(KRITA_VERSION_STRING "4.1.8")
# Major version: 3 for 3.x, 4 for 4.x, etc.
set(KRITA_STABLE_VERSION_MAJOR 4)
# Minor version: 0 for 4.0, 1 for 4.1, etc.
set(KRITA_STABLE_VERSION_MINOR 1)
# Bugfix release version, or 0 for before the first stable release
set(KRITA_VERSION_RELEASE 0)
set(KRITA_VERSION_RELEASE 8)
# the 4th digit, really only used for the Windows installer:
# - [Pre-]Alpha: Starts from 0, increment 1 per release
# - Beta: Starts from 50, increment 1 per release
# - Stable: Set to 100, bump to 101 if emergency update is needed
set(KRITA_VERSION_REVISION 0)
set(KRITA_ALPHA 1) # uncomment only for Alpha
#set(KRITA_ALPHA 1) # uncomment only for Alpha
#set(KRITA_BETA 1) # uncomment only for Beta
#set(KRITA_RC 1) # uncomment only for RC
set(KRITA_YEAR 2018) # update every year
set(KRITA_YEAR 2019) # update every year
if(NOT DEFINED KRITA_ALPHA AND NOT DEFINED KRITA_BETA AND NOT DEFINED KRITA_RC)
set(KRITA_STABLE 1) # do not edit
......@@ -167,7 +170,7 @@ endif ()
option(HIDE_SAFE_ASSERTS "Don't show message box for \"safe\" asserts, just ignore them automatically and dump a message to the terminal." ON)
configure_file(config-hide-safe-asserts.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-hide-safe-asserts.h)
add_feature_info("Safe Asserts" HIDE_SAFE_ASSERTS "Don't show message box for \"safe\" asserts, just ignore them automatically and dump a message to the terminal.")
add_feature_info("Hide Safe Asserts" HIDE_SAFE_ASSERTS "Don't show message box for \"safe\" asserts, just ignore them automatically and dump a message to the terminal.")
option(FOUNDATION_BUILD "A Foundation build is a binary release build that can package some extra things like color themes. Linux distributions that build and install Krita into a default system location should not define this option to true." OFF)
add_feature_info("Foundation Build" FOUNDATION_BUILD "A Foundation build is a binary release build that can package some extra things like color themes. Linux distributions that build and install Krita into a default system location should not define this option to true.")
......@@ -289,13 +292,22 @@ find_package(Qt5 ${MIN_QT_VERSION}
Concurrent
)
if (UNIX AND NOT APPLE)
if (${Qt5_VERSION} VERSION_GREATER "5.11")
set (USE_QT_XCB ON)
else()
option(USE_QT_XCB "Do not use Krita's forked XCB connection and tablet support on X11, but leave everything to Qt." OFF)
add_feature_info("Use Qt's XCB and Tablet support on X11" USE_QT_XCB "Do not use Krita's forked XCB connection and tablet support on X11, but leave everything to Qt.")
endif()
configure_file(config_use_qt_xcb.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config_use_qt_xcb.h)
endif()
include (MacroAddFileDependencies)
include (MacroBoolTo01)
include (MacroEnsureOutOfSourceBuild)
macro_ensure_out_of_source_build("Compiling Krita inside the source directory is not possible. Please refer to the build instruction https://community.kde.org/Krita#Build_Instructions")
# Note: OPTIONAL_COMPONENTS does not seem to be reliable
# (as of ECM 5.15.0, CMake 3.2)
......@@ -339,14 +351,6 @@ if (NOT WIN32 AND NOT APPLE)
TYPE OPTIONAL
PURPOSE "Optionally used to provide a dbus api on Linux")
find_package(KF5KIO ${MIN_FRAMEWORKS_VERSION})
macro_bool_to_01(KF5KIO_FOUND HAVE_KIO)
set_package_properties(KF5KIO PROPERTIES
DESCRIPTION "KDE's KIO Framework"
URL "http://api.kde.org/frameworks-api/frameworks5-apidocs/kio/html/index.html"
TYPE OPTIONAL
PURPOSE "Optionally used for recent document handling")
find_package(KF5Crash ${MIN_FRAMEWORKS_VERSION})
macro_bool_to_01(KF5Crash_FOUND HAVE_KCRASH)
set_package_properties(KF5Crash PROPERTIES
......@@ -393,10 +397,14 @@ add_definitions(-DTRANSLATION_DOMAIN=\"krita\")
# The reason for this mode is that the Debug mode disable inlining
#
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS_KRITADEVS "-O3 -g" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fext-numeric-literals")
endif()
option(KRITA_DEVS "For Krita developers. This modifies the DEBUG build type to use -O3 -g, while still enabling Q_ASSERT. This is necessary because the Qt5 cmake modules normally append QT_NO_DEBUG to any build type that is not labeled Debug")
if (KRITA_DEVS)
set(CMAKE_CXX_FLAGS_DEBUG "-O3 -g" CACHE STRING "" FORCE)
endif()
if(UNIX)
set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES};m")
endif()
......@@ -594,11 +602,7 @@ set_package_properties(Eigen3 PROPERTIES
##
## Test for exiv2
##
find_package(Exiv2 0.16 REQUIRED)
set_package_properties(Exiv2 PROPERTIES
DESCRIPTION "Image metadata library and tools"
URL "http://www.exiv2.org"
PURPOSE "Required by Krita")
find_package(LibExiv2 0.16 REQUIRED)
##
## Test for lcms
......
......@@ -49,9 +49,6 @@
/* Defines if we use lcms2.4 */
#cmakedefine HAVE_LCMS24 1
/* Defines if KIO is present */
#cmakedefine HAVE_KIO 1
/* Defines if DBUS is present */
#cmakedefine HAVE_DBUS 1
......@@ -60,3 +57,6 @@
/* This variable contains the path to the current build directory */
#define KRITA_BUILD_DIR "${CMAKE_BINARY_DIR}"
/* This variable contains the path to the data install dir */
#define KRITA_EXTRA_RESOURCE_DIRS "${CMAKE_INSTALL_PREFIX}/${DATA_INSTALL_DIR}:${CMAKE_SOURCE_DIR}/krita/data"
......@@ -14,14 +14,21 @@ ACTIONFILES=`find . -name \*.action`
./action_i18n.pl --context=action $ACTIONFILES >> rc.cpp
# extracti18n.pl extracts additional data from brushes, palettes etc.
perl extracti18n.pl > i18ndata
perl extracti18n.pl >> rc.cpp
# Extract the name of configuration pages in the metadata editor plugin.
$EXTRACTATTR --attr=MetaDataEditor,name --context='metadata editor page' \
plugins/extensions/metadataeditor/editors/*.xmlgui >> rc.cpp
# Ignore sdk/templates which contains templates for writing future plugins.
# Also ignore crashreporter, it has it's own catalog
# None of the placeholder strings inside will be seen by users.
kundo2_aware_xgettext krita.pot i18ndata rc.cpp \
kundo2_aware_xgettext krita.pot rc.cpp \
`find . -name \*.cc -o -name \*.h -o -name \*.cpp | \
grep -v '/tests/' | grep -v './sdk/templates' | grep -v './krita/crashreporter/'`
# Extract the messages in Python plugins.
$XGETTEXT -L Python `find . -name \*.py` -j -o $podir/krita.pot
# Clean up
rm -f i18ndata rc.cpp
rm -f rc.cpp
= Notes for Packagers =
== Patching Qt ==
Qt 5.6 is currently the recommended version to build Krita with on all platforms. However, Qt 5.6 on Linux needs to be patched for https://bugreports.qt.io/browse/QTBUG-44964 .
The patch in 3rdparty/ext_qt/qt-no-motion-compression.diff
== Package Contents ==
We recommend that all of Krita packaged in one package: there is no need to split Krita up. In particular, do not make a separate package out of the plugins directory; without the plugins Krita will not even start.
Krita does not install header files, so there is no need for a corresponding -dev(el) package.
== Third Party Libraries ==
The top-level 3rd-party directory is not relevant for packaging: it only contains CMake projects for all of Krita's dependencies which are used for building Krita on Windows and OSX. It is not called from the top-level CMakeLists.txt project.
There are four forks of 3rd party libraries that are relevant and cannot be replaced by system libraries:
* plugins/impex/raw/3rdparty contains a fork of kdcraw. Upstread removed most functionality from this library and is in general unable to provide a stable API. The library has been renamed to avoid conflicts with upstream kdcraw.
* plugins/impex/xcf/3rdparty contains the xcftools code. This has never been released as a library
* libs/image/3rdparty contains einspline. This code is directly linked into the kritaimage library and has never been released as a separate library.
== Build flags ==
Krita no longer supports a build without OpenGL.
For alpha and beta packages, please build with debug output enabled, but for production packages the -DCMAKE_CXX_FLAGS="-DKDE_NO_DEBUG_OUTPUT" is recommended. A significant performance increase will be the result.
If you build Krita with RelWithDebInfo to be able to create a corresponding -dbg package, please define -DQT_NO_DEBUG=1 as well to disable asserts.
== Dependencies ==
Krita depends on:
* boost and the boost-system library
* eigen3
* exiv2
* fftw3
* gsl
* ilmbase
* jpeg: Note that libjpeg-turbo is recommended.
* lcms2
* libraw
* opencolorio
* openexr
* png
* poppler-qt5
* pthreads
* qt-5: Note that Qt 5.6 is _strongly_ recommended. Qt 5.5 has bugs that interfere with proper handling of tablet events
* tiff
* vc: this is a build-time dependency only
* zlib
And the following KDE Frameworks:
* Archive
* Completion
* Config
* CoreAddons
* GuiAddons
* I18n
* ItemModels
* ItemViews
* KCrash
* WidgetsAddons
* WindowSystem
<!DOCTYPE params>
<params>
<param name="halfHeight"><![CDATA[5]]></param>
<param name="halfWidth"><![CDATA[5]]></param>
<param name="rotate"><![CDATA[0]]></param>
<param name="shape"><![CDATA[0]]></param>
<param name="strength"><![CDATA[0]]></param>
</params>
......@@ -47,6 +47,11 @@ inline double drand48()
#include <kis_image.h>
#include <kis_painter.h>
#include <kis_types.h>
#include "kis_paintop_utils.h"
#include "kis_algebra_2d.h"
#include "kis_paint_device_debug_utils.h"
#include "KisRenderedDab.h"
#define SAVE_OUTPUT
......@@ -275,4 +280,186 @@ void KisPainterBenchmark::benchmarkDrawScanLine()
#endif
}
void KisPainterBenchmark::benchmarkBitBlt2()
{
quint8 p = 128;
const KoColorSpace *cs = KoColorSpaceRegistry::instance()->alpha8();
KisPaintDeviceSP src = new KisPaintDevice(cs);
KisPaintDeviceSP dst = new KisPaintDevice(cs);
KoColor color(&p, cs);
QRect fillRect(0,0,5000,5000);
src->fill(fillRect, color);
QBENCHMARK {
KisPainter gc(dst);
gc.bitBlt(QPoint(), src, fillRect);
}
}
void KisPainterBenchmark::benchmarkBitBltOldData()
{
quint8 p = 128;
const KoColorSpace *cs = KoColorSpaceRegistry::instance()->alpha8();
KisPaintDeviceSP src = new KisPaintDevice(cs);
KisPaintDeviceSP dst = new KisPaintDevice(cs);
KoColor color(&p, cs);
QRect fillRect(0,0,5000,5000);
src->fill(fillRect, color);
QBENCHMARK {
KisPainter gc(dst);
gc.bitBltOldData(QPoint(), src, fillRect);
}
}
void benchmarkMassiveBltFixedImpl(int numDabs, int size, qreal spacing, int idealNumPatches, Qt::Orientations direction)
{
const KoColorSpace* cs = KoColorSpaceRegistry::instance()->rgb8();
KisPaintDeviceSP dst = new KisPaintDevice(cs);
QList<QColor> colors;
colors << QColor(255, 0, 0, 200);
colors << QColor(0, 255, 0, 200);
colors << QColor(0, 0, 255, 200);
QRect devicesRect;
QList<KisRenderedDab> devices;
const int step = spacing * size;
for (int i = 0; i < numDabs; i++) {
const QRect rc =
direction == Qt::Horizontal ? QRect(10 + i * step, 0, size, size) :
direction == Qt::Vertical ? QRect(0, 10 + i * step, size, size) :
QRect(10 + i * step, 10 + i * step, size, size);
KisFixedPaintDeviceSP dev = new KisFixedPaintDevice(cs);
dev->setRect(rc);
dev->initialize();
dev->fill(rc, KoColor(colors[i % 3], cs));
dev->fill(kisGrowRect(rc, -5), KoColor(Qt::white, cs));
KisRenderedDab dab;
dab.device = dev;
dab.offset = dev->bounds().topLeft();
dab.opacity = 1.0;
dab.flow = 1.0;
devices << dab;
devicesRect |= rc;
}
const QRect fullRect = kisGrowRect(devicesRect, 10);
{
KisPainter painter(dst);
painter.bltFixed(fullRect, devices);
painter.end();
//QVERIFY(TestUtil::checkQImage(dst->convertToQImage(0, fullRect),
// "kispainter_test",
// "massive_bitblt_benchmark",
// "initial"));
dst->clear();
}
QVector<QRect> dabRects;
Q_FOREACH (const KisRenderedDab &dab, devices) {
dabRects.append(dab.realBounds());
}
QElapsedTimer t;
qint64 massiveTime = 0;
int massiveTries = 0;
int numRects = 0;