Krita Source Code Documentation
Loading...
Searching...
No Matches
KisCanvas2 Class Reference

#include <kis_canvas2.h>

+ Inheritance diagram for KisCanvas2:

Classes

struct  CanvasInputActionGroupsMaskInterface
 

Public Slots

void channelSelectionChanged ()
 
void finishResizingImage (qint32 w, qint32 h)
 
qreal rotationAngle () const
 canvas rotation in degrees
 
void slotChangeGlobalProofingConfig ()
 
void slotChangeProofingConfig ()
 
void slotConfigChanged ()
 
void slotGamutCheck ()
 
void slotPopupPaletteRequestedZoomChange (int zoom)
 
void slotScreenChanged (QScreen *screen)
 
void slotSoftProofing ()
 
void slotTrySwitchShapeManager ()
 
void startResizingImage ()
 
void startUpdateInPatches (const QRect &imageRect)
 
void updateCanvas ()
 Update the entire canvas area.
 
void updateCanvasDecorations ()
 
void updateCanvasDecorations (const QRectF &docRect)
 
void updateCanvasProjection (const QRectF &docRect)
 
void updateCanvasScene ()
 
void updateCanvasToolOutlineDoc (const QRectF &docRect)
 
void updateCanvasToolOutlineWdg (const QRect &widgetRect)
 
bool xAxisMirrored () const
 Bools indicating canvasmirroring.
 
bool yAxisMirrored () const
 

Signals

void sigCanvasCacheUpdated ()
 
void sigCanvasEngineChanged ()
 
void sigCanvasStateChanged ()
 
void sigContinueResizeImage (qint32 w, qint32 h)
 
void sigRegionOfInterestChanged (const QRect &roi)
 
void updateCanvasRequested (const QRect &rc)
 

Public Member Functions

void addCommand (KUndo2Command *command) override
 
void addDecoration (KisCanvasDecorationSP deco)
 
KisCanvasAnimationState * animationState () const
 
void assignChangedMultiSurfaceState (const KisMultiSurfaceStateManager::State &newState)
 
void assignChangedMultiSurfaceStateSkipCanvasSurface (const KisMultiSurfaceStateManager::State &newState)
 
bool canvasIsOpenGL () const override
 
const QWidget * canvasWidget () const override
 
QWidget * canvasWidget () override
 
QString colorManagementReport () const
 
const KisCoordinatesConverter * coordinatesConverter () const
 
KisImageWSP currentImage () const
 
int currentScreenId () const
 
KoShape * currentShapeManagerOwnerShape () const override
 the shape that owns the currently active shape manager
 
KisCanvasDecorationSP decoration (const QString &id) const
 
void disconnectCanvasObserver (QObject *object) override
 
void disconnectImage ()
 
KisDisplayColorConverter * displayColorConverter () const
 
QSharedPointer< KisDisplayFilter > displayFilter () const
 
KoColorDisplayRendererInterface * displayRendererInterface () const override
 displayRendererInterface The display renderer interface has a number of color conversion functions which are useful to convert a KoColor to a QColor.
 
QPoint documentOffset () const
 
QPoint documentOrigin () const override
 
QRect docUpdateRectToWidget (const QRectF &docRect)
 
bool effectiveLodAllowedInImage () const
 
KisExposureGammaCorrectionInterface * exposureGammaCorrectionInterface () const
 
void fetchProofingOptions ()
 fetchProofingOptions Get the options for softproofing, and apply the view-specific state without affecting the proofing options as stored inside the image.
 
KisAnimationFrameCacheSP frameCache () const
 
KisInputManager * globalInputManager () const
 
KoShapeManager * globalShapeManager () const
 
void gridSize (QPointF *offset, QSizeF *spacing) const override
 
KisImageWSP image () const
 
QPointer< KisView > imageView () const
 
void initializeImage ()
 
KisInputActionGroupsMaskInterface::SharedInterface inputActionGroupsMaskInterface ()
 
 KisCanvas2 (KisCoordinatesConverter *coordConverter, KoCanvasResourceProvider *resourceManager, KisMainWindow *mainWindow, KisView *view, KoShapeControllerBase *sc)
 
 KisCanvas2Private (KisCanvas2 *parent, KisCoordinatesConverter *coordConverter, QPointer< KisView > view, KoCanvasResourceProvider *resourceManager)
 
KoShapeManager * localShapeManager () const
 
bool lodIsSupported () const
 
bool lodPreferredInCanvas () const
 
KisOpenGL::FilterMode openGLFilterMode () const
 
KisPaintingAssistantsDecorationSP paintingAssistantsDecoration () const
 
KisPopupPalette * popupPalette ()
 
bool proofingConfigUpdated ()
 proofingConfigUpdated ask the canvas whether or not it updated the proofing config.
 
KisProofingConfigurationSP proofingConfiguration () const
 
KisReferenceImagesDecorationSP referenceImagesDecoration () const
 
void refetchDataFromImage ()
 
QRect regionOfInterest () const
 
QRect renderingLimit () const
 
KoSelectedShapesProxy * selectedShapesProxy () const override
 
void setActiveShapeManager (KoShapeManager *shapeManager)
 
void setCurrentShapeManagerOwnerShape (KoShape *source) override
 sets the group shape that is supposed to be "entered"
 
void setCursor (const QCursor &cursor) override
 
void setDisplayFilter (QSharedPointer< KisDisplayFilter > displayFilter)
 
void setFavoriteResourceManager (KisFavoriteResourceManager *favoriteResourceManager)
 
void setLodPreferredInCanvas (bool value)
 
void setProofingConfigUpdated (bool updated)
 setProofingConfigUpdated This function is to set whether the proofing config is updated, this is needed for determining whether or not to generate a new proofing transform.
 
void setRenderingLimit (const QRect &rc)
 
void setWrapAroundViewingMode (bool value)
 
void setWrapAroundViewingModeAxis (WrapAroundAxis value)
 
KoShapeManager * shapeManager () const override
 
bool snapToGrid () const override
 
KoToolProxy * toolProxy () const override
 
KoUnit unit () const override
 
void updateCanvas (const QRectF &rc) override
 
void updateProofingState ()
 
const KoViewConverter * viewConverter () const override
 
KoViewConverter * viewConverter () override
 
KisViewManager * viewManager () const
 
bool wrapAroundViewingMode () const
 
WrapAroundAxis wrapAroundViewingModeAxis () const
 
 ~KisCanvas2 () override
 
 ~KisCanvas2Private ()
 
- Public Member Functions inherited from KoCanvasBase
KoCanvasController * canvasController () const
 
virtual void clipToDocument (const KoShape *shape, QPointF &move) const
 
 KoCanvasBase (KoShapeControllerBase *shapeController, KoCanvasResourceProvider *sharedResourceManager=0)
 
 Private ()
 
KoCanvasResourceProvider * resourceManager () const
 
void setCanvasController (KoCanvasController *controller)
 called by KoCanvasController to set the controller that handles this canvas.
 
KoShapeController * shapeController () const
 
KoSnapGuide * snapGuide () const
 
virtual QPointF viewToDocument (const QPointF &viewPoint) const
 
 ~KoCanvasBase () override
 
 ~Private ()
 

Public Attributes

QScopedPointer< KisCanvasAnimationState > animationPlayer
 
bool bootstrapLodBlocked = false
 
KisSignalCompressor canvasUpdateCompressor
 
KisAbstractCanvasWidget * canvasWidget = 0
 
QBitArray channelFlags
 
KisCoordinatesConverter * coordinatesConverter = 0
 
bool currentCanvasIsOpenGL = true
 
QPointer< KoShapeManager > currentlyActiveShapeManager
 
KisDisplayColorConverter displayColorConverter
 
KisAnimationFrameCacheSP frameCache
 
KisSignalCompressor frameRenderStartCompressor
 
std::optional< ShapeLifetimeWrapper > groupModeShapeWrapper
 
KisInputActionGroupsMask inputActionGroupsMask = AllActionGroup
 
QSharedPointer< CanvasInputActionGroupsMaskInterface > inputActionGroupsMaskInterface
 
int isBatchUpdateActive = 0
 
bool lodPreferredInImage = false
 
KisMultiSurfaceStateManager multiSurfaceSetupManager
 
std::optional< KisMultiSurfaceStateManager::State > multiSurfaceState
 
int openGLFilterMode = 0
 
KisPopupPalette * popupPalette = 0
 
KisPrescaledProjectionSP prescaledProjection
 
KisCanvasUpdatesCompressor projectionUpdatesCompressor
 
KisProofingConfigurationSP proofingConfig
 
bool proofingConfigUpdated = false
 
KisCanvas2 * q = 0
 
KisSignalCompressor referencesBoundsUpdateCompressor
 
QRect regionOfInterest
 
qreal regionOfInterestMargin = 0.25
 
KisSignalCompressor regionOfInterestUpdateCompressor
 
QRect renderingLimit
 
QRect savedCanvasProjectionUpdateRect
 
QRect savedOverlayUpdateRect
 
KisSelectedShapesProxy selectedShapesProxy
 
KoShapeManager shapeManager
 
KisToolProxy toolProxy
 
bool updateSceneRequested = false
 
QPointer< KisView > view
 
- Public Attributes inherited from KoCanvasBase
KoCanvasController * controller
 
bool isResourceManagerShared
 
QPointer< KoCanvasResourceProvider > resourceManager
 
QPointer< KoShapeController > shapeController
 
KoSnapGuide * snapGuide
 

Private Slots

void bootstrapFinished ()
 
void slotBeginUpdatesBatch ()
 
void slotCanvasStateChanged ()
 
void slotDoCanvasUpdate ()
 
void slotEffectiveZoomChanged (qreal newZoom)
 
void slotEndUpdatesBatch ()
 
void slotImageColorSpaceChanged ()
 
void slotSelectionChanged ()
 
void slotSetLodUpdatesBlocked (bool value)
 
void slotUpdateReferencesBounds ()
 
void slotUpdateRegionOfInterest ()
 
void startUpdateCanvasProjection (const QRect &rc)
 
void updateCanvasProjection ()
 

Private Member Functions

void connectCurrentCanvas ()
 
void createCanvas (bool useOpenGL)
 
void createOpenGLCanvas ()
 
void createQPainterCanvas ()
 
void initializeFpsDecoration ()
 
void notifyLevelOfDetailChange ()
 
void requestCanvasUpdateMaybeCompressed ()
 
void resetCanvas (bool useOpenGL)
 
void setCanvasWidget (KisAbstractCanvasWidget *widget)
 
void setup ()
 
void slotSurfaceFormatChanged (const KisDisplayConfig &config)
 
void updateCanvasWidgetImpl (const QRect &rc=QRect())
 

Private Attributes

KisCanvas2Private *const m_d
 

Friends

class KisView
 

Detailed Description

KisCanvas2 is not an actual widget class, but rather an adapter for the widget it contains, which may be either a QPainter based canvas, or an OpenGL based canvas: that are the real widgets.

Definition at line 144 of file kis_canvas2.cpp.

Constructor & Destructor Documentation

◆ ~KisCanvas2Private()

KisCanvas2::~KisCanvas2Private ( )
inline

Definition at line 204 of file kis_canvas2.cpp.

205 {
206 inputActionGroupsMaskInterface->m_canvasPrivateRef = nullptr;
207
208 // We need to make sure that the QScopedPointer gets freed within the scope
209 // of KisCanvas2Private's lifespan. For some reason, this isn't guaranteed
210 // and was causing a crash when closing a file when playback is happening
211 // and there are multiple images. See Bug: 499658
212 animationPlayer.reset();
213 }
QScopedPointer< KisCanvasAnimationState > animationPlayer
QSharedPointer< CanvasInputActionGroupsMaskInterface > inputActionGroupsMaskInterface

◆ KisCanvas2()

KisCanvas2::KisCanvas2 ( KisCoordinatesConverter * coordConverter,
KoCanvasResourceProvider * resourceManager,
KisMainWindow * mainWindow,
KisView * view,
KoShapeControllerBase * sc )

Create a new canvas. The canvas manages a widget that will do the actual painting: the canvas itself is not a widget.

Parameters
viewConverterthe viewconverter for converting between window and document coordinates.

While loading LoD should be blocked. Only when GUI has finished loading and zoom level settled down, LoD is given a green light.

Definition at line 327 of file kis_canvas2.cpp.

