|
Krita Source Code Documentation
|
#include <transform_stroke_strategy.h>
Inheritance diagram for TransformStrokeStrategy:Classes | |
| class | CalculateConvexHullData |
| class | ClearSelectionData |
| class | PreparePreviewData |
| struct | TransformAllData |
| class | TransformData |
Signals | |
| void | sigConvexHullCalculated (QPolygon convexHull, void *cookie) |
| void | sigPreviewDeviceReady (KisPaintDeviceSP device) |
| void | sigTransactionGenerated (TransformTransactionProperties transaction, ToolTransformArgs args, void *cookie) |
Private Member Functions | |
| QPolygon | calculateConvexHull () |
| bool | checkBelongsToSelection (KisPaintDeviceSP device) const |
| void | clearSelection (KisPaintDeviceSP device) |
| KisPaintDeviceSP | createDeviceCache (KisPaintDeviceSP src) |
| KoUpdaterPtr | fetchUpdater (KisNodeSP node) |
| void | finishStrokeImpl (bool applyTransform, const ToolTransformArgs &args) |
| KisPaintDeviceSP | getDeviceCache (KisPaintDeviceSP src) |
| bool | haveDeviceInCache (KisPaintDeviceSP src) |
| void | putDeviceCache (KisPaintDeviceSP src, KisPaintDeviceSP cache) |
Private Attributes | |
| bool | m_convexHullHasBeenCalculated = false |
| int | m_currentTime = -1 |
| QList< KisSelectionMaskSP > | m_deactivatedOverlaySelectionMasks |
| QList< KisSelectionSP > | m_deactivatedSelections |
| QHash< KisPaintDevice *, KisPaintDeviceSP > | m_devicesCacheHash |
| QMutex | m_devicesCacheMutex |
| QVector< KisDecoratedNodeInterface * > | m_disabledDecoratedNodes |
| QString | m_filterId |
| bool | m_finalizingActionsStarted = false |
| bool | m_forceReset |
| QList< KisNodeSP > | m_hiddenProjectionLeaves |
| ToolTransformArgs | m_initialTransformArgs |
| ToolTransformArgs::TransformMode | m_mode |
| const KisSavedMacroCommand * | m_overriddenCommand = 0 |
| KisNodeList | m_processedNodes |
| KisNodeList | m_rootNodes |
| boost::optional< ToolTransformArgs > | m_savedTransformArgs |
| KisSelectionSP | m_selection |
| QVector< const KUndo2Command * > | m_skippedWhileMergeCommands |
| KisBatchNodeUpdateSP | m_updateData |
| bool | m_updatesDisabled = false |
| KisUpdatesFacade * | m_updatesFacade |
| KisTransformMaskSP | writeToTransformMask |
Additional Inherited Members | |
Public Types inherited from KisSimpleStrokeStrategy | |
| enum | JobType { JOB_INIT = 0 , JOB_CANCEL , JOB_FINISH , JOB_DOSTROKE , JOB_SUSPEND , JOB_RESUME , NJOBS } |
Static Public Member Functions inherited from KisSimpleStrokeStrategy | |
| static QLatin1String | jobTypeToString (JobType type) |
Definition at line 27 of file transform_stroke_strategy.h.
| TransformStrokeStrategy::TransformStrokeStrategy | ( | ToolTransformArgs::TransformMode | mode, |
| const QString & | filterId, | ||
| bool | forceReset, | ||
| KisNodeList | rootNodes, | ||
| KisSelectionSP | selection, | ||
| KisStrokeUndoFacade * | undoFacade, | ||
| KisUpdatesFacade * | updatesFacade ) |
Definition at line 56 of file transform_stroke_strategy.cpp.
References KisSharedPtr< T >::data(), KIS_SAFE_ASSERT_RECOVER_NOOP, m_rootNodes, KisStrokeStrategyUndoCommandBased::setMacroId(), and KisCommandUtils::TransformToolId.
|
override |
Definition at line 80 of file transform_stroke_strategy.cpp.
|
private |
Definition at line 448 of file transform_stroke_strategy.cpp.
References AlphaColorModelID, KoColorSpace::colorModelId(), KisPaintDevice::colorSpace(), KisPaintDevice::compositionSourceColorSpace(), KisSharedPtr< T >::data(), ENTER_FUNCTION, KisConvexHull::findConvexHull(), KisConvexHull::findConvexHullSelectionLike(), getDeviceCache(), haveDeviceInCache(), m_processedNodes, m_selection, KisBaseNode::paintDevice(), KisSelection::pixelSelection, and ppVar.
|
overridevirtual |
Reimplemented from KisStrokeStrategyUndoCommandBased.
Definition at line 805 of file transform_stroke_strategy.cpp.
References KisUpdatesFacade::enableDirtyRequests(), finishStrokeImpl(), ToolTransformArgs::isUnchanging(), m_initialTransformArgs, m_updatesDisabled, and m_updatesFacade.
|
private |
Definition at line 125 of file transform_stroke_strategy.cpp.
References KisSharedPtr< T >::data(), m_selection, KisSelection::pixelSelection, and KisSelection::projection().
|
private |
Definition at line 421 of file transform_stroke_strategy.cpp.
References KisPaintDevice::clear(), KisPaintDevice::clearSelection(), KisTransaction::endAndTake(), m_selection, KisStrokeJobData::NORMAL, KisStrokeStrategyUndoCommandBased::runAndSaveCommand(), and KisStrokeJobData::SEQUENTIAL.
|
private |
Definition at line 84 of file transform_stroke_strategy.cpp.
References KisPainter::bitBlt(), KisPaintDevice::createCompositionSourceDevice(), m_selection, KisSelection::selectedExactRect(), and KisPainter::setSelection().
|
overridevirtual |
Shape layer's projection may not be yet ready right after transformation, because it need to do that in the GUI thread, so we should approximate that.
We use usual transaction here, because we cannot calculate transformation for perspective and warp workers.
Selection masks might have an overlay enabled, we should disable that
Reimplemented from KisStrokeStrategyUndoCommandBased.
Definition at line 132 of file transform_stroke_strategy.cpp.
References KisNodeFacade::addNode(), KisImage::animationInterface(), KisImage::bounds(), bounds, calculateConvexHull(), checkBelongsToSelection(), KisNode::childCount(), clearSelection(), KisNode::clone(), KoColorSpace::colorDepthId(), KoColorSpace::colorModelId(), KisImage::colorSpace(), KisPaintDevice::colorSpace(), KisStrokeJobData::CONCURRENT, TransformStrokeStrategy::TransformAllData::config, TransformStrokeStrategy::TransformData::config, KisPaintDevice::convertTo(), createDeviceCache(), KisTransformUtils::createTransformWorker(), KisImageAnimationInterface::currentTime(), KisSharedPtr< T >::data(), KoColor::data(), KisPaintDevice::defaultBounds(), TransformStrokeStrategy::TransformData::destination, KisStrokeStrategyUndoCommandBased::doStrokeCallback(), KisTransaction::endAndTake(), KisPaintDevice::exactBounds(), KisImageAnimationInterface::explicitlySetCurrentTime(), KisBaseNode::extent(), KisPaintDevice::extent(), KisLayerUtils::forceAllDelayedNodesUpdate(), ToolTransformArgs::FREE_TRANSFORM, getDeviceCache(), GrayAColorModelID, haveDeviceInCache(), KoID::id(), KisBaseNode::image, KoColorSpaceRegistry::instance(), Integer8BitsColorDepthID, KIS_SAFE_ASSERT_RECOVER, kisGrowRect(), m_convexHullHasBeenCalculated, m_deactivatedSelections, m_hiddenProjectionLeaves, m_processedNodes, m_rootNodes, m_savedTransformArgs, m_selection, m_updateData, makeKisDeleteLaterWrapper(), ToolTransformArgs::mode(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::nextPixel(), TransformStrokeStrategy::TransformData::node, TransformStrokeStrategy::ClearSelectionData::node, KisStrokeJobData::NORMAL, TransformStrokeStrategy::TransformData::PAINT_DEVICE, KisBaseNode::paintDevice(), ToolTransformArgs::PERSPECTIVE_4POINT, KisSelection::pixelSelection, KoColorSpace::pixelSize(), KisImage::projection(), KisBaseNode::projection(), KisNode::projectionLeaf, KisNode::projectionPlane(), putDeviceCache(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::rawData(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::rawDataConst(), KisLayerUtils::recursiveApplyNodes(), KisImage::refreshGraphAsync(), KisLayerUtils::refreshHiddenAreaAsync(), KisImage::rootLayer(), KisStrokeStrategyUndoCommandBased::runAndSaveCommand(), KisImageConfig::selectionOverlayMaskColor(), KisStrokeJobData::SEQUENTIAL, KisPaintDevice::setDefaultBounds(), KoColor::setOpacity(), KisGroupLayer::setPassThroughMode(), KisImage::setRootLayer(), KisSelection::setVisible(), sigConvexHullCalculated(), sigPreviewDeviceReady(), KisTransformUtils::transformAndMergeDevice(), KisTransformUtils::transformDevice(), and KisImage::waitForDone().
|
private |
|
overridevirtual |
Reimplemented from KisStrokeStrategyUndoCommandBased.
Definition at line 795 of file transform_stroke_strategy.cpp.
References cancelStrokeCallback(), finishStrokeImpl(), and m_savedTransformArgs.
|
private |
Since our finishStrokeCallback() initiates new jobs, cancellation request may come even after finishStrokeCallback() (cancellations may be called until there are no jobs left in the stroke's queue).
Therefore we should check for double-entry here and make sure the finalizing jobs are no cancellable.
Definition at line 710 of file transform_stroke_strategy.cpp.
References KritaUtils::addJobBarrier(), KisStrokeStrategy::addMutatedJobs(), KisStrokeJobData::BARRIER, KisStrokeStrategyUndoCommandBased::cancelStrokeCallback(), KisSharedPtr< T >::data(), KisUpdatesFacade::disableDirtyRequests(), KisUpdatesFacade::enableDirtyRequests(), KisCommandUtils::FlipFlopCommand::FINALIZING, KisStrokeStrategyUndoCommandBased::finishStrokeCallback(), KisCommandUtils::FlipFlopCommand::INITIALIZING, m_deactivatedOverlaySelectionMasks, m_deactivatedSelections, m_finalizingActionsStarted, m_hiddenProjectionLeaves, m_processedNodes, m_rootNodes, m_savedTransformArgs, m_updateData, m_updatesDisabled, m_updatesFacade, KisStrokeJobData::NORMAL, TransformStrokeStrategy::TransformData::PAINT_DEVICE, KisNode::projectionLeaf, KisStrokeStrategyUndoCommandBased::runAndSaveCommand(), KisMask::selection, TransformStrokeStrategy::TransformData::SELECTION, KisNode::setDirty(), KisSelectionMask::setDirty(), KisSelection::setVisible(), and toQShared().
|
private |
Definition at line 114 of file transform_stroke_strategy.cpp.
References m_devicesCacheHash, m_devicesCacheMutex, and warnKrita.
|
private |
Definition at line 102 of file transform_stroke_strategy.cpp.
References m_devicesCacheHash, and m_devicesCacheMutex.
|
overridevirtual |
We must request shape layers to rerender areas outside image bounds
We must ensure that the currently selected subtree has finished all its updates.
Disable all decorated nodes to generate outline and preview correctly. We will enable them back as soon as preview generation is finished.
Filter masks have special handling of transparency. Their filter may declare if they affect transparent pixels or not. In case of transformations we don't care about that, we should just transform non-default area of the mask.
We shouldn't include masks or layer styles into the handles rect, in the end, we process the paint device only
recover back visibility of decorated nodes
Reimplemented from KisStrokeStrategyUndoCommandBased.
Definition at line 508 of file transform_stroke_strategy.cpp.
References KisAutoKey::activeMode(), KritaUtils::addJobBarrier(), KritaUtils::addJobSequential(), KisStrokeStrategy::addMutatedJobs(), KisStrokeJobData::BARRIER, ToolTransformArgs::boundsRotation(), calculateConvexHull(), KisSharedPtr< T >::clear(), TransformTransactionProperties::currentConfig(), KisSharedPtr< T >::data(), KisDecoratedNodeInterface::decorationsVisible(), KisBaseNode::exactBounds(), KisPaintDevice::exactBounds(), KisTransformUtils::fetchCurrentImageTime(), KisTransformUtils::fetchNodesList(), KisCommandUtils::FlipFlopCommand::FINALIZING, KisLayerUtils::forceAllDelayedNodesUpdate(), KisLayerUtils::forceAllHiddenOriginalsUpdate(), KisNode::graphListener, KisNodeGraphListener::graphOverlayNode(), KisBaseNode::hasEditablePaintDevice(), KisCommandUtils::FlipFlopCommand::INITIALIZING, KisStrokeStrategyUndoCommandBased::initStrokeCallback(), KIS_SAFE_ASSERT_RECOVER_NOOP, m_convexHullHasBeenCalculated, m_currentTime, m_deactivatedOverlaySelectionMasks, m_deactivatedSelections, m_disabledDecoratedNodes, m_filterId, m_forceReset, m_initialTransformArgs, m_mode, m_overriddenCommand, m_processedNodes, m_rootNodes, m_selection, m_updatesFacade, KisLazyCreateTransformMaskKeyframesCommand::maskHasAnimation(), KisAutoKey::NONE, KisStrokeJobData::NORMAL, KisBaseNode::paintDevice(), KisNode::projectionLeaf, KisNode::projectionPlane(), KisTransformUtils::resetArgsForMode(), KisStrokeStrategyUndoCommandBased::runAndSaveCommand(), KisSelection::selectedExactRect(), TransformTransactionProperties::setConvexHull(), TransformTransactionProperties::setConvexHullHasBeenRequested(), KisSelectionMask::setDecorationsVisible(), KisDecoratedNodeInterface::setDecorationsVisible(), KisSelection::setVisible(), sigTransactionGenerated(), KisLayerUtils::sortAndFilterMergeableInternalNodes(), KisAutoKey::SupportsLod, toQShared(), KisAutoKey::tryAutoCreateDuplicatedFrame(), KisTransformUtils::tryFetchArgsFromCommandAndUndo(), KisTransformUtils::tryInitArgsFromNode(), KisTransformUtils::tryOverrideRootToTransformMask(), and KisStrokeStrategyUndoCommandBased::undoFacade().
|
overrideprotectedvirtual |
Applies some modifications (e.g. assigning extra data) to the toplevel command.
Reimplemented from KisStrokeStrategyUndoCommandBased.
Definition at line 434 of file transform_stroke_strategy.cpp.
References KIS_SAFE_ASSERT_RECOVER_RETURN, m_currentTime, m_overriddenCommand, m_processedNodes, m_rootNodes, m_savedTransformArgs, KisStrokeStrategyUndoCommandBased::postProcessToplevelCommand(), and KisTransformUtils::postProcessToplevelCommand().
|
private |
Definition at line 108 of file transform_stroke_strategy.cpp.
References m_devicesCacheHash, and m_devicesCacheMutex.
|
signal |
|
signal |
|
private |
Definition at line 156 of file transform_stroke_strategy.h.
|
private |
Definition at line 146 of file transform_stroke_strategy.h.
|
private |
Definition at line 149 of file transform_stroke_strategy.h.
|
private |
Definition at line 147 of file transform_stroke_strategy.h.
|
private |
Definition at line 138 of file transform_stroke_strategy.h.
|
private |
Definition at line 137 of file transform_stroke_strategy.h.
|
private |
Definition at line 150 of file transform_stroke_strategy.h.
|
private |
Definition at line 132 of file transform_stroke_strategy.h.
|
private |
Definition at line 155 of file transform_stroke_strategy.h.
|
private |
Definition at line 133 of file transform_stroke_strategy.h.
Definition at line 148 of file transform_stroke_strategy.h.
|
private |
Definition at line 142 of file transform_stroke_strategy.h.
|
private |
Definition at line 131 of file transform_stroke_strategy.h.
|
private |
Definition at line 152 of file transform_stroke_strategy.h.
|
private |
Definition at line 145 of file transform_stroke_strategy.h.
|
private |
Definition at line 144 of file transform_stroke_strategy.h.
|
private |
Definition at line 143 of file transform_stroke_strategy.h.
|
private |
Definition at line 135 of file transform_stroke_strategy.h.
|
private |
Definition at line 153 of file transform_stroke_strategy.h.
|
private |
Definition at line 129 of file transform_stroke_strategy.h.
|
private |
Definition at line 130 of file transform_stroke_strategy.h.
|
private |
Definition at line 128 of file transform_stroke_strategy.h.
|
private |
Definition at line 140 of file transform_stroke_strategy.h.