Commit 15704dfc authored by Wolthera van Hövell's avatar Wolthera van Hövell 🐛

Merge branch 'master' into wolthera/multigridgenerator

parents 9ccdb44e b55cabd7
This diff is collapsed.
......@@ -2046,26 +2046,6 @@
<isCheckable>false</isCheckable>
<statusTip></statusTip>
</Action>
<Action name="previous_keyframe">
<icon></icon>
<text>Previous Keyframe</text>
<whatsThis></whatsThis>
<toolTip></toolTip>
<iconText></iconText>
<shortcut></shortcut>
<isCheckable>false</isCheckable>
<statusTip></statusTip>
</Action>
<Action name="next_keyframe">
<icon></icon>
<text>Next Keyframe</text>
<whatsThis></whatsThis>
<toolTip></toolTip>
<iconText></iconText>
<shortcut></shortcut>
<isCheckable>false</isCheckable>
<statusTip></statusTip>
</Action>
<Action name="first_frame">
<icon></icon>
<text>First Frame</text>
......
......@@ -320,6 +320,7 @@ xsi:schemaLocation="http://www.kde.org/standards/kxmlgui/1.0 http://www.kde.org
<Menu name="Filter">
<text>Filte&amp;r</text>
<Action name="filter_apply_again"/>
<Action name="filter_apply_reprompt"/>
<Action name="filter_gallery"/>
<Separator/>
<Action name="adjust_filters"/>
......
......@@ -1416,6 +1416,18 @@
<isCheckable>false</isCheckable>
<statusTip></statusTip>
</Action>
<Action name="filter_apply_reprompt">
<icon></icon>
<text>Apply Filter Again (Reprompt)</text>
<whatsThis></whatsThis>
<toolTip>Reapply Last Used Filter with Prompt for Configuration</toolTip>
<iconText>Reapply Last Used Filter with Prompt for Configuration</iconText>
<activationFlags>0</activationFlags>
<activationConditions>0</activationConditions>
<shortcut></shortcut>
<isCheckable>false</isCheckable>
<statusTip></statusTip>
</Action>
<Action name="adjust_filters">
<icon></icon>
<text>Adjust</text>
......
......@@ -392,6 +392,47 @@
<!-- Note: website infrastructure uses the appstream file from the master branch
to determine the last release, so this entry must always reflect the
last actual release -->
<release date="2020-06-18" version="4.3.0">
<description>
<p>Three months after the release of Krita 4.2.9, we’ve got a major new feature release for you: Krita 4.3.0! We’ve spent the past year not just fixing bugs, even though we fixed over a thousand issues, but have also been busy adding cool new stuff to play with.</p>
<p>There’s a whole new set of brush presets that evoke watercolor painting. There’s a color mode in the gradient map filter and a brand new palettize filter and a high pass filter. The scripting API has been extended. It’s now possible to adjust the opacity and lightness on colored brush tips separately. You can now create animated brush tips that select brush along multiple dimensions. We’ve made it possible to put the canvas area in a window of its own, so on a multi monitor setup, you can have all the controls on one monitor, and your images on the other. The color selector has had a big update. There’s a new snapshot docker that stores states of your image, and you can switch between those. There’s a brand new magnetic selection tool. Gradients can now be painting as spirals.</p>
</description>
<url>https://krita.org/en/item/krita-4-3-0-released/</url>
<artifacts>
<artifact type="binary" platform="x86_64-appimage">
<location>https://download.kde.org/stable/krita/4.3.0/krita-4.3.0-x86_64.appimage</location>
<checksum type="sha256">488a6c27876612fca710609483a265821c6bb802d24edf1e970a544744f1c75d</checksum>
<size type="download">210276392</size>
<bundle type="appimage">krita-4.3.0</bundle>
</artifact>
<artifact type="binary" platform="x86_64-appimage">
<location>https://download.kde.org/stable/krita/4.3.0/gmic_krita_qt-x86_64.appimage</location>
<checksum type="sha256">11744659641e61d180592851453f2b278ce445ea828067037b57c0af0339571a</checksum>
<size type="download">32006184</size>
<bundle type="appimage">gmic_krita_qt-4.3.0</bundle>
</artifact>
<artifact type="binary" platform="macOS">
<location>https://download.kde.org/stable/krita/4.3.0/krita-4.3.0.dmg</location>
<checksum type="sha256">5a8da4d00dc2678a865a3d4938eba4b1a739fc92ffc700e91eae56b67162ce28</checksum>
<size type="download">180959904</size>
</artifact>
<artifact type="binary" platform="win64">
<location>https://download.kde.org/stable/krita/4.3.0/krita-x64-4.3.0-setup.exe</location>
<checksum type="sha256">39346273dfa9397af61f4caf779e2d3d5d59a43d67248bc827b6704a08e9e59f</checksum>
<size type="download">116765304</size>
</artifact>
<artifact type="binary" platform="win32">
<location>https://download.kde.org/stable/krita/4.3.0/krita-x86-4.3.0-setup.exe</location>
<checksum type="sha256">15018230d2fd5caa8a3778b1ff88b0582d93255108e1e5f781880d1d5401e9e3</checksum>
<size type="download">114433288</size>
</artifact>
<artifact type="source">
<location>https://download.kde.org/stable/krita/4.2.9/krita-4.2.9.tar.xz</location>
<checksum type="sha256">4ef711887dd3ec5f2a1c42a80f2fd0fec1de0d4f3d0147b0efd418ac6e4d7567</checksum>
<size type="download">170082028</size>
</artifact>
</artifacts>
</release>
<release date="2020-03-26" version="4.2.9.0">
<url>https://krita.org/en/item/krita-4-2-9-released/</url>
<artifacts>
......@@ -431,75 +472,13 @@
</release>
<release date="2019-11-27" version="4.2.8.0">
<url>https://krita.org/en/item/krita-4-2-8-released/</url>
<artifacts>
<artifact type="binary" platform="x86_64-linux-gnu">
<location>https://download.kde.org/stable/krita/4.2.8/krita-4.2.8-x86_64.appimage</location>
<checksum type="sha256">4b23574456338b4f5e2d7e6ba66ca5dce2d6924468fe6613bc468674ebec77d4</checksum>
<size type="download">207515688</size>
<bundle type="appimage">krita-4.2-8</bundle>
</artifact>
<artifact type="binary" platform="x86_64-linux-gnu">
<location>https://download.kde.org/stable/krita/4.2.8/gmic_krita_qt-x86_64.appimage</location>
<checksum type="sha256">e48ac43f86a22b7015ee2dc5ce4f35a72f22070150d926553ab0aafc8616a08f</checksum>
<size type="download">32944104</size>
<bundle type="appimage">gmic_krita_qt-4.2-8</bundle>
</artifact>
<artifact type="binary" platform="macOS">
<location>https://download.kde.org/stable/krita/4.2.9/krita-4.2.9.dmg</location>
<checksum type="sha256">34b606dcdbdf1c3702cebc924b9c11e1c9181ca6a9d5fa91e605bbfca554df9b</checksum>
<size type="download">195113969</size>
</artifact>
<artifact type="binary" platform="win64">
<location>https://download.kde.org/stable/krita/4.2.8/krita-x64-4.2.8-setup.exe</location>
<checksum type="sha256">dca15dad13684622ae2704d77b34f0662bc109b7b6e3e7393a549b6418fcd419</checksum>
<size type="download">109267000</size>
</artifact>
<artifact type="binary" platform="win32">
<location>https://download.kde.org/stable/krita/4.2.8/krita-x86-4.2.8-setup.exe</location>
<checksum type="sha256">94fbdee4a923682fd64c0010b17ebd002e52de8f2ae239e611f3bda60d8abdee</checksum>
<size type="download">107842760</size>
</artifact>
<artifact type="source">
<location>https://download.kde.org/stable/krita/4.2.8/krita-4.2.8.2.tar.xz</location>
<checksum type="sha256">1c3bb8a28ef8f7945e5f21f9ad87e01d8b831eea3487ff92742c930f3b7f744a</checksum>
<size type="download">169994064</size>
</artifact>
</artifacts>
</release>
<release date="2019-03-10" version="4.2.7.1">
<url>https://krita.org/en/item/krita-4-2-7-released/</url>
<artifacts>
<artifact type="binary" platform="x86_64-linux-gnu">
<location>https://download.kde.org/stable/krita/4.2.7.1/krita-4.2.7.1b-x86_64.appimage</location>
<checksum type="sha256">ddaeb8e02bad9d09fd3fc2d4ecf7ee677c3786cb13bb8e50eeaebf00e573f2d9</checksum>
<size type="download">192188392</size>
<bundle type="appimage">krita-4.2-7-1</bundle>
</artifact>
<artifact type="binary" platform="x86_64-linux-gnu">
<location>https://download.kde.org/stable/krita/4.2.7.1/gmic_krita_qt-x86_64.appimage</location>
<checksum type="sha256">ea6e151399e850feb6e177ab52a40b32d9070888339f0c35c92ceff17816cae1</checksum>
<size type="download">32968680</size>
<bundle type="appimage">gmic_krita_qt-4-2-7-1</bundle>
</artifact>
<artifact type="binary" platform="macOS">
<location>https://download.kde.org/stable/krita/4.2.7.1/krita-4.2.7.1.dmg</location>
<checksum type="sha256">eca62444e27ed51b177e75e9e674d726285e58483b41a37fa2b0d0ad2a8b34ba</checksum>
<size type="download">173627205</size>
</artifact>
<artifact type="binary" platform="win64">
<location>https://download.kde.org/stable/krita/4.2.7.1/krita-x64-4.2.7.1-setup.exe</location>
<checksum type="sha256">31538a959e7b271cf7c166f4e1e6162e5958e9b54055c4ecb1f50335fab2f01f</checksum>
<size type="download">109190240</size>
</artifact>
<artifact type="binary" platform="win32">
<location>https://download.kde.org/stable/krita/4.2.8/krita-x86-4.2.8-setup.exe</location>
<checksum type="sha256">3cb92f77e0913a20e2e02a0ba953460a7e39ad0e7a24b9530fc707f6808e8fec</checksum>
<size type="download">107846008</size>
</artifact>
</artifacts>
</release>
</releases>
<custom>
<value key="KDE::windows_store">https://www.microsoft.com/store/apps/9n6x57zgrw96</value>
<value key="KDE::google_play">https://play.google.com/store/apps/details?id=org.krita</value>
</custom>
</component>
......@@ -237,9 +237,10 @@ void KisAutoBrush::generateMaskAndApplyMaskOrCreateDab(KisFixedPaintDeviceSP dst
KisBrush::ColoringInformation* coloringInformation,
KisDabShape const& shape,
const KisPaintInformation& info,
double subPixelX , double subPixelY, qreal softnessFactor) const
double subPixelX , double subPixelY, qreal softnessFactor, qreal lightnessStrength) const
{
Q_UNUSED(info);
Q_UNUSED(lightnessStrength);
// Generate the paint device from the mask
const KoColorSpace* cs = dst->colorSpace();
......
......@@ -64,11 +64,12 @@ public:
}
void generateMaskAndApplyMaskOrCreateDab(KisFixedPaintDeviceSP dst,
KisBrush::ColoringInformation* src,
KisDabShape const&,
const KisPaintInformation& info,
double subPixelX = 0, double subPixelY = 0,
qreal softnessFactor = DEFAULT_SOFTNESS_FACTOR) const override;
KisBrush::ColoringInformation* src,
KisDabShape const&,
const KisPaintInformation& info,
double subPixelX = 0, double subPixelY = 0,
qreal softnessFactor = DEFAULT_SOFTNESS_FACTOR,
qreal lightnessStrength = DEFAULT_LIGHTNESS_STRENGTH) const override;
QPainterPath outline() const override;
......
......@@ -475,16 +475,16 @@ void KisBrush::clearBrushPyramid()
d->brushPyramid.reset(new KisSharedQImagePyramid());
}
void KisBrush::mask(KisFixedPaintDeviceSP dst, const KoColor& color, KisDabShape const& shape, const KisPaintInformation& info, double subPixelX, double subPixelY, qreal softnessFactor) const
void KisBrush::mask(KisFixedPaintDeviceSP dst, const KoColor& color, KisDabShape const& shape, const KisPaintInformation& info, double subPixelX, double subPixelY, qreal softnessFactor, qreal lightnessStrength) const
{
PlainColoringInformation pci(color.data());
generateMaskAndApplyMaskOrCreateDab(dst, &pci, shape, info, subPixelX, subPixelY, softnessFactor);
generateMaskAndApplyMaskOrCreateDab(dst, &pci, shape, info, subPixelX, subPixelY, softnessFactor, lightnessStrength);
}
void KisBrush::mask(KisFixedPaintDeviceSP dst, const KisPaintDeviceSP src, KisDabShape const& shape, const KisPaintInformation& info, double subPixelX, double subPixelY, qreal softnessFactor) const
void KisBrush::mask(KisFixedPaintDeviceSP dst, const KisPaintDeviceSP src, KisDabShape const& shape, const KisPaintInformation& info, double subPixelX, double subPixelY, qreal softnessFactor, qreal lightnessStrength) const
{
PaintDeviceColoringInformation pdci(src, maskWidth(shape, subPixelX, subPixelY, info));
generateMaskAndApplyMaskOrCreateDab(dst, &pdci, shape, info, subPixelX, subPixelY, softnessFactor);
generateMaskAndApplyMaskOrCreateDab(dst, &pdci, shape, info, subPixelX, subPixelY, softnessFactor, lightnessStrength);
}
namespace {
......@@ -503,6 +503,15 @@ void KisBrush::generateMaskAndApplyMaskOrCreateDab(KisFixedPaintDeviceSP dst,
KisDabShape const& shape,
const KisPaintInformation& info_,
double subPixelX, double subPixelY, qreal softnessFactor) const
{
generateMaskAndApplyMaskOrCreateDab(dst, coloringInformation, shape, info_, subPixelX, subPixelY, softnessFactor, DEFAULT_LIGHTNESS_STRENGTH);
}
void KisBrush::generateMaskAndApplyMaskOrCreateDab(KisFixedPaintDeviceSP dst,
ColoringInformation* coloringInformation,
KisDabShape const& shape,
const KisPaintInformation& info_,
double subPixelX, double subPixelY, qreal softnessFactor, qreal lightnessStrength) const
{
KIS_SAFE_ASSERT_RECOVER_RETURN(valid());
Q_UNUSED(info_);
......@@ -536,7 +545,7 @@ void KisBrush::generateMaskAndApplyMaskOrCreateDab(KisFixedPaintDeviceSP dst,
const quint8* maskPointer = outputImage.constScanLine(y);
if (color) {
if (preserveLightness) {
cs->fillGrayBrushWithColorAndLightnessOverlay(rowPointer, reinterpret_cast<const QRgb*>(maskPointer), color, maskWidth);
cs->fillGrayBrushWithColorAndLightnessWithStrength(rowPointer, reinterpret_cast<const QRgb*>(maskPointer), color, lightnessStrength, maskWidth);
}
else {
cs->fillGrayBrushWithColor(rowPointer, reinterpret_cast<const QRgb*>(maskPointer), color, maskWidth);
......
......@@ -49,6 +49,7 @@ enum enumBrushType {
};
static const qreal DEFAULT_SOFTNESS_FACTOR = 1.0;
static const qreal DEFAULT_LIGHTNESS_STRENGTH = 1.0;
class KisBrush;
typedef QSharedPointer<KisBrush> KisBrushSP;
......@@ -266,7 +267,8 @@ public:
const KoColor& color,
KisDabShape const& shape,
const KisPaintInformation& info,
double subPixelX = 0, double subPixelY = 0, qreal softnessFactor = DEFAULT_SOFTNESS_FACTOR) const;
double subPixelX = 0, double subPixelY = 0,
qreal softnessFactor = DEFAULT_SOFTNESS_FACTOR, qreal lightnessStrength = DEFAULT_LIGHTNESS_STRENGTH) const;
/**
* clear dst and fill it with a mask colored with the corresponding colors of src
......@@ -275,7 +277,8 @@ public:
const KisPaintDeviceSP src,
KisDabShape const& shape,
const KisPaintInformation& info,
double subPixelX = 0, double subPixelY = 0, qreal softnessFactor = DEFAULT_SOFTNESS_FACTOR) const;
double subPixelX = 0, double subPixelY = 0,
qreal softnessFactor = DEFAULT_SOFTNESS_FACTOR, qreal lightnessStrength = DEFAULT_LIGHTNESS_STRENGTH) const;
virtual bool hasColor() const;
......@@ -313,7 +316,15 @@ public:
ColoringInformation* coloringInfo,
KisDabShape const&,
const KisPaintInformation& info,
double subPixelX = 0, double subPixelY = 0, qreal softnessFactor = DEFAULT_SOFTNESS_FACTOR) const;
double subPixelX, double subPixelY,
qreal softnessFactor, qreal lightnessStrength) const;
virtual void generateMaskAndApplyMaskOrCreateDab(KisFixedPaintDeviceSP dst,
ColoringInformation* coloringInfo,
KisDabShape const&,
const KisPaintInformation& info,
double subPixelX = 0, double subPixelY = 0,
qreal softnessFactor = DEFAULT_SOFTNESS_FACTOR) const;
/**
......
......@@ -117,13 +117,13 @@ public:
KisDabShape const& shape,
const KisPaintInformation& info,
double subPixelX , double subPixelY,
qreal softnessFactor) {
qreal softnessFactor, qreal lightnessStrength = DEFAULT_LIGHTNESS_STRENGTH) {
QSharedPointer<BrushType> brush = currentBrush(info);
if (!brush) return;
brush->generateMaskAndApplyMaskOrCreateDab(dst, coloringInformation, shape, info, subPixelX, subPixelY, softnessFactor);
brush->generateMaskAndApplyMaskOrCreateDab(dst, coloringInformation, shape, info, subPixelX, subPixelY, softnessFactor, lightnessStrength);
notifyCachedDabPainted(info);
}
......
......@@ -401,9 +401,9 @@ void KisImagePipeBrush::generateMaskAndApplyMaskOrCreateDab(KisFixedPaintDeviceS
KisDabShape const& shape,
const KisPaintInformation& info,
double subPixelX , double subPixelY,
qreal softnessFactor) const
qreal softnessFactor, qreal lightnessStrength) const
{
d->brushesPipe.generateMaskAndApplyMaskOrCreateDab(dst, coloringInformation, shape, info, subPixelX, subPixelY, softnessFactor);
d->brushesPipe.generateMaskAndApplyMaskOrCreateDab(dst, coloringInformation, shape, info, subPixelX, subPixelY, softnessFactor, lightnessStrength);
}
QVector<KisGbrBrushSP> KisImagePipeBrush::brushes() const
......
......@@ -114,7 +114,8 @@ public:
void generateMaskAndApplyMaskOrCreateDab(KisFixedPaintDeviceSP dst, KisBrush::ColoringInformation* coloringInformation,
KisDabShape const&,
const KisPaintInformation& info,
double subPixelX = 0, double subPixelY = 0, qreal softnessFactor = DEFAULT_SOFTNESS_FACTOR) const override;
double subPixelX = 0, double subPixelY = 0,
qreal softnessFactor = DEFAULT_SOFTNESS_FACTOR, qreal lightnessStrength = DEFAULT_LIGHTNESS_STRENGTH) const override;
QVector<KisGbrBrushSP> brushes() const;
......
......@@ -73,7 +73,7 @@ void TestKoDrag::test()
QVERIFY(layer);
QCOMPARE(layer->shapeCount(), 2);
QCOMPARE(fragmentSize.toSize(), QSize(62, 61));
QCOMPARE(fragmentSize.toSize(), QSize(57, 55));
QCOMPARE(KoShape::absoluteOutlineRect(newShapes).toAlignedRect(), QRect(6,6,19,18));
}
......
......@@ -98,8 +98,8 @@ void TestKoMarkerCollection::testMarkerBounds()
QList<KoMarker*> allMarkers = collection.markers();
KoMarker *marker = allMarkers[3];
QCOMPARE(marker->boundingRect(1, 0).toAlignedRect(), QRect(-8,-4,11,8));
QCOMPARE(marker->boundingRect(1, M_PI).toAlignedRect(), QRect(-3,-4,11,8));
QCOMPARE(marker->boundingRect(1, 0).toAlignedRect(), QRect(-7,-3,9,6));
QCOMPARE(marker->boundingRect(1, M_PI).toAlignedRect(), QRect(-2,-3,9,6));
QCOMPARE(marker->outline(1, 0).boundingRect().toAlignedRect(), QRect(-6,-2,7,4));
QCOMPARE(marker->outline(1, M_PI).boundingRect().toAlignedRect(), QRect(-1,-2,7,4));
......
......@@ -49,6 +49,7 @@
#include "KisPaintopSettingsIds.h"
#include "kis_algebra_2d.h"
#include "kis_image_config.h"
struct Q_DECL_HIDDEN KisPaintOpSettings::Private {
......@@ -168,8 +169,27 @@ KisPaintOpSettingsSP KisPaintOpSettings::createMaskingSettings() const
const bool useMasterSize = this->getBool(KisPaintOpUtils::MaskingBrushUseMasterSizeTag, true);
if (useMasterSize) {
/**
* WARNING: cropping is a workaround for too big brushes due to
* the proportional scaling using shift+drag gesture.
*
* See this bug: https://bugs.kde.org/show_bug.cgi?id=423572
*
* TODO:
*
* 1) Implement a warning notifying the user that his masking
* brush has been cropped
*
* 2) Make sure that the sliders in KisMaskingBrushOption have
* correct limits (right now they are limited by usual
* maximumBrushSize)
*/
const qreal maxBrushSize = KisImageConfig(true).readEntry("maximumBrushSize", 1000);
const qreal maxMaskingBrushSize = qMin(15000.0, 3.0 * maxBrushSize);
const qreal masterSizeCoeff = getDouble(KisPaintOpUtils::MaskingBrushMasterSizeCoeffTag, 1.0);
maskingSettings->setPaintOpSize(masterSizeCoeff * paintOpSize());
maskingSettings->setPaintOpSize(qMin(maxMaskingBrushSize, masterSizeCoeff * paintOpSize()));
}
return maskingSettings;
......
......@@ -502,3 +502,12 @@ KisKeyframeChannel *KisBaseNode::requestKeyframeChannel(const QString &id)
return 0;
}
bool KisBaseNode::supportsKeyframeChannel(const QString &id)
{
if (id == KisKeyframeChannel::Opacity.id() && original()) {
return true;
}
return false;
}
......@@ -590,6 +590,18 @@ protected:
*/
virtual KisKeyframeChannel * requestKeyframeChannel(const QString &id);
public:
/**
* Ideally, this function would be used to query for keyframe support
* before trying to create channels. The ability to query would help
* in cases such as animation curves where you might want to ask
* which channels it supports before allowing the user to add.
*
* @param id querried channel
* @return bool whether it supports said channel or not.
*/
virtual bool supportsKeyframeChannel(const QString &id);
Q_SIGNALS:
void keyframeChannelAdded(KisKeyframeChannel *channel);
......
......@@ -141,6 +141,27 @@ public:
QColor selectionOverlayMaskColor(bool defaultValue = false) const;
void setSelectionOverlayMaskColor(const QColor &color);
template<class T>
void writeEntry(const QString& name, const T& value) {
m_config.writeEntry(name, value);
}
template<class T>
void writeList(const QString& name, const QList<T>& value) {
m_config.writeEntry(name, value);
}
template<class T>
T readEntry(const QString& name, const T& defaultValue=T()) {
return m_config.readEntry(name, defaultValue);
}
template<class T>
QList<T> readList(const QString& name, const QList<T>& defaultValue=QList<T>()) {
return m_config.readEntry(name, defaultValue);
}
static void resetConfig();
private:
......
......@@ -499,6 +499,15 @@ KisKeyframeChannel *KisMask::requestKeyframeChannel(const QString &id)
return KisNode::requestKeyframeChannel(id);
}
bool KisMask::supportsKeyframeChannel(const QString &id)
{
if (id == KisKeyframeChannel::Content.id() && paintDevice()) {
return true;
}
return KisNode::supportsKeyframeChannel(id);
}
void KisMask::baseNodeChangedCallback()
{
KisNodeSP up = parent();
......
......@@ -218,6 +218,7 @@ protected:
virtual bool paintsOutsideSelection() const;
KisKeyframeChannel *requestKeyframeChannel(const QString &id) override;
bool supportsKeyframeChannel(const QString &id) override;
void baseNodeChangedCallback() override;
......
......@@ -341,6 +341,15 @@ KisKeyframeChannel *KisPaintLayer::requestKeyframeChannel(const QString &id)
return KisLayer::requestKeyframeChannel(id);
}
bool KisPaintLayer::supportsKeyframeChannel(const QString &id)
{
if (id == KisKeyframeChannel::Content.id()) {
return true;
}
return KisLayer::supportsKeyframeChannel(id);
}
KisPaintDeviceList KisPaintLayer::getLodCapableDevices() const
{
KisPaintDeviceList list = KisLayer::getLodCapableDevices();
......
......@@ -175,6 +175,7 @@ protected:
const QRect& rect) const override;
KisKeyframeChannel *requestKeyframeChannel(const QString &id) override;
bool supportsKeyframeChannel(const QString &id) override;
private:
void init(KisPaintDeviceSP paintDevice, const QBitArray &paintChannelFlags = QBitArray());
......
......@@ -288,6 +288,15 @@ KisKeyframeChannel *KisSelectionBasedLayer::requestKeyframeChannel(const QString
return KisLayer::requestKeyframeChannel(id);
}
bool KisSelectionBasedLayer::supportsKeyframeChannel(const QString &id)
{
if (id == KisKeyframeChannel::Content.id()) {
return true;
}
return KisLayer::supportsKeyframeChannel(id);
}
void KisSelectionBasedLayer::setDirty()
{
Q_ASSERT(image());
......
......@@ -189,6 +189,8 @@ protected:
void setUseSelectionInProjection(bool value) const;
KisKeyframeChannel *requestKeyframeChannel(const QString &id) override;
bool supportsKeyframeChannel(const QString &id) override;
public Q_SLOTS:
void slotImageSizeChanged();
......
......@@ -496,3 +496,24 @@ KisKeyframeChannel *KisTransformMask::requestKeyframeChannel(const QString &id)
return KisEffectMask::requestKeyframeChannel(id);
}
bool KisTransformMask::supportsKeyframeChannel(const QString &id)
{
if (id == KisKeyframeChannel::TransformArguments.id() ||
id == KisKeyframeChannel::TransformPositionX.id() ||
id == KisKeyframeChannel::TransformPositionY.id() ||
id == KisKeyframeChannel::TransformScaleX.id() ||
id == KisKeyframeChannel::TransformScaleY.id() ||
id == KisKeyframeChannel::TransformShearX.id() ||
id == KisKeyframeChannel::TransformShearY.id() ||
id == KisKeyframeChannel::TransformRotationX.id() ||
id == KisKeyframeChannel::TransformRotationY.id() ||
id == KisKeyframeChannel::TransformRotationZ.id()) {
return true;
}
else if (id == KisKeyframeChannel::Opacity.id()) {
return false;
}
return KisEffectMask::supportsKeyframeChannel(id);
}
......@@ -82,6 +82,7 @@ public:
protected:
KisKeyframeChannel *requestKeyframeChannel(const QString &id) override;
bool supportsKeyframeChannel(const QString &id) override;
Q_SIGNALS:
void sigInternalForceStaticImageUpdate();
......
......@@ -420,4 +420,4 @@ void KisAslLayerStyleSerializerTest::testWritingGradients()
}
}
QTEST_MAIN(KisAslLayerStyleSerializerTest)
KISTEST_MAIN(KisAslLayerStyleSerializerTest)
......@@ -329,4 +329,4 @@ void KisAslParserTest::testParserWithPatterns()
}
}
QTEST_MAIN(KisAslParserTest)
KISTEST_MAIN(KisAslParserTest)
......@@ -57,9 +57,7 @@ public:
// blend the color channels as if we were painting on the layer below
for (qint8 channel = 0; channel < channels_nb; ++channel)
if(channel != alpha_pos && (allChannelFlags || channelFlags.testBit(channel))) {
/*each color blended in proportion to their calculated opacity*/
channels_type srcMult= mul(src[channel], appliedAlpha);
dst[channel] = lerp(srcMult,dst[channel],dstAlpha);
dst[channel] = lerp(src[channel],dst[channel],dstAlpha);
}
}
else if (srcAlpha != zeroValue<channels_type>()) {
......
......@@ -112,7 +112,7 @@ void parseColorStopsList(QDomElement parent,
QVector<qreal> &startLocations,
QVector<qreal> &middleOffsets,
QVector<QColor> &colors,
QVector<KoGradientSegmentEndpointType> types)
QVector<KoGradientSegmentEndpointType> &types)
{
QDomNode child = parent.firstChild();
while (!child.isNull()) {
......@@ -451,11 +451,13 @@ bool tryParseDescriptor(const QDomElement &el,
if (colors.size() < transparencies.size()) {
const QColor lastColor = !colors.isEmpty() ? colors.last() : QColor(Qt::black);
const KoGradientSegmentEndpointType lastType = !types.isEmpty() ? types.last() : COLOR_ENDPOINT;
while (colors.size() != transparencies.size()) {
const int index = colors.size();
colors.append(lastColor);