329 , m_d(new KisCanvas2Private(this, coordConverter, view, resourceManager))
330{
336 m_d->bootstrapLodBlocked = true;
337 connect(mainWindow, SIGNAL(guiLoadingFinished()), SLOT(bootstrapFinished()));
338
339 KisImageConfig config(false);
340
341#if !KRITA_QT_HAS_UPDATE_COMPRESSION_PATCH
342 m_d->canvasUpdateCompressor.setDelay(1000 / config.fpsLimit());
343 m_d->canvasUpdateCompressor.setMode(KisSignalCompressor::FIRST_ACTIVE);
344#endif
345
346 m_d->frameRenderStartCompressor.setDelay(1000 / config.fpsLimit());
347 m_d->frameRenderStartCompressor.setMode(KisSignalCompressor::FIRST_ACTIVE);
349}
KisCanvas2Private *const m_d
QPointer< KisView > view
void bootstrapFinished()
KisCanvas2Private(KisCanvas2 *parent, KisCoordinatesConverter *coordConverter, QPointer< KisView > view, KoCanvasResourceProvider *resourceManager)
KoSnapGuide * snapGuide
QPointer< KoCanvasResourceProvider > resourceManager
void overrideSnapStrategy(Strategy type, KoSnapStrategy *strategy)

References bootstrapFinished(), KisSignalCompressor::FIRST_ACTIVE, KisImageConfig::fpsLimit(), m_d, KoSnapGuide::overrideSnapStrategy(), KoSnapGuide::PixelSnapping, and KoCanvasBase::snapGuide.

◆ ~KisCanvas2()

KisCanvas2::~KisCanvas2 ( )
override

Definition at line 431 of file kis_canvas2.cpp.

432{
433 delete m_d;
434}

References m_d.

Member Function Documentation

◆ addCommand()

void KisCanvas2::addCommand ( KUndo2Command * command)
overridevirtual

Adds a command to the history. Call this for each command you create. This will also execute the command. This means, most of the application's code will look like MyCommand * cmd = new MyCommand( parameters ); canvas.addCommand( cmd );

Note that the command history takes ownership of the command, it will delete it when the undo limit is reached, or when deleting the command history itself.

Parameters
commandthe command to add

Implements KoCanvasBase.

Definition at line 577 of file kis_canvas2.cpp.

578{
579 // This method exists to support flake-related operations
580 m_d->view->image()->undoAdapter()->addCommand(command);
581}

References m_d.

◆ addDecoration()

void KisCanvas2::addDecoration ( KisCanvasDecorationSP deco)
Returns
true if the canvas image should be displayed in vertically mirrored mode

Definition at line 1560 of file kis_canvas2.cpp.

1561{
1562 m_d->canvasWidget->addDecoration(deco);
1563}

References m_d.

◆ animationState()

KisCanvasAnimationState * KisCanvas2::animationState ( ) const

Definition at line 1610 of file kis_canvas2.cpp.

1611{
1612 return m_d->animationPlayer.data();
1613}

References m_d.

◆ assignChangedMultiSurfaceState()

void KisCanvas2::assignChangedMultiSurfaceState ( const KisMultiSurfaceStateManager::State & newState)

◆ assignChangedMultiSurfaceStateSkipCanvasSurface()

void KisCanvas2::assignChangedMultiSurfaceStateSkipCanvasSurface ( const KisMultiSurfaceStateManager::State & newState)

◆ bootstrapFinished

void KisCanvas2::bootstrapFinished ( )
privateslot

Definition at line 1655 of file kis_canvas2.cpp.

1656{
1657 if (!m_d->bootstrapLodBlocked) return;
1658
1659 m_d->bootstrapLodBlocked = false;
1660 setLodPreferredInCanvas(m_d->lodPreferredInImage);
1661
1662 // Initialization of audio tracks is deferred until after canvas has been completely constructed.
1663 m_d->animationPlayer->setupAudioTracks();
1664}
void setLodPreferredInCanvas(bool value)

References m_d, and setLodPreferredInCanvas().

◆ canvasIsOpenGL()

bool KisCanvas2::canvasIsOpenGL ( ) const
overridevirtual
Returns
true if opengl can be used directly on the canvas

Reimplemented from KoCanvasBase.

Definition at line 517 of file kis_canvas2.cpp.

518{
519 return m_d->currentCanvasIsOpenGL;
520}

References m_d.

◆ canvasWidget() [1/2]

const QWidget * KisCanvas2::canvasWidget ( ) const
overridevirtual

Return the widget that will be added to the scrollArea.

Implements KoCanvasBase.

◆ canvasWidget() [2/2]

QWidget * KisCanvas2::canvasWidget ( )
overridevirtual

Return the widget that will be added to the scrollArea.

Implements KoCanvasBase.

◆ channelSelectionChanged

void KisCanvas2::channelSelectionChanged ( )
slot

Definition at line 564 of file kis_canvas2.cpp.

565{
566 KisImageSP image = this->image();
567 m_d->channelFlags = image->rootLayer()->channelFlags();
568
569 m_d->view->viewManager()->blockUntilOperationsFinishedForced(image);
570
572 m_d->canvasWidget->channelSelectionChanged(m_d->channelFlags);
574 image->unlock();
575}
void startUpdateInPatches(const QRect &imageRect)
KisImageWSP image() const
KisGroupLayerSP rootLayer() const
void unlock()
Definition kis_image.cc:831
void barrierLock(bool readOnly=false)
Wait until all the queued background jobs are completed and lock the image.
Definition kis_image.cc:782
QRect bounds() const override
QBitArray channelFlags
Definition kis_layer.cc:167

References KisImage::barrierLock(), KisImage::bounds(), KisLayer::channelFlags, image(), m_d, KisImage::rootLayer(), startUpdateInPatches(), and KisImage::unlock().

◆ colorManagementReport()

QString KisCanvas2::colorManagementReport ( ) const

Return user-facing information about color management status of the main window surface. The information is intentionally left untranslated, since it is supposed to be used for bugreports.

Definition at line 1703 of file kis_canvas2.cpp.

1704{
1705#if KRITA_USE_SURFACE_COLOR_MANAGEMENT_API
1706 QString report;
1707 QDebug str(&report);
1708
1709 if (m_d->canvasWidget) {
1710 str << "(canvas bit depth report)" << Qt::endl;
1711 str << Qt::endl;
1712 str.noquote().nospace() << m_d->canvasWidget->currentBitDepthUserReport();
1713 }
1714
1715 str << Qt::endl;
1716
1717 if (m_d->surfaceColorManager) {
1718 str.noquote().nospace() << QString("(canvas surface color manager)\n");
1719 str.noquote().nospace() << QString("\n");
1720 str.noquote().nospace() << m_d->surfaceColorManager->colorManagementReport();
1721 } else {
1722 str.noquote().nospace() << QString("Surface color management is not supported on this platform\n");
1723 }
1724
1725 return report;
1726#else
1727 return "Surface color management is disabled\n";
1728#endif
1729}

References m_d.

◆ connectCurrentCanvas()

void KisCanvas2::connectCurrentCanvas ( )
private

Definition at line 850 of file kis_canvas2.cpp.

851{
852 KisImageWSP image = m_d->view->image();
853
854 if (!m_d->currentCanvasIsOpenGL) {
855 Q_ASSERT(m_d->prescaledProjection);
856 m_d->prescaledProjection->setImage(image);
857 }
858
860 setLodPreferredInCanvas(m_d->lodPreferredInImage);
861
862 Q_EMIT sigCanvasEngineChanged();
863}
void startResizingImage()
void sigCanvasEngineChanged()

References image(), m_d, setLodPreferredInCanvas(), sigCanvasEngineChanged(), and startResizingImage().

◆ coordinatesConverter()

const KisCoordinatesConverter * KisCanvas2::coordinatesConverter ( ) const

◆ createCanvas()

void KisCanvas2::createCanvas ( bool useOpenGL)
private

Definition at line 777 of file kis_canvas2.cpp.

778{
779 // deinitialize previous canvas structures
780 m_d->prescaledProjection = 0;
781 m_d->frameCache = 0;
782
783 KisConfig cfg(true);
784
785 if (useOpenGL && !KisOpenGL::hasOpenGL()) {
786 warnKrita << "Tried to create OpenGL widget when system doesn't have OpenGL\n";
787 useOpenGL = false;
788 }
789
790 if (useOpenGL) {
792 if (cfg.canvasState() == "OPENGL_FAILED") {
793 // Creating the opengl canvas failed, fall back
794 warnKrita << "OpenGL Canvas initialization returned OPENGL_FAILED. Falling back to QPainter.";
796 }
797 } else {
799 }
800
801 KIS_SAFE_ASSERT_RECOVER_RETURN(m_d->multiSurfaceState);
802 m_d->displayColorConverter.setMultiSurfaceDisplayConfig(m_d->multiSurfaceState->multiConfig);
803
804 if (m_d->popupPalette) {
805 m_d->popupPalette->setParent(m_d->canvasWidget->widget());
806 }
807
808}
void createQPainterCanvas()
void createOpenGLCanvas()
static bool hasOpenGL()
Check for OpenGL.
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
Definition kis_assert.h:128
#define warnKrita
Definition kis_debug.h:94

References KisConfig::canvasState(), createOpenGLCanvas(), createQPainterCanvas(), KisOpenGL::hasOpenGL(), KIS_SAFE_ASSERT_RECOVER_RETURN, m_d, and warnKrita.

◆ createOpenGLCanvas()

void KisCanvas2::createOpenGLCanvas ( )
private

Definition at line 750 of file kis_canvas2.cpp.

751{
752 KisConfig cfg(true);
753 m_d->openGLFilterMode = cfg.openGLFilteringMode();
754 m_d->currentCanvasIsOpenGL = true;
755
756 m_d->multiSurfaceState =
757 m_d->multiSurfaceSetupManager.createInitializingConfig(true, m_d->currentScreenId(), m_d->proofingConfig);
758
759 auto bitDepthMode =
760 cfg.effectiveCanvasSurfaceBitDepthMode(QSurfaceFormat::defaultFormat())
764
766 m_d->coordinatesConverter,
767 0,
768 m_d->view->image(),
769 m_d->multiSurfaceState->multiConfig.canvasDisplayConfig(),
770 m_d->displayColorConverter.displayFilter(),
771 bitDepthMode);
772 m_d->frameCache = KisAnimationFrameCache::getFrameCache(canvasWidget->openGLImageTextures());
773
775}
static KisAnimationFrameCacheSP getFrameCache(KisOpenGLImageTexturesSP textures)
KisAbstractCanvasWidget * canvasWidget
void setCanvasWidget(KisAbstractCanvasWidget *widget)

References canvasWidget, KisAbstractCanvasWidget::Depth10Bit, KisConfig::Depth10Bit, KisAbstractCanvasWidget::Depth8Bit, KisConfig::effectiveCanvasSurfaceBitDepthMode(), KisAnimationFrameCache::getFrameCache(), m_d, KisConfig::openGLFilteringMode(), and setCanvasWidget().

◆ createQPainterCanvas()

void KisCanvas2::createQPainterCanvas ( )
private

Definition at line 734 of file kis_canvas2.cpp.

735{
736 m_d->currentCanvasIsOpenGL = false;
737
738 m_d->multiSurfaceState =
739 m_d->multiSurfaceSetupManager.createInitializingConfig(false, m_d->currentScreenId(), m_d->proofingConfig);
740
741 KisQPainterCanvas * canvasWidget = new KisQPainterCanvas(this, m_d->coordinatesConverter, m_d->view);
742 m_d->prescaledProjection = new KisPrescaledProjection();
743 m_d->prescaledProjection->setCoordinatesConverter(m_d->coordinatesConverter);
744 m_d->prescaledProjection->setDisplayConfig(m_d->multiSurfaceState->multiConfig.canvasDisplayConfig());
745 m_d->prescaledProjection->setDisplayFilter(m_d->displayColorConverter.displayFilter());
746 canvasWidget->setPrescaledProjection(m_d->prescaledProjection);
748}

References canvasWidget, m_d, and setCanvasWidget().

◆ currentImage()

KisImageWSP KisCanvas2::currentImage ( ) const

Definition at line 1429 of file kis_canvas2.cpp.

1430{
1431 return m_d->view->image();
1432}

References m_d.

◆ currentScreenId()

int KisCanvas2::currentScreenId ( ) const
inline

Definition at line 286 of file kis_canvas2.cpp.

286 {
287 int canvasScreenNumber = qApp->screens().indexOf(view->currentScreen());
288
289 if (canvasScreenNumber < 0) {
290 warnKrita << "Couldn't detect screen that Krita belongs to..." << ppVar(view->currentScreen());
291 canvasScreenNumber = 0;
292 }
293 return canvasScreenNumber;
294 }
#define ppVar(var)
Definition kis_debug.h:163

References ppVar, and warnKrita.

◆ currentShapeManagerOwnerShape()

KoShape * KisCanvas2::currentShapeManagerOwnerShape ( ) const
overridevirtual

the shape that owns the currently active shape manager

When the editor enters some kind of "group editing mode", the user see only shapes belonging to this particular group. In other words, the shapeManager() of this canvas will contain only shapes of this "entered" group.

currentShapeManagerOwnerShape() returns the shape that represents this currently entered group, so that the tools could detect it better

If no group is currently entered, then the function returns nullptr.

NOTE: the functionality is currently implemented for text shapes only, not for actual groups :)

