Commit 87a5c71b authored by Boudewijn Rempt's avatar Boudewijn Rempt

Merge branch 'master' into rempt/T379-resource-management

parents a701a08c 894046b4
*.orig
__pycache__
*.trace
build
......
......@@ -169,6 +169,10 @@ option(HIDE_SAFE_ASSERTS "Don't show message box for \"safe\" asserts, just igno
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.")
option(USE_LOCK_FREE_HASH_TABLE "Use lock free hash table instead of blocking." ON)
configure_file(config-hash-table-implementaion.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-hash-table-implementaion.h)
add_feature_info("Lock free hash table" USE_LOCK_FREE_HASH_TABLE "Use lock free hash table instead of blocking.")
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.")
......@@ -373,8 +377,6 @@ add_definitions(
-DQT_USE_QSTRINGBUILDER
-DQT_STRICT_ITERATORS
-DQT_NO_SIGNALS_SLOTS_KEYWORDS
-DQT_USE_FAST_OPERATOR_PLUS
-DQT_USE_FAST_CONCATENATION
-DQT_NO_URL_CAST_FROM_STRING
)
......
......@@ -47,7 +47,7 @@ void removeTempFiles(const QString &filesMask)
void runRenderingTest(KisImageSP image, int numCores, int numClones)
{
{
KisImageConfig cfg;
KisImageConfig cfg(false);
cfg.setMaxNumberOfThreads(numCores);
cfg.setFrameRenderingClones(numClones);
}
......
......@@ -89,7 +89,7 @@ void KisLowMemoryBenchmark::benchmarkWideArea(const QString presetFileName,
/**
* Reset configuration to the desired settings
*/
KisImageConfig config;
KisImageConfig config(false);
qreal oldHardLimit = config.memoryHardLimitPercent();
qreal oldSoftLimit = config.memorySoftLimitPercent();
qreal oldPoolLimit = config.memoryPoolLimitPercent();
......
FROM kdeorg/appimage-base
MAINTAINER Dmitry Kazakov <dimula73@gmail.com>
RUN apt-get update && apt-get -y install curl
RUN apt-get update && \
apt-get -y install curl && \
apt-get -y install emacs24-nox && \
apt-get -y install gitk git-gui && \
apt-get -y install cmake3-curses-gui gdb valgrind sysvinit-utils && \
apt-get -y install mirage && \
apt-get -y install mesa-utils
ENV USRHOME=/home/appimage
......@@ -9,8 +15,6 @@ RUN chsh -s /bin/bash appimage
RUN locale-gen en_US.UTF-8
USER appimage
RUN echo 'export LC_ALL=en_US.UTF-8' >> ${USRHOME}/.bashrc && \
echo 'export LANG=en_US.UTF-8' >> ${USRHOME}/.bashrc && \
echo "export PS1='\u@\h:\w>'" >> ${USRHOME}/.bashrc && \
......@@ -30,6 +34,11 @@ COPY ./default-home/run_cmake.sh \
ADD persistent/krita-appimage-deps.tar ${USRHOME}/appimage-workspace/
RUN chown appimage:appimage -R ${USRHOME}/
RUN chmod a+rwx /tmp
USER appimage
CMD tail -f /dev/null
......@@ -9,31 +9,45 @@ to reproduce AppImage-only bugs in Krita.
## Prerequisites
Firstly we need to download deps and Krita source tree. These steps are not
Firstly make sure you have Docker installed
```bash
sudo apt install docker docker.io
```
Then you need to download deps and Krita source tree. These steps are not
included into the *Dockerfile* to save internal bandwidth (most Krita
developers already have al least one clone of Krita source tree).
```bash
# create directory structure for container control directory
mkdir -p krita-master/persistent
cd krita-master
# copy/chechout Krita sources to 'persistent/krita'
cp -r /path/to/sources/krita ./persistent/krita
# initialize control scripts and the Dockerfile
./persistent/krita/build-tools/docker/bin/bootstrap-root.sh
# download the deps archive
./bin/bootstrap-deps.sh
# mount/copy/chechout Krita sources to 'persistent/krita'
mkdir -p persistent/krita
sudo mount --bind ../../ ./persistent/krita
```
## Build the docker image and run the container
```bash
./bin/build_image krita-deps
./bin/run_container krita-deps krita-build
./bin/run_container krita-deps krita-master
```
## Enter the container and build Krita
```bash
# enter the docker container
./bin/enter_container krita-build
# enter the docker container (the name will be
# fetched automatically from '.container_name' file)
./bin/enter
# ... now your are inside the container with all the deps prepared ...
......@@ -49,27 +63,20 @@ krita
## Extra developer tools
If you want to develop Krita, you might want to install at least some
developer tools into the container, e.g. GDB, Valgring, ccmake and QtCreator.
To do that, execute the following from yout **host** console:
To install QtCreator, enter container and start the installer, downloaded while
fetching dependencies. Make sure you install it into '~/qtcreator' directory
without any version suffixes, then you will be able to use the script below:
```bash
sudo docker exec -ti -u root krita-build apt install gdb
sudo docker exec -ti -u root krita-build apt install valgrind
sudo docker exec -ti -u root krita-build apt install cmake-curses-gui
# inside the container
cd ~/persistent
wget http://master.qt.io/archive/online_installers/3.0/qt-unified-linux-x64-3.0.4-online.run
./qt-unified-linux-x64-3.0.4-online.run
# when going through the setup wizard select not to install any
# extra Qt libraries, install QtCreator only!
./persistent/qt-creator-opensource-linux-x86_64-4.6.2.run
```
# to start QtCreator without the conflicts to with Krita's Qt paths, type
# in your **host** console:
sudo docker exec -ti krita-build /home/appimage//Qt/Tools/QtCreator/bin/qtcreator
To start QtCreator:
```bash
# from the host
./bin/qtcreator
```
## Stopping the container and cleaning up
......@@ -79,14 +86,18 @@ all the currently running processes are killed (just ensure you logout from all
terminals before stopping).
```bash
sudo docker stop krita-build
# stop the container
./bin/stop
# start the container
./bin/start
```
If you don't need your container/image anymore, you can delete them from the docker
```bash
# remove the container
sudo docker rm krita-build
sudo docker rm krita-master
# remove the image
sudo docker rmi krita-deps
......
......@@ -11,3 +11,13 @@ if [ ! -f ./persistent/krita-appimage-deps.tar ]; then
)
fi
creator_major=4.6
creator_minor=2
creator_file=qt-creator-opensource-linux-x86_64-${creator_major}.${creator_minor}.run
if [ ! -f ./persistent/${creator_file} ]; then
(
cd ./persistent/
wget http://download.qt.io/official_releases/qtcreator/${creator_major}/${creator_major}.${creator_minor}/${creator_file} || exit 1
chmod a+x ${creator_file}
)
fi
#!/bin/bash
if [ -d ./persistent/krita ]; then
for i in 'bin default-home'; do
if [ ! -d "$i" ]; then
mkdir $i
fi
done
cp persistent/krita/build-tools/docker/bin/* ./bin/
cp persistent/krita/build-tools/docker/default-home/{,.}* ./default-home/
cp persistent/krita/build-tools/docker/Dockerfile ./
cp persistent/krita/build-tools/docker/README.md ./
fi
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${DIR}/find_default_container_file.inc
container_name=$(parseContainerArgs $*)
if [ -z ${container_name} ]; then
exit 1
fi
sudo docker exec -ti ${container_name} sh -c "cd /home/appimage && /bin/bash -l"
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "Usage: $0 CONTAINER_NAME" >&2
exit 1
fi
sudo docker exec -ti $1 sh -c "cd /home/appimage && /bin/bash -l"
#!/bin/bash
function findContainerName {
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
container_file=`${DIR}/find_up ./ -name .container_name`
if [ ! -z ${container_file} ]; then
cat ${container_file}
fi
}
function parseContainerArgs {
container_name=
if [ "$#" -ne 1 ]; then
if [ "$#" -eq 0 ]; then
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
container_name=$(findContainerName)
fi
if [ -z ${container_name} ]; then
echo "Usage: $0 CONTAINER_NAME" >&2
exit 1
fi
else
container_name=$1
fi
echo ${container_name}
}
#!/bin/bash
set -e
path="$1"
shift 1
while [[ $path != / ]];
do
find "$path" -maxdepth 1 -mindepth 1 "$@"
# Note: if you want to ignore symlinks, use "$(realpath -s "$path"/..)"
path="$(readlink -f "$path"/..)"
done
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${DIR}/find_default_container_file.inc
container_name=$(parseContainerArgs $*)
if [ -z ${container_name} ]; then
exit 1
fi
if [ ! -e /proc/driver/nvidia/version ]; then
echo "Cannot find NVIDIA bestion file: /proc/driver/nvidia/version"
exit 1
fi
nvidia_version=$(cat /proc/driver/nvidia/version | head -n 1 | awk '{ print $8 }')
driver_file=NVIDIA-Linux-x86_64-${nvidia_version}.run
driver_url=http://download.nvidia.com/XFree86/Linux-x86_64/${nvidia_version}/${driver_file}
if [ ! -f persistent/${driver_file} ]; then
(
cd persistent
wget http://download.nvidia.com/XFree86/Linux-x86_64/${nvidia_version}/${driver_file} || exit 1
chmod a+x ${driver_file}
)
fi
if [ -f persistent/${driver_file} ]; then
sudo docker exec -ti -u root ${container_name} /home/appimage/persistent/${driver_file} -a -N --ui=none --no-kernel-module -s
else
echo "Cannot find the driver file: ${driver_file}"
exit 1
fi
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${DIR}/find_default_container_file.inc
container_name=$(parseContainerArgs $*)
if [ -z ${container_name} ]; then
exit 1
fi
sudo docker exec -ti ${container_name} /bin/bash -c 'source /home/appimage/devenv.inc; /home/appimage/qtcreator/bin/qtcreator.sh'
......@@ -5,6 +5,11 @@ if [ "$#" -ne 2 ]; then
exit 1
fi
NVIDIA_OPTS=
if [ -e /dev/nvidiactl ]; then
NVIDIA_OPTS+="--device /dev/nvidia0 --device /dev/nvidiactl --device /dev/nvidia-uvm"
fi
sudo docker run -P -t -d \
-v $(pwd)/persistent/:/home/appimage/persistent/:rw \
-v /tmp/.X11-unix/:/tmp/.X11-unix \
......@@ -16,6 +21,11 @@ sudo docker run -P -t -d \
--security-opt seccomp=unconfined \
--device /dev/dri \
--device /dev/snd \
-p127.0.0.1:2022:22 \
$NVIDIA_OPTS \
--name $2 \
$1
$1 || exit 1
if [ ! -f .container_name ]; then
echo $2 > .container_name
fi
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${DIR}/find_default_container_file.inc
container_name=$(parseContainerArgs $*)
if [ -z ${container_name} ]; then
exit 1
fi
sudo docker start ${container_name}
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${DIR}/find_default_container_file.inc
container_name=$(parseContainerArgs $*)
if [ -z ${container_name} ]; then
exit 1
fi
sudo docker stop ${container_name}
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${DIR}/find_default_container_file.inc
container_name=$(parseContainerArgs $*)
if [ -z ${container_name} ]; then
exit 1
fi
sudo docker exec -user root -ti ${container_name} sh -c "cd /home/appimage && /bin/bash -l"
......@@ -21,6 +21,6 @@ prepend PKG_CONFIG_PATH $DEPSDIR/lib/pkgconfig
prepend CMAKE_PREFIX_PATH $DEPSDIR
#prepend PYTHONPATH $DEPSDIR/lib/python3.5/
#prepend PYTHONPATH $DEPSDIR/sip
prepend PYTHONPATH $DEPSDIR/sip
#prepend PYQT_SIP_DIR_OVERRIDE $DEPSDIR/share/sip
......@@ -4,5 +4,5 @@ cmake -DCMAKE_INSTALL_PREFIX=${KRITADIR} \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBUILD_TESTING=TRUE \
-DHIDE_SAFE_ASSERTS=FALSE \
-DPYQT_SIP_DIR_OVERRIDE=~/appimage-workspace/deps/usr/share/sip
-DPYQT_SIP_DIR_OVERRIDE=~/appimage-workspace/deps/usr/share/sip \
$@
/* config-hash-table-implementation.h. Generated by cmake from config-hash-table-implementation.h.cmake */
#cmakedefine USE_LOCK_FREE_HASH_TABLE 1
......@@ -25,6 +25,8 @@
#include <QString>
#include <QHash>
#include "kis_assert.h"
/**
* Base class for registry objects.
*
......@@ -73,8 +75,11 @@ public:
*/
void add(T item)
{
Q_ASSERT(item);
QString id = item->id();
KIS_SAFE_ASSERT_RECOVER_RETURN(item);
const QString id = item->id();
KIS_SAFE_ASSERT_RECOVER_NOOP(!m_aliases.contains(id));
if (m_hash.contains(id)) {
m_doubleEntries << value(id);
remove(id);
......@@ -89,7 +94,9 @@ public:
*/
void add(const QString &id, T item)
{
Q_ASSERT(item);
KIS_SAFE_ASSERT_RECOVER_RETURN(item);
KIS_SAFE_ASSERT_RECOVER_NOOP(!m_aliases.contains(id));
if (m_hash.contains(id)) {
m_doubleEntries << value(id);
remove(id);
......@@ -105,6 +112,17 @@ public:
m_hash.remove(id);
}
void addAlias(const QString &alias, const QString &id)
{
KIS_SAFE_ASSERT_RECOVER_NOOP(!m_hash.contains(alias));
m_aliases[alias] = id;
}
void removeAlias(const QString &alias)
{
m_aliases.remove(alias);
}
/**
* Retrieve the object from the registry based on the unique
* identifier string.
......@@ -123,7 +141,13 @@ public:
*/
bool contains(const QString &id) const
{
return m_hash.contains(id);
bool result = m_hash.contains(id);
if (!result && m_aliases.contains(id)) {
result = m_hash.contains(m_aliases.value(id));
}
return result;
}
/**
......@@ -132,7 +156,13 @@ public:
*/
const T value(const QString &id) const
{
return m_hash.value(id);
T result = m_hash.value(id);
if (!result && m_aliases.contains(id)) {
result = m_hash.value(m_aliases.value(id));
}
return result;
}
/**
......@@ -165,6 +195,7 @@ private:
private:
QHash<QString, T> m_hash;
QHash<QString, QString> m_aliases;
};
#endif
......@@ -8,6 +8,7 @@ Name[de]=Animations-Vorlagen
Name[el]=Πρότυπα εφέ κίνησης
Name[en_GB]=Animation Templates
Name[es]=Plantillas de animación
Name[fr]=Modèles pour animation
Name[gl]=Modelos de animación
Name[is]=Sniðmát fyrir hreyfimyndir
Name[it]=Modelli di animazioni
......
......@@ -11,6 +11,7 @@ Name[el]=Εφέ-κίνησης-Ιαπωνικό-En
Name[en_GB]=Animation-Japanese-En
Name[es]=Animación-Japonés-En
Name[et]=Animation-Japanese-En
Name[fr]=Animation japonaise (en)
Name[gl]=Animación-xaponesa-en-inglés
Name[is]=Hreyfimynd-Japanska-En
Name[it]=Animazione-Giapponese-EN
......
......@@ -11,6 +11,7 @@ Name[el]=Εφέ-κίνησης-Ιαπωνικό-JP
Name[en_GB]=Animation-Japanese-JP
Name[es]=Animación-Japonés-JP
Name[et]=Animation-Japanese-JP
Name[fr]=Animation japonaise (jp)
Name[gl]=Animación-xaponesa-en-xaponés
Name[is]=Hreyfimynd-Japanska-JP
Name[it]=Animazione-Giapponese-JP
......
......@@ -13,7 +13,7 @@ Name[en_GB]=waffle-iron grid
Name[es]=rejilla de hierro para gofres
Name[et]=Vahvlimasina ruudustik
Name[eu]=gofreetarako burdinazko sareta
Name[fr]=Grille en métal-gaufré
Name[fr]=Grille en métal gaufré
Name[gl]=Grade de 3×5 viñetas
Name[is]=vöfflujárnshnit
Name[it]=Griglia a wafer
......@@ -45,7 +45,7 @@ Comment[en_GB]=300 dpi, A4 waffle-iron grid comic page with ink and colour layer
Comment[es]=página de cómic con rejilla de hierro para gofres de tamaño A4, a 300 ppp, con tinta y capas de colores
Comment[et]=300 DPI A4 vahvlimasina ruudustikuga koomiksilehekülg tindi- ja värvikihiga
Comment[eu]=Gofreetarako burdinazko sareta duen 300 dpi-ko A4 komiki-orria, tinta- eta kolore-geruzaduna
Comment[fr]=Page de bande dessinée avec Grille en métal-gaufré de 300 dpi, A4 avec encre et calques colorés
Comment[fr]=Page de bande dessinée avec grille en métal gaufré en A4 300 dpi avec encre et calques de couleurs
Comment[gl]=Páxina de banda deseñada de grade en A4 a 300 dpi con 3×5 viñetas regulares e capas de tinta e cor.
Comment[is]=300 pát, A4 vöfflujárnshnit teiknimyndasíða með lögum fyrir blek og liti
Comment[it]=Pagina di fumetti con griglia a wafer a 300 dpi, A4, con livelli per inchiostro e colore
......
......@@ -2,7 +2,7 @@
<kpartgui xmlns="http://www.kde.org/standards/kxmlgui/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
name="Krita"
version="401"
version="420"
xsi:schemaLocation="http://www.kde.org/standards/kxmlgui/1.0 http://www.kde.org/standards/kxmlgui/1.0/kxmlgui.xsd">
<MenuBar>
<Menu name="file">
......@@ -267,7 +267,7 @@ xsi:schemaLocation="http://www.kde.org/standards/kxmlgui/1.0 http://www.kde.org
<Action name="select_all"/>
<Action name="deselect"/>
<Action name="reselect"/>
<Action name="invert"/>
<Action name="invert_selection"/>
<Action name="convert_to_vector_selection"/>