Krita Source Code Documentation
Loading...
Searching...
No Matches
KisLayerStyleKnockoutBlower.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2019 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
7
8#include "kis_painter.h"
10#include "kis_default_bounds.h"
12
13
17
19 : m_knockoutSelection(rhs.m_knockoutSelection ? new KisSelection(*rhs.m_knockoutSelection) : nullptr)
20{
21}
22
24{
25 {
26 QReadLocker l(&m_lock);
29 }
30 }
31
32 {
33 QWriteLocker l(&m_lock);
36 } else {
40 }
41 }
42}
43
45{
46 QWriteLocker l(&m_lock);
47 m_knockoutSelection = selection;
48}
49
55
56void KisLayerStyleKnockoutBlower::apply(KisPainter *painter, KisPaintDeviceSP mergedStyle, const QRect &rect) const
57{
58 QReadLocker l(&m_lock);
59
61
62 painter->setOpacityToUnit();
63 painter->setChannelFlags(QBitArray());
66 painter->bitBlt(rect.topLeft(), mergedStyle, rect);
67 painter->setSelection(0);
68}
69
71{
72 QReadLocker l(&m_lock);
73 return !m_knockoutSelection;
74}
const QString COMPOSITE_COPY
static KisImageResolutionProxySP identity()
void setKnockoutSelection(KisSelectionSP selection)
void apply(KisPainter *painter, KisPaintDeviceSP mergedStyle, const QRect &rect) const
void setSelection(KisSelectionSP selection)
void bitBlt(qint32 dstX, qint32 dstY, const KisPaintDeviceSP srcDev, qint32 srcX, qint32 srcY, qint32 srcWidth, qint32 srcHeight)
void setOpacityToUnit()
void setChannelFlags(QBitArray channelFlags)
void setCompositeOpId(const KoCompositeOp *op)
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)
Definition kis_assert.h:130