Reimplemented from KoCanvasBase.

Definition at line 613 of file kis_canvas2.cpp.

614{
615 return m_d->groupModeShapeWrapper ? m_d->groupModeShapeWrapper->shape() : nullptr;
616}

References m_d.

◆ decoration()

KisCanvasDecorationSP KisCanvas2::decoration ( const QString & id) const

Definition at line 1565 of file kis_canvas2.cpp.

1566{
1567 return m_d->canvasWidget->decoration(id);
1568}

References m_d.

◆ disconnectCanvasObserver()

void KisCanvas2::disconnectCanvasObserver ( QObject * object)
overridevirtual

disconnect the given QObject completely and utterly from any and all connections it has to any QObject owned by the canvas. Do this in the setCanvas of every KoCanvasObserver.

Reimplemented from KoCanvasBase.

Definition at line 1321 of file kis_canvas2.cpp.

1322{
1324 m_d->view->disconnect(object);
1325}
virtual void disconnectCanvasObserver(QObject *object)

References KoCanvasBase::disconnectCanvasObserver(), and m_d.

◆ disconnectImage()

void KisCanvas2::disconnectImage ( )

We explicitly don't use barrierLock() here, because we don't care about all the updates completed (we don't use image's content). We only need to guarantee that the image will not try to access us in a multithreaded way, while we are being destroyed.

Definition at line 834 of file kis_canvas2.cpp.

835{
836 KisImageSP image = m_d->view->image();
837
846 disconnect(image.data(), 0, this, 0);
847 image->unlock();
848}
void immediateLockForReadOnly()
Definition kis_image.cc:819

References KisWeakSharedPtr< T >::data(), image(), KisImage::immediateLockForReadOnly(), m_d, and KisImage::unlock().

◆ displayColorConverter()

KisDisplayColorConverter * KisCanvas2::displayColorConverter ( ) const

◆ displayFilter()

QSharedPointer< KisDisplayFilter > KisCanvas2::displayFilter ( ) const

Definition at line 928 of file kis_canvas2.cpp.

929{
930 return m_d->displayColorConverter.displayFilter();
931}

References m_d.

◆ displayRendererInterface()

KoColorDisplayRendererInterface * KisCanvas2::displayRendererInterface ( ) const
overridevirtual

displayRendererInterface The display renderer interface has a number of color conversion functions which are useful to convert a KoColor to a QColor.

Returns
The display renderer interface for this canvas.

Reimplemented from KoCanvasBase.

Definition at line 689 of file kis_canvas2.cpp.

690{
691 return m_d->displayColorConverter.displayRendererInterface();
692}

References m_d.

◆ documentOffset()

QPoint KisCanvas2::documentOffset ( ) const

Definition at line 1582 of file kis_canvas2.cpp.

1583{
1584 return m_d->coordinatesConverter->documentOffset();
1585}

References m_d.

◆ documentOrigin()

QPoint KisCanvas2::documentOrigin ( ) const
overridevirtual

Return the position of the document origin inside the canvas widget, in pixels. By default the origin of the canvas widget and the position of the document origin are coincident, thus an empty point is returned.

In Krita we don't use document origin anymore. All the centering when needed (vastScrolling < 0.5) is done automatically by the KisCoordinatesConverter.

Reimplemented from KoCanvasBase.

Definition at line 1571 of file kis_canvas2.cpp.

1572{
1579 return QPoint();
1580}

◆ docUpdateRectToWidget()

QRect KisCanvas2::docUpdateRectToWidget ( const QRectF & docRect)

◆ effectiveLodAllowedInImage()

bool KisCanvas2::effectiveLodAllowedInImage ( ) const
inline

Definition at line 271 of file kis_canvas2.cpp.

271 {
273 }
bool bootstrapLodBlocked
bool lodPreferredInImage

◆ exposureGammaCorrectionInterface()

KisExposureGammaCorrectionInterface * KisCanvas2::exposureGammaCorrectionInterface ( ) const

Definition at line 958 of file kis_canvas2.cpp.

959{
960 QSharedPointer<KisDisplayFilter> displayFilter = m_d->displayColorConverter.displayFilter();
961
962 return displayFilter ?
963 displayFilter->correctionInterface() :
965}
QSharedPointer< KisDisplayFilter > displayFilter() const
static KisDumbExposureGammaCorrectionInterface * instance()

References displayFilter(), KisDumbExposureGammaCorrectionInterface::instance(), and m_d.

◆ fetchProofingOptions()

void KisCanvas2::fetchProofingOptions ( )

fetchProofingOptions Get the options for softproofing, and apply the view-specific state without affecting the proofing options as stored inside the image.

Definition at line 967 of file kis_canvas2.cpp.

968{
970 if (!baseConfig) {
971 baseConfig = KisImageConfig(true).defaultProofingconfiguration();
972 }
973 *m_d->proofingConfig = *baseConfig;
974
976}
void updateProofingState()
KisProofingConfigurationSP defaultProofingconfiguration(bool requestDefault=false)
KisProofingConfigurationSP proofingConfiguration() const
proofingConfiguration

References KisImageConfig::defaultProofingconfiguration(), image(), m_d, KisImage::proofingConfiguration(), and updateProofingState().

◆ finishResizingImage

void KisCanvas2::finishResizingImage ( qint32 w,
qint32 h )
slot

Definition at line 1053 of file kis_canvas2.cpp.

1054{
1055 m_d->canvasWidget->finishResizingImage(w, h);
1056}

References m_d.

◆ frameCache()

KisAnimationFrameCacheSP KisCanvas2::frameCache ( ) const

◆ globalInputManager()

KisInputManager * KisCanvas2::globalInputManager ( ) const

Filters events and sends them to canvas actions. Shared among all the views/canvases

NOTE: May be null while initialization!

Definition at line 694 of file kis_canvas2.cpp.

695{
696 return m_d->view->globalInputManager();
697}

References m_d.

◆ globalShapeManager()

KoShapeManager * KisCanvas2::globalShapeManager ( ) const

Return the shape manager associated with this canvas

Definition at line 608 of file kis_canvas2.cpp.

609{
610 return &m_d->shapeManager;
611}

References m_d.

◆ gridSize()

void KisCanvas2::gridSize ( QPointF * offset,
QSizeF * spacing ) const
overridevirtual

retrieve the grid size setting. The grid spacing will be provided in pt.

Parameters
horizontala pointer to a qreal that will be filled with the horizontal grid-spacing
verticala pointer to a qreal that will be filled with the vertical grid-spacing

Implements KoCanvasBase.

Definition at line 527 of file kis_canvas2.cpp.

528{
529 QTransform transform = coordinatesConverter()->imageToDocumentTransform();
530
531 const QPoint intSpacing = m_d->view->document()->gridConfig().spacing();
532 QPoint intOffset;
533 if (m_d->view->document()->gridConfig().offsetActive()) {
534 intOffset = m_d->view->document()->gridConfig().offset();
535 }
536
537 QPointF size = transform.map(QPointF(intSpacing));
538 spacing->rwidth() = size.x();
539 spacing->rheight() = size.y();
540
541 *offset = transform.map(QPointF(intOffset));
542}
KisCoordinatesConverter * coordinatesConverter
int size(const Forest< T > &forest)
Definition KisForest.h:1232

References coordinatesConverter, KisCoordinatesConverter::imageToDocumentTransform(), and m_d.

◆ image()

KisImageWSP KisCanvas2::image ( ) const

Definition at line 1423 of file kis_canvas2.cpp.

1424{
1425 return m_d->view->image();
1426
1427}

References m_d.

◆ imageView()

QPointer< KisView > KisCanvas2::imageView ( ) const

Definition at line 1418 of file kis_canvas2.cpp.

1419{
1420 return m_d->view;
1421}

References m_d.

◆ initializeFpsDecoration()

void KisCanvas2::initializeFpsDecoration ( )
private

Definition at line 411 of file kis_canvas2.cpp.

412{
413 KisConfig cfg(true);
414
415 const bool shouldShowDebugOverlay =
416 (canvasIsOpenGL() && cfg.enableOpenGLFramerateLogging()) ||
417 cfg.enableBrushSpeedLogging();
418
419 if (shouldShowDebugOverlay && !decoration(KisFpsDecoration::idTag)) {
421
422 if (cfg.enableBrushSpeedLogging()) {
423 connect(KisStrokeSpeedMonitor::instance(), SIGNAL(sigStatsUpdated()), this, SLOT(updateCanvas()));
424 }
425 } else if (!shouldShowDebugOverlay && decoration(KisFpsDecoration::idTag)) {
426 m_d->canvasWidget->removeDecoration(KisFpsDecoration::idTag);
427 disconnect(KisStrokeSpeedMonitor::instance(), SIGNAL(sigStatsUpdated()), this, SLOT(updateCanvas()));
428 }
429}
void addDecoration(KisCanvasDecorationSP deco)
bool canvasIsOpenGL() const override
QPointer< KisView > imageView() const
KisCanvasDecorationSP decoration(const QString &id) const
void updateCanvas()
Update the entire canvas area.
static const QString idTag
static KisStrokeSpeedMonitor * instance()

References addDecoration(), canvasIsOpenGL(), decoration(), KisConfig::enableBrushSpeedLogging(), KisConfig::enableOpenGLFramerateLogging(), KisFpsDecoration::idTag, imageView(), KisStrokeSpeedMonitor::instance(), m_d, and updateCanvas().

◆ initializeImage()

void KisCanvas2::initializeImage ( )

Definition at line 810 of file kis_canvas2.cpp.

811{
812 KisImageSP image = m_d->view->image();
813
814 m_d->displayColorConverter.setImageColorSpace(image->colorSpace());
815 m_d->coordinatesConverter->setImage(image);
816 m_d->toolProxy.initializeImage(image);
817
818 connect(image, SIGNAL(sigImageUpdated(QRect)), SLOT(startUpdateCanvasProjection(QRect)), Qt::DirectConnection);
819 connect(image->signalRouter(), SIGNAL(sigNotifyBatchUpdateStarted()), SLOT(slotBeginUpdatesBatch()), Qt::DirectConnection);
820 connect(image->signalRouter(), SIGNAL(sigNotifyBatchUpdateEnded()), SLOT(slotEndUpdatesBatch()), Qt::DirectConnection);
821 connect(image->signalRouter(), SIGNAL(sigRequestLodPlanesSyncBlocked(bool)), SLOT(slotSetLodUpdatesBlocked(bool)), Qt::DirectConnection);
822
823 connect(image, SIGNAL(sigProofingConfigChanged()), SLOT(slotChangeProofingConfig()));
824 connect(image, SIGNAL(sigSizeChanged(QPointF,QPointF)), SLOT(startResizingImage()), Qt::DirectConnection);
825 connect(image->undoAdapter(), SIGNAL(selectionChanged()), SLOT(slotTrySwitchShapeManager()));
826
827 connect(image, SIGNAL(sigColorSpaceChanged(const KoColorSpace*)), SLOT(slotImageColorSpaceChanged()));
828 connect(image, SIGNAL(sigProfileChanged(const KoColorProfile*)), SLOT(slotImageColorSpaceChanged()));
829
832}
void slotBeginUpdatesBatch()
void fetchProofingOptions()
fetchProofingOptions Get the options for softproofing, and apply the view-specific state without affe...
void slotEndUpdatesBatch()
void slotSetLodUpdatesBlocked(bool value)
void startUpdateCanvasProjection(const QRect &rc)
void slotImageColorSpaceChanged()
void slotChangeProofingConfig()
void connectCurrentCanvas()
void slotTrySwitchShapeManager()
KisUndoAdapter * undoAdapter() const
const KoColorSpace * colorSpace() const
KisImageSignalRouter * signalRouter()

References KisImage::colorSpace(), connectCurrentCanvas(), fetchProofingOptions(), image(), m_d, KisImage::signalRouter(), slotBeginUpdatesBatch(), slotChangeProofingConfig(), slotEndUpdatesBatch(), slotImageColorSpaceChanged(), slotSetLodUpdatesBlocked(), slotTrySwitchShapeManager(), startResizingImage(), startUpdateCanvasProjection(), and KisImage::undoAdapter().

◆ inputActionGroupsMaskInterface()

KisInputActionGroupsMaskInterface::SharedInterface KisCanvas2::inputActionGroupsMaskInterface ( )
Returns
a reference to alter this canvas' input action groups mask

◆ KisCanvas2Private()

KisCanvas2::KisCanvas2Private ( KisCanvas2 * parent,
KisCoordinatesConverter * coordConverter,
QPointer< KisView > view,
KoCanvasResourceProvider * resourceManager )
inline

Definition at line 171 of file kis_canvas2.cpp.

175 : q(parent)
176 , coordinatesConverter(coordConverter)
177 , view(view)
178 , shapeManager(parent)
180 , toolProxy(parent)
183 , inputActionGroupsMaskInterface(new CanvasInputActionGroupsMaskInterface(this))
186 {
187#if KRITA_USE_SURFACE_COLOR_MANAGEMENT_API
188 if (KisPlatformPluginInterfaceFactory::instance()->surfaceColorManagedByOS()) {
189 rootSurfaceInfoProxy = new KisRootSurfaceInfoProxy(view, q);
190 multiSurfaceSetupManager.setRootSurfaceInfoProxy(rootSurfaceInfoProxy);
191 connect(rootSurfaceInfoProxy,
193 parent,
194 [this](const KoColorProfile *profile) {
196 return;
199 });
200 }
201#endif
202 }
KisSelectedShapesProxy selectedShapesProxy
KisDisplayColorConverter displayColorConverter
std::optional< KisMultiSurfaceStateManager::State > multiSurfaceState
KisProofingConfigurationSP proofingConfig
KoShapeManager shapeManager
void assignChangedMultiSurfaceState(const KisMultiSurfaceStateManager::State &newState)
KisToolProxy toolProxy
KisSignalCompressor referencesBoundsUpdateCompressor
KisMultiSurfaceStateManager multiSurfaceSetupManager
KisSignalCompressor regionOfInterestUpdateCompressor
KisCanvas2 * q
State onGuiSurfaceFormatChanged(const State &oldState, const KoColorProfile *uiProfile) const
static KisPlatformPluginInterfaceFactory * instance()
The KisProofingConfiguration struct Little struct that stores the proofing configuration for a given ...
void sigRootSurfaceProfileChanged(const KoColorProfile *profile) const

References KisPlatformPluginInterfaceFactory::instance(), and KisRootSurfaceInfoProxy::sigRootSurfaceProfileChanged().

◆ localShapeManager()

KoShapeManager * KisCanvas2::localShapeManager ( ) const

Return shape manager associated with the currently active node. If current node has no internal shape manager, return null.

The group shape should be manually reset by the external code when the active layer is switched.

Definition at line 637 of file kis_canvas2.cpp.

638{
639 KisNodeSP node = m_d->view->currentNode();
640 KoShapeManager *localShapeManager = fetchShapeManagerFromNode(node);
641
647 !m_d->groupModeShapeWrapper ||
649 localShapeManager->shapes().contains(m_d->groupModeShapeWrapper->shape())) {
650
651 m_d->groupModeShapeWrapper = std::nullopt;
652 }
653
654 if (m_d->groupModeShapeWrapper) {
655 auto textShape = dynamic_cast<KoSvgTextShape*>(m_d->groupModeShapeWrapper->shape());
656
657 // we currently support entering text shapes only
658 KIS_SAFE_ASSERT_RECOVER(textShape) {
659 m_d->groupModeShapeWrapper = std::nullopt;
660 }
661
662 if (textShape) {
663 localShapeManager = textShape->internalShapeManager();
664 }
665 }
666
667 if (localShapeManager != m_d->currentlyActiveShapeManager) {
668 m_d->setActiveShapeManager(localShapeManager);
669 }
670
671 return localShapeManager;
672}
KoShapeManager * localShapeManager() const
QList< KoShape * > shapes
#define KIS_SAFE_ASSERT_RECOVER(cond)
Definition kis_assert.h:126

References KIS_SAFE_ASSERT_RECOVER, localShapeManager(), m_d, and KoShapeManager::shapes.

◆ lodIsSupported()

bool KisCanvas2::lodIsSupported ( ) const
inline

◆ lodPreferredInCanvas()

bool KisCanvas2::lodPreferredInCanvas ( ) const

Definition at line 1681 of file kis_canvas2.cpp.

1682{
1683 return m_d->lodPreferredInImage;
1684}

References m_d.

◆ notifyLevelOfDetailChange()

void KisCanvas2::notifyLevelOfDetailChange ( )
private

Definition at line 1389 of file kis_canvas2.cpp.

1390{
1391 KisImageSP image = this->image();
1392
1393 if (m_d->bootstrapLodBlocked || !m_d->lodIsSupported()) {
1395 } else {
1396 const qreal effectiveZoom = m_d->coordinatesConverter->effectiveZoom();
1397
1398 KisConfig cfg(true);
1399 const int maxLod = cfg.numMipmapLevels();
1400 const int lod = KisLodTransform::scaleToLod(effectiveZoom, maxLod);
1401 KisLodPreferences::PreferenceFlags flags = KisLodPreferences::LodSupported;
1402
1403 if (m_d->lodPreferredInImage) {
1405 }
1407 }
1408}
void setLodPreferences(const KisLodPreferences &value)
static int scaleToLod(qreal scale, int maxLod)

References image(), KisLodPreferences::LodPreferred, KisLodPreferences::LodSupported, m_d, KisLodPreferences::None, KisConfig::numMipmapLevels(), KisLodTransformBase::scaleToLod(), and KisImage::setLodPreferences().

◆ openGLFilterMode()

KisOpenGL::FilterMode KisCanvas2::openGLFilterMode ( ) const

◆ paintingAssistantsDecoration()

KisPaintingAssistantsDecorationSP KisCanvas2::paintingAssistantsDecoration ( ) const

Definition at line 1686 of file kis_canvas2.cpp.

1687{
1688 KisCanvasDecorationSP deco = decoration("paintingAssistantsDecoration");
1689 return qobject_cast<KisPaintingAssistantsDecoration*>(deco.data());
1690}

References KisSharedPtr< T >::data(), and decoration().

◆ popupPalette()

KisPopupPalette * KisCanvas2::popupPalette ( )

◆ proofingConfigUpdated()

bool KisCanvas2::proofingConfigUpdated ( )

proofingConfigUpdated ask the canvas whether or not it updated the proofing config.

Returns
whether or not the proofing config is updated, if so, a new proofing transform needs to be made in KisOpenGL canvas.

◆ proofingConfiguration()

KisProofingConfigurationSP KisCanvas2::proofingConfiguration ( ) const

Definition at line 1036 of file kis_canvas2.cpp.

1037{
1038 return m_d->proofingConfig;
1039}

References m_d.

◆ referenceImagesDecoration()

KisReferenceImagesDecorationSP KisCanvas2::referenceImagesDecoration ( ) const

Definition at line 1692 of file kis_canvas2.cpp.

1693{
1694 KisCanvasDecorationSP deco = decoration("referenceImagesDecoration");
1695 return qobject_cast<KisReferenceImagesDecoration*>(deco.data());
1696}

References KisSharedPtr< T >::data(), and decoration().

◆ refetchDataFromImage()

void KisCanvas2::refetchDataFromImage ( )

Definition at line 1486 of file kis_canvas2.cpp.

1487{
1488 KisImageSP image = this->image();
1489 KisImageReadOnlyBarrierLock l(image);
1491}

References KisImage::bounds(), image(), and startUpdateInPatches().

◆ regionOfInterest()

QRect KisCanvas2::regionOfInterest ( ) const
Returns
area of the image (in image coordinates) that is visible on the canvas with a small margin selected by the user

◆ renderingLimit()

QRect KisCanvas2::renderingLimit ( ) const
Returns
artificial limit outside which the image will not be rendered

◆ requestCanvasUpdateMaybeCompressed()

void KisCanvas2::requestCanvasUpdateMaybeCompressed ( )
private

If Qt has our custom patch for global updates compression, then we shouldn't do our own compression here in the canvas. Everything will be done in Qt.

Definition at line 1167 of file kis_canvas2.cpp.

1168{
1173#if !KRITA_QT_HAS_UPDATE_COMPRESSION_PATCH
1174 m_d->canvasUpdateCompressor.start();
1175#else
1177#endif
1178}
void slotDoCanvasUpdate()

References m_d, and slotDoCanvasUpdate().

◆ resetCanvas()

void KisCanvas2::resetCanvas ( bool useOpenGL)
private

Definition at line 865 of file kis_canvas2.cpp.

866{
867 // we cannot reset the canvas before it's created, but this method might be called,
868 // for instance when setting the monitor profile.
869 if (!m_d->canvasWidget) {
870 return;
871 }
872
873 KisConfig cfg(true);
874
875 const bool canvasHasNativeSurface = bool(m_d->canvasWidget->widget()->windowHandle());
876 const bool canvasNeedsNativeSurface =
877 cfg.enableCanvasSurfaceColorSpaceManagement() &&
879
880 bool needReset = (m_d->currentCanvasIsOpenGL != useOpenGL) ||
881 (m_d->currentCanvasIsOpenGL &&
882 m_d->openGLFilterMode != cfg.openGLFilteringMode()) ||
883 canvasHasNativeSurface != canvasNeedsNativeSurface;
884
885 if (needReset) {
886 createCanvas(useOpenGL);
888 slotEffectiveZoomChanged(m_d->coordinatesConverter->effectiveZoom());
889 }
891}
void createCanvas(bool useOpenGL)
void updateCanvasWidgetImpl(const QRect &rc=QRect())
void slotEffectiveZoomChanged(qreal newZoom)

References connectCurrentCanvas(), createCanvas(), KisConfig::enableCanvasSurfaceColorSpaceManagement(), KisPlatformPluginInterfaceFactory::instance(), m_d, KisConfig::openGLFilteringMode(), slotEffectiveZoomChanged(), KisPlatformPluginInterfaceFactory::surfaceColorManagedByOS(), and updateCanvasWidgetImpl().

◆ rotationAngle

qreal KisCanvas2::rotationAngle ( ) const
slot

canvas rotation in degrees

Definition at line 549 of file kis_canvas2.cpp.

550{
551 return m_d->coordinatesConverter->rotationAngle();
552}

References m_d.

◆ selectedShapesProxy()

KoSelectedShapesProxy * KisCanvas2::selectedShapesProxy ( ) const
overridevirtual

Since shapeManager() may change, we need a persistent object where we can connect to and thack the selection. See more comments in KoCanvasBase.

Implements KoCanvasBase.

◆ setActiveShapeManager()

void KisCanvas2::setActiveShapeManager ( KoShapeManager * shapeManager)

◆ setCanvasWidget()

void KisCanvas2::setCanvasWidget ( KisAbstractCanvasWidget * widget)
private

We are switching the canvas type. We should reinitialize our connections to decorations and input manager

Definition at line 436 of file kis_canvas2.cpp.

437{
438 if (m_d->popupPalette) {
439 m_d->popupPalette->setParent(widget->widget());
440 }
441
442 if (m_d->canvasWidget) {
448 widget->setDecorations(m_d->canvasWidget->decorations());
449
450 if(viewManager()) {
452 m_d->canvasWidget = widget;
454 } else {
455 m_d->canvasWidget = widget;
456 }
457 } else {
458 m_d->canvasWidget = widget;
459 }
460
461 if (!m_d->canvasWidget->decoration(INFINITY_DECORATION_ID)) {
462 KisInfinityManager *manager = new KisInfinityManager(m_d->view, this);
463 manager->setVisible(true);
464 m_d->canvasWidget->addDecoration(manager);
465 }
466
467 widget->widget()->setAutoFillBackground(false);
468 widget->widget()->setAttribute(Qt::WA_OpaquePaintEvent);
469 widget->widget()->setMouseTracking(true);
470 widget->widget()->setAcceptDrops(true);
471
473 if (controller && controller->canvas() == this) {
474 controller->changeCanvasWidget(widget->widget());
475 }
476
477
478#if KRITA_USE_SURFACE_COLOR_MANAGEMENT_API
484 m_d->surfaceColorManager.reset();
485
486 QWindow *mainWindowNativeWindow = m_d->view->mainWindow()->windowHandle();
487 QWindow *nativeWindow = widget->widget()->windowHandle();
488
489 if (nativeWindow && nativeWindow != mainWindowNativeWindow) {
490 std::unique_ptr<KisSurfaceColorManagerInterface> iface(
491 KisPlatformPluginInterfaceFactory::instance()->createSurfaceColorManager(nativeWindow));
492
493 // if surfaceColorManagedByOS() is true, then interface is guaranteed to
494 // be present
496
497 if (iface) {
498 m_d->surfaceColorManager.reset(
499 new KisCanvasSurfaceColorSpaceManager(iface.release(),
500 m_d->multiSurfaceState->surfaceMode,
501 m_d->multiSurfaceState->multiConfig.options(),
502 this));
503
504 connect(m_d->surfaceColorManager.data(),
506 this,
508 }
509 } else {
510 qWarning() << "WARNING: created non-native Krita canvas on managed platform,"
511 << "its color space will be limited to sRGB";
512 }
513 }
514#endif
515}
virtual void setDecorations(const QList< KisCanvasDecorationSP > &)=0
virtual QWidget * widget()=0
KisViewManager * viewManager() const
void slotSurfaceFormatChanged(const KisDisplayConfig &config)
virtual void setVisible(bool v)
void removeTrackedCanvas(KisCanvas2 *canvas)
void addTrackedCanvas(KisCanvas2 *canvas)
KisInputManager * inputManager() const
Filters events and sends them to canvas actions.
KoCanvasController * controller
KoCanvasController * canvasController() const
virtual KoCanvasBase * canvas() const
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)
Definition kis_assert.h:130
static const QString INFINITY_DECORATION_ID
void sigDisplayConfigChanged(const KisDisplayConfig &config)

References KisInputManager::addTrackedCanvas(), KoCanvasController::canvas(), KoCanvasBase::canvasController(), KoCanvasBase::controller, INFINITY_DECORATION_ID, KisViewManager::inputManager(), KisPlatformPluginInterfaceFactory::instance(), KIS_SAFE_ASSERT_RECOVER_NOOP, m_d, KisInputManager::removeTrackedCanvas(), KisAbstractCanvasWidget::setDecorations(), KisCanvasDecoration::setVisible(), KisCanvasSurfaceColorSpaceManager::sigDisplayConfigChanged(), slotSurfaceFormatChanged(), KisPlatformPluginInterfaceFactory::surfaceColorManagedByOS(), viewManager(), and KisAbstractCanvasWidget::widget().

◆ setCurrentShapeManagerOwnerShape()

void KisCanvas2::setCurrentShapeManagerOwnerShape ( KoShape * source)
overridevirtual

sets the group shape that is supposed to be "entered"

The tool can instruct the canvas to enter the group represented by shape shape. The implementation of the canvas is supposed to switch its shapeManager() to the one owned by shape.

NOTE: we currently have no common interface for fetching the shape manager from a particular shape. The canvas is supposed to know how to dynamic_cast the shape itself.

recalculate the local shape manager and make sure that selected shapes proxy emits all the necessary signals

Reimplemented from KoCanvasBase.

Definition at line 618 of file kis_canvas2.cpp.

619{
620 if (currentShapeManagerOwnerShape() == source) return;
621
622 m_d->groupModeShapeWrapper = std::nullopt;
623
624 // we currently support entering text shapes only
625 if (source && dynamic_cast<KoSvgTextShape*>(source)) {
626 m_d->groupModeShapeWrapper.emplace(source, [this] () {
628 });
629 }
630
635}
KisMagneticGraph::vertex_descriptor source(typename KisMagneticGraph::edge_descriptor e, KisMagneticGraph g)
void setCurrentShapeManagerOwnerShape(KoShape *source) override
sets the group shape that is supposed to be "entered"
KoShape * currentShapeManagerOwnerShape() const override
the shape that owns the currently active shape manager
typedef void(QOPENGLF_APIENTRYP PFNGLINVALIDATEBUFFERDATAPROC)(GLuint buffer)

References currentShapeManagerOwnerShape(), localShapeManager(), m_d, setCurrentShapeManagerOwnerShape(), source(), and void().

◆ setCursor()

void KisCanvas2::setCursor ( const QCursor & cursor)
overridevirtual

set the specified cursor on this canvas

Parameters
cursorthe new cursor
Returns
the old cursor

Implements KoCanvasBase.

Definition at line 1600 of file kis_canvas2.cpp.

1601{
1602 canvasWidget()->setCursor(cursor);
1603}

References canvasWidget.

◆ setDisplayFilter()

void KisCanvas2::setDisplayFilter ( QSharedPointer< KisDisplayFilter > displayFilter)

Definition at line 916 of file kis_canvas2.cpp.

917{
918 m_d->displayColorConverter.setDisplayFilter(displayFilter);
919 KisImageSP image = this->image();
920
921 m_d->view->viewManager()->blockUntilOperationsFinishedForced(image);
922
924 m_d->canvasWidget->setDisplayFilter(displayFilter);
925 image->unlock();
926}

References KisImage::barrierLock(), displayFilter(), image(), m_d, and KisImage::unlock().

◆ setFavoriteResourceManager()

void KisCanvas2::setFavoriteResourceManager ( KisFavoriteResourceManager * favoriteResourceManager)

Definition at line 1587 of file kis_canvas2.cpp.

1588{
1589 m_d->popupPalette = new KisPopupPalette(viewManager(), m_d->coordinatesConverter, favoriteResourceManager, displayColorConverter()->displayRendererInterface(),
1590 m_d->canvasWidget->widget());
1591 connect(m_d->popupPalette, SIGNAL(zoomLevelChanged(int)), this, SLOT(slotPopupPaletteRequestedZoomChange(int)));
1592 connect(m_d->popupPalette, SIGNAL(sigUpdateCanvas()), this, SLOT(updateCanvas()));
1593 connect(m_d->view->mainWindow(), SIGNAL(themeChanged()), m_d->popupPalette, SLOT(slotUpdateIcons()));
1594}
KoColorDisplayRendererInterface * displayRendererInterface() const override
displayRendererInterface The display renderer interface has a number of color conversion functions wh...
void slotPopupPaletteRequestedZoomChange(int zoom)

References displayColorConverter, displayRendererInterface(), m_d, slotPopupPaletteRequestedZoomChange(), updateCanvas(), and viewManager().

◆ setLodPreferredInCanvas()

void KisCanvas2::setLodPreferredInCanvas ( bool value)

Definition at line 1666 of file kis_canvas2.cpp.

1667{
1668 if (!KisOpenGL::supportsLoD()) {
1669 qWarning() << "WARNING: Level of Detail functionality is available only with openGL + GLSL 1.3 support";
1670 }
1671
1672 m_d->lodPreferredInImage =
1673 value && m_d->lodIsSupported();
1674
1676
1677 KisConfig cfg(false);
1678 cfg.setLevelOfDetailEnabled(m_d->lodPreferredInImage);
1679}
float value(const T *src, size_t ch)
void notifyLevelOfDetailChange()

References m_d, notifyLevelOfDetailChange(), KisConfig::setLevelOfDetailEnabled(), KisOpenGL::supportsLoD(), and value().

◆ setProofingConfigUpdated()

void KisCanvas2::setProofingConfigUpdated ( bool updated)

setProofingConfigUpdated This function is to set whether the proofing config is updated, this is needed for determining whether or not to generate a new proofing transform.

Parameters
updatedwhether it's updated. Just set it to false in normal usage.

Definition at line 1026 of file kis_canvas2.cpp.

1027{
1028 m_d->proofingConfigUpdated = updated;
1029}

References m_d.

◆ setRenderingLimit()

void KisCanvas2::setRenderingLimit ( const QRect & rc)

Set artificial limit outside which the image will not be rendered rc is measured in image pixels

Definition at line 1368 of file kis_canvas2.cpp.

1369{
1370 m_d->renderingLimit = rc;
1371}

References m_d.

◆ setup()

void KisCanvas2::setup ( )
private

We switch the shape manager every time vector layer or shape selection is activated. Flake does not expect this and connects all the signals of the global shape manager to the clients in the constructor. To workaround this we forward the signals of local shape managers stored in the vector layers to the signals of global shape manager. So the sequence of signal deliveries is the following:

shapeLayer.m_d.canvas.m_shapeManager.selection() -> shapeLayer -> shapeController -> globalShapeManager.selection()

Definition at line 351 of file kis_canvas2.cpp.

352{
353 // a bit of duplication from slotConfigChanged()
354 KisConfig cfg(true);
355 m_d->lodPreferredInImage = cfg.levelOfDetailEnabled();
356 m_d->regionOfInterestMargin = KisImageConfig(true).animationCacheRegionOfInterestMargin();
357
358 createCanvas(cfg.useOpenGL());
359
360 setLodPreferredInCanvas(m_d->lodPreferredInImage);
361
362 connect(m_d->view->canvasController()->proxyObject, SIGNAL(effectiveZoomChanged(qreal)), SLOT(slotEffectiveZoomChanged(qreal)));
363 connect(m_d->view->canvasController()->proxyObject, &KoCanvasControllerProxyObject::canvasStateChanged, this, &KisCanvas2::slotCanvasStateChanged);
364
365 connect(KisConfigNotifier::instance(), SIGNAL(configChanged()), SLOT(slotConfigChanged()));
368
384 KisShapeController *kritaShapeController = static_cast<KisShapeController*>(shapeController()->documentBase());
385 connect(kritaShapeController, SIGNAL(selectionChanged()),
386 this, SLOT(slotSelectionChanged()));
387 connect(kritaShapeController, SIGNAL(selectionContentChanged()),
388 selectedShapesProxy(), SIGNAL(selectionContentChanged()));
389 connect(kritaShapeController, SIGNAL(currentLayerChanged(const KoShapeLayer*)),
390 selectedShapesProxy(), SIGNAL(currentLayerChanged(const KoShapeLayer*)));
391
392#if !KRITA_QT_HAS_UPDATE_COMPRESSION_PATCH
393 connect(&m_d->canvasUpdateCompressor, SIGNAL(timeout()), SLOT(slotDoCanvasUpdate()));
394#endif
395
396 connect(this, SIGNAL(sigCanvasCacheUpdated()), &m_d->frameRenderStartCompressor, SLOT(start()));
397 connect(&m_d->frameRenderStartCompressor, SIGNAL(timeout()), SLOT(updateCanvasProjection()));
398
399 connect(this, SIGNAL(sigContinueResizeImage(qint32,qint32)), SLOT(finishResizingImage(qint32,qint32)));
400
401 connect(&m_d->regionOfInterestUpdateCompressor, SIGNAL(timeout()), SLOT(slotUpdateRegionOfInterest()));
402 connect(&m_d->referencesBoundsUpdateCompressor, SIGNAL(timeout()), SLOT(slotUpdateReferencesBounds()));
403
404 connect(m_d->view->document(), SIGNAL(sigReferenceImagesChanged()), &m_d->referencesBoundsUpdateCompressor, SLOT(start()));
405
407
408 m_d->animationPlayer.reset(new KisCanvasAnimationState(this));
409}
void initializeFpsDecoration()
void slotCanvasStateChanged()
void sigContinueResizeImage(qint32 w, qint32 h)
void slotUpdateReferencesBounds()
void slotSelectionChanged()
void slotConfigChanged()
void updateCanvasProjection()
void slotChangeGlobalProofingConfig()
void finishResizingImage(qint32 w, qint32 h)
void slotUpdateRegionOfInterest()
void sigCanvasCacheUpdated()
The KisCanvasAnimationState class stores all of the canvas-specific animation state.
static KisConfigNotifier * instance()
static KisImageConfigNotifier * instance()
void globalProofingConfigChanged()
qreal animationCacheRegionOfInterestMargin(bool defaultValue=false) const
QPointer< KoShapeController > shapeController

References KisImageConfig::animationCacheRegionOfInterestMargin(), KoCanvasControllerProxyObject::canvasStateChanged(), createCanvas(), finishResizingImage(), KisImageConfigNotifier::globalProofingConfigChanged(), initializeFpsDecoration(), KisConfigNotifier::instance(), KisImageConfigNotifier::instance(), KisConfig::levelOfDetailEnabled(), m_d, selectedShapesProxy, setLodPreferredInCanvas(), KoCanvasBase::shapeController, sigCanvasCacheUpdated(), sigContinueResizeImage(), slotCanvasStateChanged(), slotChangeGlobalProofingConfig(), slotConfigChanged(), slotDoCanvasUpdate(), slotEffectiveZoomChanged(), slotSelectionChanged(), slotUpdateReferencesBounds(), slotUpdateRegionOfInterest(), updateCanvasProjection(), and KisConfig::useOpenGL().

◆ setWrapAroundViewingMode()

void KisCanvas2::setWrapAroundViewingMode ( bool value)

Definition at line 1627 of file kis_canvas2.cpp.

1628{
1629 KisCanvasDecorationSP infinityDecoration =
1630 m_d->canvasWidget->decoration(INFINITY_DECORATION_ID);
1631
1632 if (infinityDecoration) {
1633 infinityDecoration->setVisible(!value);
1634 }
1635
1636 m_d->canvasWidget->setWrapAroundViewingMode(value);
1637}

References INFINITY_DECORATION_ID, m_d, and value().

◆ setWrapAroundViewingModeAxis()

void KisCanvas2::setWrapAroundViewingModeAxis ( WrapAroundAxis value)

Definition at line 1644 of file kis_canvas2.cpp.

1645{
1646 m_d->canvasWidget->setWrapAroundViewingModeAxis(value);
1647 updateCanvas();
1648}

References m_d, updateCanvas(), and value().

◆ shapeManager()

KoShapeManager * KisCanvas2::shapeManager ( ) const
overridevirtual

Return the right shape manager for the current layer. That is to say, if the current layer is a vector layer, return the shape layer's canvas' shapemanager, else the shapemanager associated with the global krita canvas.

Implements KoCanvasBase.

◆ sigCanvasCacheUpdated

void KisCanvas2::sigCanvasCacheUpdated ( )
signal

◆ sigCanvasEngineChanged

void KisCanvas2::sigCanvasEngineChanged ( )
signal

◆ sigCanvasStateChanged

void KisCanvas2::sigCanvasStateChanged ( )
signal

◆ sigContinueResizeImage

void KisCanvas2::sigContinueResizeImage ( qint32 w,
qint32 h )
signal

◆ sigRegionOfInterestChanged

void KisCanvas2::sigRegionOfInterestChanged ( const QRect & roi)
signal

◆ slotBeginUpdatesBatch

void KisCanvas2::slotBeginUpdatesBatch ( )
privateslot

Definition at line 1138 of file kis_canvas2.cpp.

1139{
1140 KisUpdateInfoSP info =
1142 m_d->coordinatesConverter->imageRectInImagePixels());
1143 m_d->projectionUpdatesCompressor.putUpdateInfo(info);
1144 Q_EMIT sigCanvasCacheUpdated();
1145}

References m_d, sigCanvasCacheUpdated(), and KisMarkerUpdateInfo::StartBatch.

◆ slotCanvasStateChanged

void KisCanvas2::slotCanvasStateChanged ( )
privateslot

Definition at line 1434 of file kis_canvas2.cpp.

1435{
1436 if (!m_d->currentCanvasIsOpenGL) {
1437 Q_ASSERT(m_d->prescaledProjection);
1438 auto state = KisCanvasState::fromConverter(*m_d->coordinatesConverter);
1439 m_d->prescaledProjection->notifyCanvasStateChanged(state);
1440 }
1441
1442 updateCanvas();
1443 m_d->regionOfInterestUpdateCompressor.start();
1444
1445 Q_EMIT sigCanvasStateChanged();
1446}
void sigCanvasStateChanged()
static KisCanvasState fromConverter(const KisCoordinatesConverter &converter)

References KisCanvasState::fromConverter(), m_d, sigCanvasStateChanged(), and updateCanvas().

◆ slotChangeGlobalProofingConfig

void KisCanvas2::slotChangeGlobalProofingConfig ( )
slot

Definition at line 1009 of file kis_canvas2.cpp.

1010{
1011 if (image() && !image()->proofingConfiguration()) {
1012 // global config should be updated only when
1013 // the image doesn't have its own config
1015 }
1016}
KisProofingConfigurationSP proofingConfiguration() const

References image(), proofingConfiguration(), and slotChangeProofingConfig().

◆ slotChangeProofingConfig

void KisCanvas2::slotChangeProofingConfig ( )
slot

Definition at line 1018 of file kis_canvas2.cpp.

1019{
1021 if (imageView()->softProofing()) {
1023 }
1024}
void refetchDataFromImage()

References fetchProofingOptions(), imageView(), and refetchDataFromImage().

◆ slotConfigChanged

void KisCanvas2::slotConfigChanged ( )
slot

Called whenever the configuration settings change.

Definition at line 1448 of file kis_canvas2.cpp.

1449{
1450 KisConfig cfg(true);
1451 m_d->regionOfInterestMargin = KisImageConfig(true).animationCacheRegionOfInterestMargin();
1452
1453 resetCanvas(cfg.useOpenGL());
1454
1455 QWidget *mainWindow = m_d->view->mainWindow();
1457
1458 QWidget *topLevelWidget = mainWindow->topLevelWidget();
1459 KIS_SAFE_ASSERT_RECOVER_RETURN(topLevelWidget);
1460
1461 KIS_SAFE_ASSERT_RECOVER_RETURN(m_d->multiSurfaceState);
1462 auto newState = m_d->multiSurfaceSetupManager.onConfigChanged(*m_d->multiSurfaceState,
1463 m_d->currentScreenId(),
1464 cfg.canvasSurfaceColorSpaceManagementMode(),
1466 m_d->assignChangedMultiSurfaceState(newState);
1467
1469}
void resetCanvas(bool useOpenGL)
static Options optionsFromKisConfig(const KisConfig &cfg)

References KisImageConfig::animationCacheRegionOfInterestMargin(), KisConfig::canvasSurfaceColorSpaceManagementMode(), initializeFpsDecoration(), KIS_SAFE_ASSERT_RECOVER_RETURN, m_d, KisDisplayConfig::optionsFromKisConfig(), resetCanvas(), and KisConfig::useOpenGL().

◆ slotDoCanvasUpdate

void KisCanvas2::slotDoCanvasUpdate ( )
privateslot

WARNING: in isBusy() we access openGL functions without making the painting context current. We hope that currently active context will be Qt's one, which is shared with our own.

Definition at line 1180 of file kis_canvas2.cpp.

1181{
1182
1183#if !KRITA_QT_HAS_UPDATE_COMPRESSION_PATCH
1189 if (m_d->canvasWidget->isBusy()) {
1190 // just restarting the timer
1191 m_d->canvasUpdateCompressor.start();
1192 return;
1193 }
1194#endif
1195
1196 QRect combinedUpdateRect = m_d->savedCanvasProjectionUpdateRect | m_d->savedOverlayUpdateRect;
1197 if (!combinedUpdateRect.isEmpty()) {
1198 // TODO: Remove this signal (only used by the old KisSketchView)
1199 Q_EMIT updateCanvasRequested(combinedUpdateRect);
1200
1201 if (wrapAroundViewingMode() && !m_d->savedCanvasProjectionUpdateRect.isEmpty()) {
1202 const QRect widgetRect = m_d->canvasWidget->widget()->rect();
1203 const QRect imageRect = m_d->coordinatesConverter->imageRectInImagePixels();
1204
1205 const QRect widgetRectInImagePixels =
1206 m_d->coordinatesConverter->widgetToImage(widgetRect).toAlignedRect();
1207
1208 const QRect rc = m_d->coordinatesConverter->widgetToImage(m_d->savedCanvasProjectionUpdateRect).toAlignedRect();
1209
1210 const QVector<QRect> updateRects =
1211 KisWrappedRect::multiplyWrappedRect(rc, imageRect, widgetRectInImagePixels, wrapAroundViewingModeAxis());
1212
1213 Q_FOREACH(const QRect &rc, updateRects) {
1214 const QRect widgetUpdateRect =
1215 m_d->coordinatesConverter->imageToWidget(rc).toAlignedRect() & widgetRect;
1216 m_d->canvasWidget->updateCanvasImage(widgetUpdateRect);
1217 }
1218 m_d->canvasWidget->updateCanvasDecorations(m_d->savedOverlayUpdateRect);
1219 } else {
1220 m_d->canvasWidget->updateCanvasImage(m_d->savedCanvasProjectionUpdateRect);
1221 m_d->canvasWidget->updateCanvasDecorations(m_d->savedOverlayUpdateRect);
1222 }
1223 } else if (m_d->updateSceneRequested) {
1224 m_d->canvasWidget->widget()->update();
1225 }
1226
1227 m_d->savedCanvasProjectionUpdateRect = QRect();
1228 m_d->savedOverlayUpdateRect = QRect();
1229 m_d->updateSceneRequested = false;
1230}
bool wrapAroundViewingMode() const
WrapAroundAxis wrapAroundViewingModeAxis() const
void updateCanvasRequested(const QRect &rc)
static QVector< QRect > multiplyWrappedRect(const QRect &rc, const QRect &wrapRect, const QRect &limitRect, WrapAroundAxis wrapAxis)

References m_d, KisWrappedRect::multiplyWrappedRect(), updateCanvasRequested(), wrapAroundViewingMode(), and wrapAroundViewingModeAxis().

◆ slotEffectiveZoomChanged

void KisCanvas2::slotEffectiveZoomChanged ( qreal newZoom)
privateslot

Definition at line 1327 of file kis_canvas2.cpp.

1328{
1329 Q_UNUSED(newZoom)
1330
1331
1332
1334}

References notifyLevelOfDetailChange().

◆ slotEndUpdatesBatch

void KisCanvas2::slotEndUpdatesBatch ( )
privateslot

Definition at line 1147 of file kis_canvas2.cpp.

1148{
1149 KisUpdateInfoSP info =
1151 m_d->coordinatesConverter->imageRectInImagePixels());
1152 m_d->projectionUpdatesCompressor.putUpdateInfo(info);
1153 Q_EMIT sigCanvasCacheUpdated();
1154}

References KisMarkerUpdateInfo::EndBatch, m_d, and sigCanvasCacheUpdated().

◆ slotGamutCheck

void KisCanvas2::slotGamutCheck ( )
slot

Definition at line 1001 of file kis_canvas2.cpp.

1002{
1004 if (imageView()->softProofing()) {
1006 }
1007}

References imageView(), refetchDataFromImage(), and updateProofingState().

◆ slotImageColorSpaceChanged

void KisCanvas2::slotImageColorSpaceChanged ( )
privateslot

Definition at line 933 of file kis_canvas2.cpp.

934{
935 KisImageSP image = this->image();
936
937 m_d->view->viewManager()->blockUntilOperationsFinishedForced(image);
938
939 m_d->displayColorConverter.setImageColorSpace(image->colorSpace());
940 m_d->channelFlags = image->rootLayer()->channelFlags();
941 m_d->canvasWidget->channelSelectionChanged(m_d->channelFlags);
942
943 // Not all color spaces are supported by soft-proofing, so update state
944 if (imageView()->softProofing()) {
946 }
947
949 m_d->canvasWidget->notifyImageColorSpaceChanged(image->colorSpace());
950 image->unlock();
951}

References KisImage::barrierLock(), KisLayer::channelFlags, KisImage::colorSpace(), image(), imageView(), m_d, KisImage::rootLayer(), KisImage::unlock(), and updateProofingState().

◆ slotPopupPaletteRequestedZoomChange

void KisCanvas2::slotPopupPaletteRequestedZoomChange ( int zoom)
slot

Definition at line 1596 of file kis_canvas2.cpp.

1596 {
1597 m_d->view->canvasController()->setZoom(KoZoomMode::ZOOM_CONSTANT, (qreal)(zoom/100.0)); // 1.0 is 100% zoom
1598}
@ ZOOM_CONSTANT
zoom x %
Definition KoZoomMode.h:24

References m_d, and KoZoomMode::ZOOM_CONSTANT.

◆ slotScreenChanged

void KisCanvas2::slotScreenChanged ( QScreen * screen)
slot

Definition at line 1471 of file kis_canvas2.cpp.

1472{
1473 const int screenId = qApp->screens().indexOf(screen);
1474
1475 if (screenId < 0) {
1476 warnUI << "Failed to get screenNumber for updating display profile.";
1477 return;
1478 }
1479
1480 KIS_SAFE_ASSERT_RECOVER_RETURN(m_d->multiSurfaceState);
1481 auto newState = m_d->multiSurfaceSetupManager.onScreenChanged(*m_d->multiSurfaceState,
1482 screenId);
1483 m_d->assignChangedMultiSurfaceState(newState);
1484}
#define warnUI
Definition kis_debug.h:101

References KIS_SAFE_ASSERT_RECOVER_RETURN, m_d, and warnUI.

◆ slotSelectionChanged

void KisCanvas2::slotSelectionChanged ( )
privateslot

Definition at line 1615 of file kis_canvas2.cpp.

1616{
1617 KisShapeLayer* shapeLayer = dynamic_cast<KisShapeLayer*>(viewManager()->activeLayer().data());
1618 if (!shapeLayer) {
1619 return;
1620 }
1621 m_d->shapeManager.selection()->deselectAll();
1622 Q_FOREACH (KoShape* shape, shapeLayer->shapeManager()->selection()->selectedShapes()) {
1623 m_d->shapeManager.selection()->select(shape);
1624 }
1625}
KoShapeManager * shapeManager() const
KisLayerSP activeLayer()
Convenience method to get at the active layer.
const QList< KoShape * > selectedShapes() const
KoSelection * selection

References KisViewManager::activeLayer(), KisSharedPtr< T >::data(), m_d, KoSelection::selectedShapes(), KoShapeManager::selection, KisShapeLayer::shapeManager(), and viewManager().

◆ slotSetLodUpdatesBlocked

void KisCanvas2::slotSetLodUpdatesBlocked ( bool value)
privateslot

Definition at line 1156 of file kis_canvas2.cpp.

1157{
1158 KisUpdateInfoSP info =
1161 KisMarkerUpdateInfo::UnblockLodUpdates,
1162 m_d->coordinatesConverter->imageRectInImagePixels());
1163 m_d->projectionUpdatesCompressor.putUpdateInfo(info);
1164 Q_EMIT sigCanvasCacheUpdated();
1165}

References KisMarkerUpdateInfo::BlockLodUpdates, m_d, sigCanvasCacheUpdated(), KisMarkerUpdateInfo::UnblockLodUpdates, and value().

◆ slotSoftProofing

void KisCanvas2::slotSoftProofing ( )
slot

Definition at line 995 of file kis_canvas2.cpp.

996{
999}

References refetchDataFromImage(), and updateProofingState().

◆ slotSurfaceFormatChanged()

void KisCanvas2::slotSurfaceFormatChanged ( const KisDisplayConfig & config)
private

Definition at line 1531 of file kis_canvas2.cpp.

1532{
1533#if KRITA_USE_SURFACE_COLOR_MANAGEMENT_API
1534
1535 KIS_SAFE_ASSERT_RECOVER_RETURN(m_d->multiSurfaceState);
1536 if (m_d->multiSurfaceState->multiConfig.canvasDisplayConfig() == config) return;
1537
1538 if (m_d->multiSurfaceState->isCanvasOpenGL) {
1539 if (config.isHDR &&
1540 m_d->canvasWidget->currentBitDepthMode() < KisOpenGLCanvas2::BitDepthMode::Depth10Bit) {
1541
1542 const QString warningMessage = i18n(
1543 "WARNING: HDR mode was activated on surface working in 8-bit mode!\n"
1544 "Please activate 10-bit mode in Krita's Preferences dialog and restart "
1545 "Krita to avoid color banding!");
1546
1547 m_d->view->showFloatingMessage(warningMessage, koIcon("warning"), 7000, KisFloatingMessage::High);
1548 warnOpenGL.noquote() << QString(warningMessage).replace('\n', ' ');
1549 warnOpenGL << ppVar(QSurfaceFormat::defaultFormat());
1550 }
1551 }
1552
1553 auto newState = m_d->multiSurfaceSetupManager.onCanvasSurfaceFormatChanged(*m_d->multiSurfaceState, config);
1554 m_d->assignChangedMultiSurfaceStateSkipCanvasSurface(newState);
1555#else
1556 Q_UNUSED(config);
1557#endif
1558}
#define warnOpenGL
Definition kis_debug.h:108
#define koIcon(name)
Use these macros for icons without any issues.
Definition kis_icon.h:25

References KisAbstractCanvasWidget::Depth10Bit, KisFloatingMessage::High, KisDisplayConfig::isHDR, KIS_SAFE_ASSERT_RECOVER_RETURN, koIcon, m_d, ppVar, and warnOpenGL.

◆ slotTrySwitchShapeManager

void KisCanvas2::slotTrySwitchShapeManager ( )
slot

Definition at line 1383 of file kis_canvas2.cpp.

1384{
1385 // Still needs to be recalculated in some cases, like when deleting vector layers
1387}

References localShapeManager().

◆ slotUpdateReferencesBounds

void KisCanvas2::slotUpdateReferencesBounds ( )
privateslot

Definition at line 1357 of file kis_canvas2.cpp.

1358{
1359 QRectF referencesRect;
1360 KisReferenceImagesLayerSP layer = m_d->view->document()->referenceImagesLayer();
1361 if (layer) {
1362 referencesRect = layer->boundingImageRect();
1363 }
1364
1365 m_d->view->canvasController()->syncOnReferencesChange(referencesRect);
1366}

References KisReferenceImagesLayer::boundingImageRect(), and m_d.

◆ slotUpdateRegionOfInterest

void KisCanvas2::slotUpdateRegionOfInterest ( )
privateslot

Definition at line 1341 of file kis_canvas2.cpp.

1342{
1343 const QRect oldRegionOfInterest = m_d->regionOfInterest;
1344
1345 const qreal ratio = m_d->regionOfInterestMargin;
1346 const QRect proposedRoi = KisAlgebra2D::blowRect(m_d->coordinatesConverter->widgetRectInImagePixels(), ratio).toAlignedRect();
1347
1348 const QRect imageRect = m_d->coordinatesConverter->imageRectInImagePixels();
1349
1350 m_d->regionOfInterest = proposedRoi & imageRect;
1351
1352 if (m_d->regionOfInterest != oldRegionOfInterest) {
1353 Q_EMIT sigRegionOfInterestChanged(m_d->regionOfInterest);
1354 }
1355}
void sigRegionOfInterestChanged(const QRect &roi)
Rect blowRect(const Rect &rect, qreal coeff)

References KisAlgebra2D::blowRect(), m_d, and sigRegionOfInterestChanged().

◆ snapToGrid()

bool KisCanvas2::snapToGrid ( ) const
overridevirtual

return if snap to grid is enabled.

Returns
if snap to grid is enabled.

Implements KoCanvasBase.

Definition at line 544 of file kis_canvas2.cpp.

545{
546 return m_d->view->document()->gridConfig().snapToGrid();
547}

References m_d.

◆ startResizingImage

void KisCanvas2::startResizingImage ( )
slot

Definition at line 1041 of file kis_canvas2.cpp.

1042{
1043 KisImageWSP image = this->image();
1044 qint32 w = image->width();
1045 qint32 h = image->height();
1046
1047 Q_EMIT sigContinueResizeImage(w, h);
1048
1049 QRect imageBounds(0, 0, w, h);
1050 startUpdateInPatches(imageBounds);
1051}
qint32 width() const
qint32 height() const

References KisImage::height(), image(), sigContinueResizeImage(), startUpdateInPatches(), and KisImage::width().

◆ startUpdateCanvasProjection

void KisCanvas2::startUpdateCanvasProjection ( const QRect & rc)
privateslot

The image projection has changed, now start an update of the canvas representation.

Definition at line 1058 of file kis_canvas2.cpp.

1059{
1060 KisUpdateInfoSP info = m_d->canvasWidget->startUpdateCanvasProjection(rc);
1061 if (m_d->projectionUpdatesCompressor.putUpdateInfo(info)) {
1062 Q_EMIT sigCanvasCacheUpdated();
1063 }
1064}

References m_d, and sigCanvasCacheUpdated().

◆ startUpdateInPatches

void KisCanvas2::startUpdateInPatches ( const QRect & imageRect)
slot

We don't do patched loading for openGL canvas, because it loads the tiles, which are basically "patches". Therefore, big chunks of memory are never allocated.

Definition at line 893 of file kis_canvas2.cpp.

894{
900 if (m_d->currentCanvasIsOpenGL) {
902 } else {
903 KisImageConfig imageConfig(true);
904 int patchWidth = imageConfig.updatePatchWidth();
905 int patchHeight = imageConfig.updatePatchHeight();
906
907 for (int y = 0; y < imageRect.height(); y += patchHeight) {
908 for (int x = 0; x < imageRect.width(); x += patchWidth) {
909 QRect patchRect(x, y, patchWidth, patchHeight);
911 }
912 }
913 }
914}

References m_d, startUpdateCanvasProjection(), KisImageConfig::updatePatchHeight(), and KisImageConfig::updatePatchWidth().

◆ toolProxy()

KoToolProxy * KisCanvas2::toolProxy ( ) const
overridevirtual

Return the proxy to the active tool (determining which tool is really, really active is hard when tablets are involved, so leave that to others.

Implements KoCanvasBase.

◆ unit()

KoUnit KisCanvas2::unit ( ) const
overridevirtual

Return the unit of the current document for initialization of the widgets created by the flake framework.

See also
KoDocument::unit()

Implements KoCanvasBase.

Definition at line 710 of file kis_canvas2.cpp.

711{
713
714 KisImageWSP image = m_d->view->image();
715 if (image) {
716 if (!qFuzzyCompare(image->xRes(), image->yRes())) {
717 warnKrita << "WARNING: resolution of the image is anisotropic"
718 << ppVar(image->xRes())
719 << ppVar(image->yRes());
720 }
721
722 const qreal resolution = image->xRes();
723 unit.setFactor(resolution);
724 }
725
726 return unit;
727}
KoUnit unit() const override
double xRes() const
double yRes() const
@ Pixel
Definition KoUnit.h:82
void setFactor(qreal factor)
Definition KoUnit.h:122
static bool qFuzzyCompare(half p1, half p2)

References image(), m_d, KoUnit::Pixel, ppVar, qFuzzyCompare(), KoUnit::setFactor(), unit(), warnKrita, KisImage::xRes(), and KisImage::yRes().

◆ updateCanvas [1/2]

void KisCanvas2::updateCanvas ( )
slot

Update the entire canvas area.

Definition at line 1248 of file kis_canvas2.cpp.

1249{
1251}

References updateCanvasWidgetImpl().

◆ updateCanvas() [2/2]

void KisCanvas2::updateCanvas ( const QRectF & rc)
overridevirtual

Tell the canvas to repaint the specified rectangle. The coordinates are document coordinates, not view coordinates.

Implements KoCanvasBase.

Definition at line 1260 of file kis_canvas2.cpp.

1261{
1262 // updateCanvas is called from tools, never from the projection
1263 // updates, so no need to prescale!
1264 QRect widgetRect = m_d->docUpdateRectToWidget(documentRect);
1265 if (!widgetRect.isEmpty()) {
1266 updateCanvasWidgetImpl(widgetRect);
1267 }
1268}

References m_d, and updateCanvasWidgetImpl().

◆ updateCanvasDecorations [1/2]

void KisCanvas2::updateCanvasDecorations ( )
slot

Definition at line 1279 of file kis_canvas2.cpp.

1280{
1281 m_d->savedOverlayUpdateRect = m_d->canvasWidget->widget()->rect();
1283}
void requestCanvasUpdateMaybeCompressed()

References m_d, and requestCanvasUpdateMaybeCompressed().

◆ updateCanvasDecorations [2/2]

void KisCanvas2::updateCanvasDecorations ( const QRectF & docRect)
slot

Definition at line 1285 of file kis_canvas2.cpp.

1286{
1287 QRect widgetRect = m_d->docUpdateRectToWidget(docRect);
1288 if (!widgetRect.isEmpty()) {
1289 m_d->savedOverlayUpdateRect |= widgetRect;
1291 }
1292}

References m_d, and requestCanvasUpdateMaybeCompressed().

◆ updateCanvasProjection [1/2]

void KisCanvas2::updateCanvasProjection ( )
privateslot

Definition at line 1066 of file kis_canvas2.cpp.

1067{
1068 auto tryIssueCanvasUpdates = [this](const QRect &vRect) {
1069 if (!m_d->isBatchUpdateActive) {
1070 // TODO: Implement info->dirtyViewportRect() for KisOpenGLCanvas2 to avoid updating whole canvas
1071 if (m_d->currentCanvasIsOpenGL) {
1072 m_d->savedCanvasProjectionUpdateRect |= vRect;
1073
1074 // we already had a compression in frameRenderStartCompressor, so force the update directly
1076 } else if (/* !m_d->currentCanvasIsOpenGL && */ !vRect.isEmpty()) {
1077 m_d->savedCanvasProjectionUpdateRect |= m_d->coordinatesConverter->viewportToWidget(vRect).toAlignedRect();
1078
1079 // we already had a compression in frameRenderStartCompressor, so force the update directly
1081 }
1082 }
1083 };
1084
1085 auto uploadData = [this, tryIssueCanvasUpdates](const QVector<KisUpdateInfoSP> &infoObjects) {
1086 QVector<QRect> viewportRects = m_d->canvasWidget->updateCanvasProjection(infoObjects);
1087 const QRect vRect = std::accumulate(viewportRects.constBegin(), viewportRects.constEnd(),
1088 QRect(), std::bit_or<QRect>());
1089
1090 tryIssueCanvasUpdates(vRect);
1091 };
1092
1093 bool shouldExplicitlyIssueUpdates = false;
1094
1095 QVector<KisUpdateInfoSP> infoObjects;
1096 KisUpdateInfoList originalInfoObjects;
1097 m_d->projectionUpdatesCompressor.takeUpdateInfo(originalInfoObjects);
1098
1099 for (auto it = originalInfoObjects.constBegin();
1100 it != originalInfoObjects.constEnd();
1101 ++it) {
1102
1103 KisUpdateInfoSP info = *it;
1104
1105 const KisMarkerUpdateInfo *batchInfo = dynamic_cast<const KisMarkerUpdateInfo*>(info.data());
1106 if (batchInfo) {
1107 if (!infoObjects.isEmpty()) {
1108 uploadData(infoObjects);
1109 infoObjects.clear();
1110 }
1111
1112 if (batchInfo->type() == KisMarkerUpdateInfo::StartBatch) {
1113 m_d->isBatchUpdateActive++;
1114 } else if (batchInfo->type() == KisMarkerUpdateInfo::EndBatch) {
1115 m_d->isBatchUpdateActive--;
1116 KIS_SAFE_ASSERT_RECOVER_RETURN(m_d->isBatchUpdateActive >= 0);
1117 if (m_d->isBatchUpdateActive == 0) {
1118 shouldExplicitlyIssueUpdates = true;
1119 }
1120 } else if (batchInfo->type() == KisMarkerUpdateInfo::BlockLodUpdates) {
1121 m_d->canvasWidget->setLodResetInProgress(true);
1122 } else if (batchInfo->type() == KisMarkerUpdateInfo::UnblockLodUpdates) {
1123 m_d->canvasWidget->setLodResetInProgress(false);
1124 shouldExplicitlyIssueUpdates = true;
1125 }
1126 } else {
1127 infoObjects << info;
1128 }
1129 }
1130
1131 if (!infoObjects.isEmpty()) {
1132 uploadData(infoObjects);
1133 } else if (shouldExplicitlyIssueUpdates) {
1134 tryIssueCanvasUpdates(m_d->coordinatesConverter->imageRectInImagePixels());
1135 }
1136}

References KisMarkerUpdateInfo::BlockLodUpdates, KisSharedPtr< T >::data(), KisMarkerUpdateInfo::EndBatch, KIS_SAFE_ASSERT_RECOVER_RETURN, m_d, slotDoCanvasUpdate(), KisMarkerUpdateInfo::StartBatch, KisMarkerUpdateInfo::type(), and KisMarkerUpdateInfo::UnblockLodUpdates.

◆ updateCanvasProjection [2/2]

void KisCanvas2::updateCanvasProjection ( const QRectF & docRect)
slot

Definition at line 1270 of file kis_canvas2.cpp.

1271{
1272 QRect widgetRect = m_d->docUpdateRectToWidget(docRect);
1273 if (!widgetRect.isEmpty()) {
1274 m_d->savedCanvasProjectionUpdateRect |= widgetRect;
1276 }
1277}

References m_d, and requestCanvasUpdateMaybeCompressed().

◆ updateCanvasRequested

void KisCanvas2::updateCanvasRequested ( const QRect & rc)
signal

◆ updateCanvasScene

void KisCanvas2::updateCanvasScene ( )
slot

Definition at line 1315 of file kis_canvas2.cpp.

1316{
1317 m_d->updateSceneRequested = true;
1319}

References m_d, and requestCanvasUpdateMaybeCompressed().

◆ updateCanvasToolOutlineDoc

void KisCanvas2::updateCanvasToolOutlineDoc ( const QRectF & docRect)
slot

Definition at line 1294 of file kis_canvas2.cpp.

1295{
1296 QRect widgetRect = m_d->docUpdateRectToWidget(docRect);
1297 if (!widgetRect.isEmpty()) {
1298 updateCanvasToolOutlineWdg(widgetRect);
1299 }
1300}
void updateCanvasToolOutlineWdg(const QRect &widgetRect)

References m_d, and updateCanvasToolOutlineWdg().

◆ updateCanvasToolOutlineWdg

void KisCanvas2::updateCanvasToolOutlineWdg ( const QRect & widgetRect)
slot

Definition at line 1302 of file kis_canvas2.cpp.

1303{
1304 QRect rect = widgetRect & m_d->canvasWidget->widget()->rect();
1305 if (!rect.isEmpty()) {
1306 m_d->savedOverlayUpdateRect |= rect;
1307#ifdef HAVE_NO_QT_UPDATE_COMPRESSIO
1308 m_d->canvasUpdateCompressor.start();
1309#else
1311#endif
1312 }
1313}

References m_d, and slotDoCanvasUpdate().

◆ updateCanvasWidgetImpl()

void KisCanvas2::updateCanvasWidgetImpl ( const QRect & rc = QRect())
private

Definition at line 1232 of file kis_canvas2.cpp.

1233{
1234 QRect rect = m_d->canvasWidget->widget()->rect();
1235 if (!rc.isEmpty()) {
1236 rect &= rc;
1237 if (rect.isEmpty()) {
1238 return;
1239 }
1240 }
1241 // We don't know if it's the canvas projection or the overlay that's
1242 // changed, so we update both.
1243 m_d->savedCanvasProjectionUpdateRect |= rect;
1244 m_d->savedOverlayUpdateRect |= rect;
1246}

References m_d, and requestCanvasUpdateMaybeCompressed().

◆ updateProofingState()

void KisCanvas2::updateProofingState ( )

Definition at line 978 of file kis_canvas2.cpp.

979{
980 KoColorConversionTransformation::ConversionFlags displayFlags = m_d->proofingConfig->displayFlags;
981 displayFlags.setFlag(KoColorConversionTransformation::SoftProofing, false);
982
983 if (image()->colorSpace()->colorDepthId().id().contains("U")) {
984 displayFlags.setFlag(KoColorConversionTransformation::SoftProofing, imageView()->softProofing());
985 displayFlags.setFlag(KoColorConversionTransformation::GamutCheck, imageView()->gamutCheck());
986 }
987 m_d->proofingConfig->displayFlags = displayFlags;
988 m_d->proofingConfigUpdated = true;
989
990 KIS_SAFE_ASSERT_RECOVER_RETURN(m_d->multiSurfaceState);
991 auto newState = m_d->multiSurfaceSetupManager.onProofingChanged(*m_d->multiSurfaceState, m_d->proofingConfig);
992 m_d->assignChangedMultiSurfaceState(newState);
993}

References KoColorConversionTransformation::GamutCheck, image(), imageView(), KIS_SAFE_ASSERT_RECOVER_RETURN, m_d, and KoColorConversionTransformation::SoftProofing.

◆ viewConverter() [1/2]

const KoViewConverter * KisCanvas2::viewConverter ( ) const
overridevirtual

Return the viewConverter for this view.

Returns
the viewConverter for this view.

Implements KoCanvasBase.

Definition at line 679 of file kis_canvas2.cpp.

680{
681 return m_d->coordinatesConverter;
682}

References m_d.

◆ viewConverter() [2/2]

KoViewConverter * KisCanvas2::viewConverter ( )
overridevirtual

Implements KoCanvasBase.

Definition at line 684 of file kis_canvas2.cpp.

685{
686 return m_d->coordinatesConverter;
687}

References m_d.

◆ viewManager()

KisViewManager * KisCanvas2::viewManager ( ) const

Definition at line 1410 of file kis_canvas2.cpp.

1411{
1412 if (m_d->view) {
1413 return m_d->view->viewManager();
1414 }
1415 return 0;
1416}

References m_d.

◆ wrapAroundViewingMode()

bool KisCanvas2::wrapAroundViewingMode ( ) const

Definition at line 1639 of file kis_canvas2.cpp.

1640{
1641 return m_d->canvasWidget->wrapAroundViewingMode();
1642}

References m_d.

◆ wrapAroundViewingModeAxis()

WrapAroundAxis KisCanvas2::wrapAroundViewingModeAxis ( ) const

Definition at line 1650 of file kis_canvas2.cpp.

1651{
1652 return m_d->canvasWidget->wrapAroundViewingModeAxis();
1653}

References m_d.

◆ xAxisMirrored

bool KisCanvas2::xAxisMirrored ( ) const
slot

Bools indicating canvasmirroring.

Definition at line 554 of file kis_canvas2.cpp.

555{
556 return m_d->coordinatesConverter->xAxisMirrored();
557}

References m_d.

◆ yAxisMirrored

bool KisCanvas2::yAxisMirrored ( ) const
slot

Definition at line 559 of file kis_canvas2.cpp.

560{
561 return m_d->coordinatesConverter->yAxisMirrored();
562}

References m_d.

Friends And Related Symbol Documentation

◆ KisView

friend class KisView
friend

Definition at line 348 of file kis_canvas2.h.

Member Data Documentation

◆ animationPlayer

QScopedPointer<KisCanvasAnimationState> KisCanvas2::animationPlayer

Definition at line 244 of file kis_canvas2.cpp.

◆ bootstrapLodBlocked

bool KisCanvas2::bootstrapLodBlocked = false

Definition at line 247 of file kis_canvas2.cpp.

◆ canvasUpdateCompressor

KisSignalCompressor KisCanvas2::canvasUpdateCompressor

Definition at line 230 of file kis_canvas2.cpp.

◆ canvasWidget

const QWidget * KisCanvas2::canvasWidget = 0

Definition at line 219 of file kis_canvas2.cpp.

◆ channelFlags

QBitArray KisCanvas2::channelFlags

Definition at line 236 of file kis_canvas2.cpp.

◆ coordinatesConverter

const KisCoordinatesConverter * KisCanvas2::coordinatesConverter = 0

Definition at line 217 of file kis_canvas2.cpp.

◆ currentCanvasIsOpenGL

bool KisCanvas2::currentCanvasIsOpenGL = true

Definition at line 222 of file kis_canvas2.cpp.

◆ currentlyActiveShapeManager

QPointer<KoShapeManager> KisCanvas2::currentlyActiveShapeManager

Definition at line 248 of file kis_canvas2.cpp.

◆ displayColorConverter

KisDisplayColorConverter * KisCanvas2::displayColorConverter

Definition at line 241 of file kis_canvas2.cpp.

◆ frameCache

KisAnimationFrameCacheSP KisCanvas2::frameCache

Definition at line 245 of file kis_canvas2.cpp.

◆ frameRenderStartCompressor

KisSignalCompressor KisCanvas2::frameRenderStartCompressor

Definition at line 253 of file kis_canvas2.cpp.

◆ groupModeShapeWrapper

std::optional<ShapeLifetimeWrapper> KisCanvas2::groupModeShapeWrapper

Definition at line 223 of file kis_canvas2.cpp.

◆ inputActionGroupsMask

KisInputActionGroupsMask KisCanvas2::inputActionGroupsMask = AllActionGroup

Definition at line 249 of file kis_canvas2.cpp.

◆ inputActionGroupsMaskInterface

KisInputActionGroupsMaskInterface::SharedInterface KisCanvas2::inputActionGroupsMaskInterface

Definition at line 251 of file kis_canvas2.cpp.

◆ isBatchUpdateActive

int KisCanvas2::isBatchUpdateActive = 0

Definition at line 261 of file kis_canvas2.cpp.

◆ lodPreferredInImage

bool KisCanvas2::lodPreferredInImage = false

Definition at line 246 of file kis_canvas2.cpp.

◆ m_d

KisCanvas2Private* const KisCanvas2::m_d
private

Definition at line 350 of file kis_canvas2.h.

◆ multiSurfaceSetupManager

KisMultiSurfaceStateManager KisCanvas2::multiSurfaceSetupManager

Definition at line 268 of file kis_canvas2.cpp.

◆ multiSurfaceState

std::optional<KisMultiSurfaceStateManager::State> KisCanvas2::multiSurfaceState

Definition at line 269 of file kis_canvas2.cpp.

◆ openGLFilterMode

KisOpenGL::FilterMode KisCanvas2::openGLFilterMode = 0

Definition at line 225 of file kis_canvas2.cpp.

◆ popupPalette

KisPopupPalette * KisCanvas2::popupPalette = 0

Definition at line 240 of file kis_canvas2.cpp.

◆ prescaledProjection

KisPrescaledProjectionSP KisCanvas2::prescaledProjection

Definition at line 227 of file kis_canvas2.cpp.

◆ projectionUpdatesCompressor

KisCanvasUpdatesCompressor KisCanvas2::projectionUpdatesCompressor

Definition at line 243 of file kis_canvas2.cpp.

◆ proofingConfig

KisProofingConfigurationSP KisCanvas2::proofingConfig

Definition at line 237 of file kis_canvas2.cpp.

◆ proofingConfigUpdated

bool KisCanvas2::proofingConfigUpdated = false

Definition at line 238 of file kis_canvas2.cpp.

◆ q

KisCanvas2* KisCanvas2::q = 0

Definition at line 216 of file kis_canvas2.cpp.

◆ referencesBoundsUpdateCompressor

KisSignalCompressor KisCanvas2::referencesBoundsUpdateCompressor

Definition at line 256 of file kis_canvas2.cpp.

◆ regionOfInterest

QRect KisCanvas2::regionOfInterest

Definition at line 257 of file kis_canvas2.cpp.

◆ regionOfInterestMargin

qreal KisCanvas2::regionOfInterestMargin = 0.25

Definition at line 258 of file kis_canvas2.cpp.

◆ regionOfInterestUpdateCompressor

KisSignalCompressor KisCanvas2::regionOfInterestUpdateCompressor

Definition at line 255 of file kis_canvas2.cpp.

◆ renderingLimit

QRect KisCanvas2::renderingLimit

Definition at line 260 of file kis_canvas2.cpp.

◆ savedCanvasProjectionUpdateRect

QRect KisCanvas2::savedCanvasProjectionUpdateRect

Definition at line 232 of file kis_canvas2.cpp.

◆ savedOverlayUpdateRect

QRect KisCanvas2::savedOverlayUpdateRect

Definition at line 233 of file kis_canvas2.cpp.

◆ selectedShapesProxy

KoSelectedShapesProxy * KisCanvas2::selectedShapesProxy

Definition at line 221 of file kis_canvas2.cpp.

◆ shapeManager

KoShapeManager * KisCanvas2::shapeManager

Definition at line 220 of file kis_canvas2.cpp.

◆ toolProxy

KoToolProxy * KisCanvas2::toolProxy

Definition at line 226 of file kis_canvas2.cpp.

◆ updateSceneRequested

bool KisCanvas2::updateSceneRequested = false

Definition at line 234 of file kis_canvas2.cpp.

◆ view

QPointer<KisView> KisCanvas2::view

Definition at line 218 of file kis_canvas2.cpp.


The documentation for this class was generated from the following files: