42 bool canHaveChildNodes =
false;
43 bool dependsOnLowerNodes =
false;
48 canHaveChildNodes = sourceLayer->
projectionLeaf()->canHaveChildLayers();
49 dependsOnLowerNodes = sourceLayer->
projectionLeaf()->dependsOnLowerNodes();
50 this->sourceLayer = sourceLayer;
55 result << stylesBefore;
56 result << stylesOverlay;
57 result << strokeStyle;
58 result << stylesAfter;
64 if (!plane->isEmpty())
return true;
72 if (!plane->knockoutBlower()->isEmpty())
return true;
76 if (!plane->knockoutBlower()->isEmpty())
return true;
79 if (!strokeStyle->knockoutBlower()->isEmpty())
return true;
106 m_d->style = clonedStyle;
158 m_d->strokeStyle.reset(stroke);
226 if (
m_d->style->isEnabled()) {
230 plane->recalculate(
rect, filthyNode, flags);
233 result = sourcePlane->recalculate(
rect, filthyNode, flags);
239void KisLayerStyleProjectionPlane::Private::applyComplexPlane(
KisPainter *painter,
244 if (plane->isEmpty())
return;
246 if (!plane->knockoutBlower()->isEmpty()) {
252 plane->apply(&overlayPainter,
rect);
253 plane->knockoutBlower()->apply(painter, mergedStyle,
rect);
256 plane->apply(painter,
rect);
264 if (
m_d->style->isEnabled()) {
265 if (
m_d->hasOverlayStyles() ||
m_d->hasKnockoutStyles()) {
271 m_d->applyComplexPlane(painter, plane,
rect, originalClone);
275 !
m_d->strokeStyle->isEmpty() ?
276 m_d->strokeStyle->sourcePlaneOpacityThresholdRequirement() :
279 if (
m_d->hasOverlayStyles()) {
293 plane->apply(&overlayPainter,
rect);
301 blower.
apply(painter, sourceProjection,
rect);
305 sourcePlane->applyMaxOutAlpha(painter,
rect, sourceThresholdMode);
308 if (!
m_d->strokeStyle->isEmpty()) {
313 m_d->applyComplexPlane(painter, plane,
rect, originalClone);
317 plane->apply(painter,
rect);
320 sourcePlane->apply(painter,
rect);
323 plane->apply(painter,
rect);
327 sourcePlane->apply(painter,
rect);
336 if (
m_d->style->isEnabled()) {
338 list << plane->getLodCapableDevices();
341 list << sourcePlane->getLodCapableDevices();
343 list << sourcePlane->getLodCapableDevices();
360 const bool adjustmentAboveDirty =
m_d->dependsOnLowerNodes &&
363 if (
m_d->style->isEnabled() && adjustmentAboveDirty) {
376 QRect layerChangeRect = sourcePlane->changeRect(
rect, pos);
379 if (
m_d->style->isEnabled() && !layerChangeRect.isEmpty()) {
393 if (
m_d->style->isEnabled()) {
413 if (
m_d->style->isEnabled()) {
426 QRect
rect = sourcePlane->tightUserVisibleBounds();
429 rect |= plane->tightUserVisibleBounds();
438 QRect
rect = sourcePlane->looseUserVisibleBounds();
441 rect |= plane->looseUserVisibleBounds();
void setStyle(KisLayerStyleFilter *filter, KisPSDLayerStyleSP style)
void setKnockoutSelection(KisSelectionSP selection)
void resetKnockoutSelection()
void apply(KisPainter *painter, KisPaintDeviceSP mergedStyle, const QRect &rect) const
void makeCloneFromRough(KisPaintDeviceSP src, const QRect &minimalRect)
#define KIS_ASSERT_RECOVER(cond)
#define KIS_SAFE_ASSERT_RECOVER(cond)
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
QSharedPointer< T > toQShared(T *ptr)
void selectionFromAlphaChannel(KisPaintDeviceSP srcDevice, KisSelectionSP dstSelection, const QRect &srcRect)
void thresholdOpacityAlpha8(KisPaintDeviceSP device, const QRect &rect, ThresholdMode mode)
KisPaintDeviceSP device() const
KisCachedSelection cachedSelection
QRect changeRect(const QRect &rect, KisLayer::PositionToFilthy pos) const override
const QScopedPointer< Private > m_d
QRect needRectForOriginal(const QRect &rect) const override
QRect looseUserVisibleBounds() const override
bool hasOverlayStyles() const
KisPaintDeviceList getLodCapableDevices() const override
void apply(KisPainter *painter, const QRect &rect) override
static KisAbstractProjectionPlaneSP factoryObject(KisLayer *sourceLayer)
~KisLayerStyleProjectionPlane() override
KisCachedPaintDevice cachedPaintDevice
QRect stylesNeedRect(const QRect &rect) const
QVector< KisLayerStyleFilterProjectionPlaneSP > allStyles() const
KisStrokeLayerStyleFilterProjectionPlaneSP strokeStyle
QRect tightUserVisibleBounds() const override
QVector< KisLayerStyleFilterProjectionPlaneSP > stylesOverlay
void applyComplexPlane(KisPainter *painter, KisLayerStyleFilterProjectionPlaneSP plane, const QRect &rect, KisPaintDeviceSP originalClone)
QRect needRect(const QRect &rect, KisLayer::PositionToFilthy pos) const override
KisLayerProjectionPlaneWSP sourceProjectionPlane
bool hasKnockoutStyles() const
QVector< KisLayerStyleFilterProjectionPlaneSP > stylesAfter
QRect recalculate(const QRect &rect, KisNodeSP filthyNode, KisRenderPassFlags flags) override
KisLayerStyleProjectionPlane(KisLayer *sourceLayer)
void init(KisLayer *sourceLayer, KisPSDLayerStyleSP layerStyle)
QVector< KisLayerStyleFilterProjectionPlaneSP > stylesBefore
QRect accessRect(const QRect &rect, KisLayer::PositionToFilthy pos) const override
void initSourcePlane(KisLayer *sourceLayer)
virtual KisLayerProjectionPlaneSP internalProjectionPlane() const
KisPSDLayerStyleSP layerStyle
KisProjectionLeafSP projectionLeaf
The KisPSDLayerStyle class implements loading, saving and applying the PSD layer effects.
KisPixelSelectionSP pixelSelection