Commit 465f6e9e authored by Boudewijn Rempt's avatar Boudewijn Rempt

Merge remote-tracking branch 'origin' into rempt/T379-resource-management

parents 69ec5ec0 69ac1ec8
......@@ -16,6 +16,7 @@
<developer_name xml:lang="sv">Krita-stiftelsen</developer_name>
<developer_name xml:lang="uk">Фундація Krita</developer_name>
<developer_name xml:lang="x-test">xxKrita Foundationxx</developer_name>
<developer_name xml:lang="zh-CN">Krita 基金会</developer_name>
<update_contact>foundation@krita.org</update_contact>
<name>Krita</name>
<name xml:lang="ar">كريتا</name>
......@@ -101,7 +102,7 @@
<p xml:lang="tr">Krita, tam özellikli dijital sanat stüdyosudur.</p>
<p xml:lang="uk">Krita — повноцінний комплекс для створення цифрових художніх творів.</p>
<p xml:lang="x-test">xxKrita is the full-featured digital art studio.xx</p>
<p xml:lang="zh-CN">Krita 是功能齐全的数字艺术工作室软件。</p>
<p xml:lang="zh-CN">Krita 是一款功能齐全的数字绘画工作室软件。</p>
<p xml:lang="zh-TW">Krita 是全功能的數位藝術工作室。</p>
<p>It is perfect for sketching and painting, and presents an end–to–end solution for creating digital painting files from scratch by masters.</p>
<p xml:lang="bs">On je savršen za skiciranje i slikanje i predstavlja finalno rješenje za kreiranje digitalnih slika od nule s majstorima</p>
......@@ -157,7 +158,7 @@
<p xml:lang="tr">Krita, konsept sanat, çizgi roman, kaplama ve mat resimler için dokular oluşturmak için mükemmel bir seçimdir. Krita, 8 ve 16 bit tamsayı kanallarında RGB ve CMYK gibi birçok renk alanını ve 16 ve 32 bit kayan nokta kanallarını desteklemektedir.</p>
<p xml:lang="uk">Krita — чудовий інструмент для створення концептуального живопису, коміксів, текстур для моделей та декорацій. У Krita передбачено підтримку багатьох просторів кольорів, зокрема RGB та CMYK з 8-бітовими та 16-бітовими цілими значеннями, а також 16-бітовими та 32-бітовими значеннями з рухомою крапкою для каналів кольорів.</p>
<p xml:lang="x-test">xxKrita is a great choice for creating concept art, comics, textures for rendering and matte paintings. Krita supports many colorspaces like RGB and CMYK at 8 and 16 bits integer channels, as well as 16 and 32 bits floating point channels.xx</p>
<p xml:lang="zh-CN">Krita 是绘制概念美术、漫画、渲染纹理和电影布景的理想选择。Krita 支持多种色彩空间,如 8 位和 16 位整数及 16 位和 32 位浮点的 RGB 和 CMYK 颜色模型。</p>
<p xml:lang="zh-CN">Krita 是绘制概念美术、漫画、纹理和电影布景的理想选择。Krita 支持多种色彩空间,如 8 位和 16 位整数及 16 位和 32 位浮点的 RGB 和 CMYK 颜色模型。</p>
<p xml:lang="zh-TW">Krita 是創造概念藝術、漫畫、彩現紋理和場景繪畫的絕佳選擇。Krita 在 8 位元和 16 位元整數色版,以及 16 位元和 32 位元浮點色版中支援 RGB 和 CMYK 等多種色彩空間。</p>
<p>Have fun painting with the advanced brush engines, amazing filters and many handy features that make Krita enormously productive.</p>
<p xml:lang="bs">Zabavite se kreirajući napredne pogone četki, filtere i mnoge praktične osobine koje čine Krita vrlo produktivnim.</p>
......@@ -184,7 +185,7 @@
<p xml:lang="tr">Gelişmiş fırça motorları, şaşırtıcı filtreler ve Krita'yı son derece üretken yapan bir çok kullanışlı özellikli boya ile iyi eğlenceler.</p>
<p xml:lang="uk">Отримуйте задоволення від малювання за допомогою пензлів з найширшими можливостями, чудових фільтрів та багатьох зручних можливостей, які роблять Krita надзвичайно продуктивним засобом малювання.</p>
<p xml:lang="x-test">xxHave fun painting with the advanced brush engines, amazing filters and many handy features that make Krita enormously productive.xx</p>
<p xml:lang="zh-CN">Krita 具有功能强大的笔刷引擎、特效惊艳的滤镜以及便于操作的交互设计,可让你尽情、高效地挥洒无限创意。</p>
<p xml:lang="zh-CN">Krita 具有功能强大的笔刷引擎、种类繁多的滤镜以及便于操作的交互设计,可让你尽情、高效地挥洒无限创意。</p>
<p xml:lang="zh-TW">使用先進的筆刷引擎、驚人的濾鏡和許多方便的功能來開心地繪畫,讓 Krita 擁有巨大的生產力。</p>
</description>
<url type="homepage">https://www.krita.org/</url>
......
......@@ -253,12 +253,16 @@ void KisMask::apply(KisPaintDeviceSP projection, const QRect &applyRect, const Q
m_d->selection->updateProjection(applyRect);
KisSelectionSP effectiveSelection = m_d->selection;
QRect effectiveExtent = effectiveSelection->selectedRect();
QRect effectiveExtent;
{
// Access temporary target under the lock held
KisIndirectPaintingSupport::ReadLocker l(this);
// extent of m_d->selection should also be accessed under a lock,
// because it might be being merged in by the temporary target atm
effectiveExtent = effectiveSelection->selectedRect();
if (hasTemporaryTarget()) {
effectiveExtent |= temporaryTarget()->extent();
}
......
......@@ -27,6 +27,7 @@
KisRecalculateGeneratorLayerJob::KisRecalculateGeneratorLayerJob(KisGeneratorLayerSP layer)
: m_layer(layer)
{
setExclusive(true);
}
bool KisRecalculateGeneratorLayerJob::overrides(const KisSpontaneousJob *_otherJob)
......
......@@ -23,11 +23,12 @@
#include "kis_layer.h"
#include "kis_image.h"
#include "kis_abstract_projection_plane.h"
#include "kis_transform_mask_params_interface.h"
KisRecalculateTransformMaskJob::KisRecalculateTransformMaskJob(KisTransformMaskSP mask)
: m_mask(mask)
{
setExclusive(true);
}
bool KisRecalculateTransformMaskJob::overrides(const KisSpontaneousJob *_otherJob)
......@@ -58,14 +59,31 @@ void KisRecalculateTransformMaskJob::run()
KisImageSP image = layer->image();
Q_ASSERT(image);
/**
* When we call requestProjectionUpdateNoFilthy() on a layer,
* its masks' change rect is not counted, because it is considered
* to be N_ABOVE_FILTHY. Therefore, we should expand the dirty
* rect manually to get the correct update
* Depending on whether the mask is hidden we should either
* update it entirely via the setDirty() call, or we can use a
* lightweight approach by directly regenerating the
* precalculated static image using
* KisRecalculateTransformMaskJob.
*/
QRect updateRect = layer->projectionPlane()->changeRect(layer->extent(), KisLayer::N_FILTHY);
image->requestProjectionUpdateNoFilthy(layer, updateRect, image->bounds());
if (m_mask->transformParams()->isHidden()) {
QRect updateRect = m_mask->extent();
if (layer->original()) {
updateRect |= layer->original()->defaultBounds()->bounds();
}
m_mask->setDirty(updateRect);
} else {
/**
* When we call requestProjectionUpdateNoFilthy() on a layer,
* its masks' change rect is not counted, because it is considered
* to be N_ABOVE_FILTHY. Therefore, we should expand the dirty
* rect manually to get the correct update
*/
QRect updateRect = layer->projectionPlane()->changeRect(layer->extent(), KisLayer::N_FILTHY);
image->requestProjectionUpdateNoFilthy(layer, updateRect, image->bounds());
}
}
int KisRecalculateTransformMaskJob::levelOfDetail() const
......
/*
* Copyright (c) 2018 Dmitry Kazakov <dimula73@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.
*/
#include "kis_spontaneous_job.h"
bool KisSpontaneousJob::isExclusive() const
{
return m_isExclusive;
}
void KisSpontaneousJob::setExclusive(bool value)
{
}
......@@ -32,6 +32,17 @@ class KRITAIMAGE_EXPORT KisSpontaneousJob : public KisRunnable
public:
virtual bool overrides(const KisSpontaneousJob *otherJob) = 0;
virtual int levelOfDetail() const = 0;
bool isExclusive() const {
return m_isExclusive;
}
protected:
void setExclusive(bool value) {
m_isExclusive = value;
}
private:
bool m_isExclusive = false;
};
#endif /* __KIS_SPONTANEOUS_JOB_H */
......@@ -107,6 +107,7 @@ KisTransformMask::KisTransformMask()
new KisDumbTransformMaskParams()));
connect(&m_d->updateSignalCompressor, SIGNAL(timeout()), SLOT(slotDelayedStaticUpdate()));
connect(this, SIGNAL(sigInternalForceStaticImageUpdate()), SLOT(slotInternalForceStaticImageUpdate()));
KisImageConfig cfg;
m_d->offBoundsReadArea = cfg.transformMaskOffBoundsReadArea();
......@@ -434,6 +435,17 @@ void KisTransformMask::forceUpdateTimedNode()
}
}
void KisTransformMask::threadSafeForceStaticImageUpdate()
{
emit sigInternalForceStaticImageUpdate();
}
void KisTransformMask::slotInternalForceStaticImageUpdate()
{
m_d->updateSignalCompressor.stop();
slotDelayedStaticUpdate();
}
KisKeyframeChannel *KisTransformMask::requestKeyframeChannel(const QString &id)
{
if (id == KisKeyframeChannel::TransformArguments.id() ||
......
......@@ -76,12 +76,19 @@ public:
void forceUpdateTimedNode() override;
void threadSafeForceStaticImageUpdate();
protected:
KisKeyframeChannel *requestKeyframeChannel(const QString &id) override;
Q_SIGNALS:
void sigInternalForceStaticImageUpdate();
private Q_SLOTS:
void slotDelayedStaticUpdate();
void slotInternalForceStaticImageUpdate();
private:
struct Private;
const QScopedPointer<Private> m_d;
......
......@@ -156,7 +156,7 @@ public:
m_runnableJob = spontaneousJob;
m_exclusive = false;
m_exclusive = spontaneousJob->isExclusive();
m_walker = 0;
m_accessRect = m_changeRect = QRect();
......
......@@ -63,6 +63,9 @@ KisShaderProgram *KisOpenGLShaderLoader::loadShader(QString vertPath, QString fr
// XXX Check can be removed and set to the MAC version after we move to Qt5.7
#ifdef Q_OS_OSX
vertSource.append(KisOpenGL::hasOpenGL3() ? "#version 150 core\n" : "#version 120\n");
// OpenColorIO doesn't support the new GLSL version yet.
vertSource.append("#define texture2D texture\n");
vertSource.append("#define texture3D texture\n");
#else
if (KisOpenGL::hasOpenGLES()) {
vertSource.append("#version 300 es\n");
......@@ -85,6 +88,9 @@ KisShaderProgram *KisOpenGLShaderLoader::loadShader(QString vertPath, QString fr
// XXX Check can be removed and set to the MAC version after we move to Qt5.7
#ifdef Q_OS_OSX
fragSource.append(KisOpenGL::hasOpenGL3() ? "#version 150 core\n" : "#version 120\n");
// OpenColorIO doesn't support the new GLSL version yet.
fragSource.append("#define texture2D texture\n");
fragSource.append("#define texture3D texture\n");
#else
if (KisOpenGL::hasOpenGLES()) {
fragSource.append("#version 300 es\nprecision mediump float;\n");
......
......@@ -42,5 +42,5 @@ Comment[sv]=Verktyg för att hantera tecknade serier.
Comment[tr]=Çizgi romanları yönetmek için araçlar.
Comment[uk]=Інструменти для керування коміксами
Comment[x-test]=xxTools for managing comics.xx
Comment[zh_CN]=用管理漫画的工具。
Comment[zh_CN]=用管理漫画的工具。
Comment[zh_TW]=管理漫畫的工具。
......@@ -52,8 +52,7 @@ void KisModifyTransformMaskCommand::redo() {
}
m_mask->setTransformParams(params);
updateMask(m_params->isHidden());
m_mask->threadSafeForceStaticImageUpdate();
}
void KisModifyTransformMaskCommand::undo() {
......@@ -65,32 +64,5 @@ void KisModifyTransformMaskCommand::undo() {
}
m_mask->setTransformParams(m_oldParams);
updateMask(m_oldParams->isHidden());
}
void KisModifyTransformMaskCommand::updateMask(bool isHidden) {
/**
* Depending on whether the mask is hidden we should either
* update it entirely via the setDirty() call, or we can use a
* lightweight approach by directly regenerating the
* precalculated static image using
* KisRecalculateTransformMaskJob.
*/
if (!isHidden) {
KisRecalculateTransformMaskJob updateJob(m_mask);
updateJob.run();
} else {
m_mask->recaclulateStaticImage();
QRect updateRect = m_mask->extent();
KisNodeSP parent = m_mask->parent();
if (parent && parent->original()) {
updateRect |= parent->original()->defaultBounds()->bounds();
}
m_mask->setDirty(updateRect);
}
m_mask->threadSafeForceStaticImageUpdate();
}
......@@ -31,9 +31,6 @@ public:
void redo() override;
void undo() override;
private:
void updateMask(bool isHidden);
private:
KisTransformMaskSP m_mask;
KisTransformMaskParamsInterfaceSP m_params;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment