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)
 
KisCanvasAnimationStateanimationState () 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 KisCoordinatesConvertercoordinatesConverter () const
 
KisImageWSP currentImage () const
 
int currentScreenId () const
 
KoShapecurrentShapeManagerOwnerShape () const override
 the shape that owns the currently active shape manager
 
KisCanvasDecorationSP decoration (const QString &id) const
 
void disconnectCanvasObserver (QObject *object) override
 
void disconnectImage ()
 
KisDisplayColorConverterdisplayColorConverter () const
 
QSharedPointer< KisDisplayFilterdisplayFilter () const
 
KoColorDisplayRendererInterfacedisplayRendererInterface () 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
 
KisExposureGammaCorrectionInterfaceexposureGammaCorrectionInterface () 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
 
KisInputManagerglobalInputManager () const
 
KoShapeManagerglobalShapeManager () const
 
void gridSize (QPointF *offset, QSizeF *spacing) const override
 
KisImageWSP image () const
 
QPointer< KisViewimageView () 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)
 
KoShapeManagerlocalShapeManager () const
 
bool lodIsSupported () const
 
bool lodPreferredInCanvas () const
 
KisOpenGL::FilterMode openGLFilterMode () const
 
KisPaintingAssistantsDecorationSP paintingAssistantsDecoration () const
 
KisPopupPalettepopupPalette ()
 
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
 
KoSelectedShapesProxyselectedShapesProxy () 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)
 
KoShapeManagershapeManager () const override
 
bool snapToGrid () const override
 
KoToolProxytoolProxy () const override
 
KoUnit unit () const override
 
void updateCanvas (const QRectF &rc) override
 
void updateProofingState ()
 
const KoViewConverterviewConverter () const override
 
KoViewConverterviewConverter () override
 
KisViewManagerviewManager () const
 
bool wrapAroundViewingMode () const
 
WrapAroundAxis wrapAroundViewingModeAxis () const
 
 ~KisCanvas2 () override
 
 ~KisCanvas2Private ()
 
- Public Member Functions inherited from KoCanvasBase
KoCanvasControllercanvasController () const
 
virtual void clipToDocument (const KoShape *shape, QPointF &move) const
 
 KoCanvasBase (KoShapeControllerBase *shapeController, KoCanvasResourceProvider *sharedResourceManager=0)
 
 Private ()
 
KoCanvasResourceProviderresourceManager () const
 
void setCanvasController (KoCanvasController *controller)
 called by KoCanvasController to set the controller that handles this canvas.
 
KoShapeControllershapeController () const
 
KoSnapGuidesnapGuide () const
 
virtual QPointF viewToDocument (const QPointF &viewPoint) const
 
 ~KoCanvasBase () override
 
 ~Private ()
 

Public Attributes

QScopedPointer< KisCanvasAnimationStateanimationPlayer
 
bool bootstrapLodBlocked = false
 
KisSignalCompressor canvasUpdateCompressor
 
KisAbstractCanvasWidgetcanvasWidget = 0
 
QBitArray channelFlags
 
KisCoordinatesConvertercoordinatesConverter = 0
 
bool currentCanvasIsOpenGL = true
 
QPointer< KoShapeManagercurrentlyActiveShapeManager
 
KisDisplayColorConverter displayColorConverter
 
KisAnimationFrameCacheSP frameCache
 
KisSignalCompressor frameRenderStartCompressor
 
std::optional< ShapeLifetimeWrapper > groupModeShapeWrapper
 
KisInputActionGroupsMask inputActionGroupsMask = AllActionGroup
 
QSharedPointer< CanvasInputActionGroupsMaskInterfaceinputActionGroupsMaskInterface
 
int isBatchUpdateActive = 0
 
bool lodPreferredInImage = false
 
KisMultiSurfaceStateManager multiSurfaceSetupManager
 
std::optional< KisMultiSurfaceStateManager::StatemultiSurfaceState
 
int openGLFilterMode = 0
 
KisPopupPalettepopupPalette = 0
 
KisPrescaledProjectionSP prescaledProjection
 
KisCanvasUpdatesCompressor projectionUpdatesCompressor
 
KisProofingConfigurationSP proofingConfig
 
bool proofingConfigUpdated = false
 
KisCanvas2q = 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< KisViewview
 
- Public Attributes inherited from KoCanvasBase
KoCanvasControllercontroller
 
bool isResourceManagerShared
 
QPointer< KoCanvasResourceProviderresourceManager
 
QPointer< KoShapeControllershapeController
 
KoSnapGuidesnapGuide
 

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 574 of file kis_canvas2.cpp.

575{
576 // This method exists to support flake-related operations
577 m_d->view->image()->undoAdapter()->addCommand(command);
578}

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 1557 of file kis_canvas2.cpp.

1558{
1559 m_d->canvasWidget->addDecoration(deco);
1560}

References m_d.

◆ animationState()

KisCanvasAnimationState * KisCanvas2::animationState ( ) const

Definition at line 1607 of file kis_canvas2.cpp.

1608{
1609 return m_d->animationPlayer.data();
1610}

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 1652 of file kis_canvas2.cpp.

1653{
1654 if (!m_d->bootstrapLodBlocked) return;
1655
1656 m_d->bootstrapLodBlocked = false;
1657 setLodPreferredInCanvas(m_d->lodPreferredInImage);
1658
1659 // Initialization of audio tracks is deferred until after canvas has been completely constructed.
1660 m_d->animationPlayer->setupAudioTracks();
1661}
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 561 of file kis_canvas2.cpp.

562{
563 KisImageSP image = this->image();
564 m_d->channelFlags = image->rootLayer()->channelFlags();
565
566 m_d->view->viewManager()->blockUntilOperationsFinishedForced(image);
567
569 m_d->canvasWidget->channelSelectionChanged(m_d->channelFlags);
571 image->unlock();
572}
void startUpdateInPatches(const QRect &imageRect)
KisImageWSP image() const
KisGroupLayerSP rootLayer() const
void unlock()
Definition kis_image.cc:806
void barrierLock(bool readOnly=false)
Wait until all the queued background jobs are completed and lock the image.
Definition kis_image.cc:757
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 1700 of file kis_canvas2.cpp.

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

References m_d.

◆ connectCurrentCanvas()

void KisCanvas2::connectCurrentCanvas ( )
private

Definition at line 847 of file kis_canvas2.cpp.

848{
849 KisImageWSP image = m_d->view->image();
850
851 if (!m_d->currentCanvasIsOpenGL) {
852 Q_ASSERT(m_d->prescaledProjection);
853 m_d->prescaledProjection->setImage(image);
854 }
855
857 setLodPreferredInCanvas(m_d->lodPreferredInImage);
858
859 Q_EMIT sigCanvasEngineChanged();
860}
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 774 of file kis_canvas2.cpp.

775{
776 // deinitialize previous canvas structures
777 m_d->prescaledProjection = 0;
778 m_d->frameCache = 0;
779
780 KisConfig cfg(true);
781
782 if (useOpenGL && !KisOpenGL::hasOpenGL()) {
783 warnKrita << "Tried to create OpenGL widget when system doesn't have OpenGL\n";
784 useOpenGL = false;
785 }
786
787 if (useOpenGL) {
789 if (cfg.canvasState() == "OPENGL_FAILED") {
790 // Creating the opengl canvas failed, fall back
791 warnKrita << "OpenGL Canvas initialization returned OPENGL_FAILED. Falling back to QPainter.";
793 }
794 } else {
796 }
797
798 KIS_SAFE_ASSERT_RECOVER_RETURN(m_d->multiSurfaceState);
799 m_d->displayColorConverter.setMultiSurfaceDisplayConfig(m_d->multiSurfaceState->multiConfig);
800
801 if (m_d->popupPalette) {
802 m_d->popupPalette->setParent(m_d->canvasWidget->widget());
803 }
804
805}
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:87

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

◆ createOpenGLCanvas()

void KisCanvas2::createOpenGLCanvas ( )
private

Definition at line 747 of file kis_canvas2.cpp.

748{
749 KisConfig cfg(true);
750 m_d->openGLFilterMode = cfg.openGLFilteringMode();
751 m_d->currentCanvasIsOpenGL = true;
752
753 m_d->multiSurfaceState =
754 m_d->multiSurfaceSetupManager.createInitializingConfig(true, m_d->currentScreenId(), m_d->proofingConfig);
755
756 auto bitDepthMode =
757 cfg.effectiveCanvasSurfaceBitDepthMode(QSurfaceFormat::defaultFormat())
761
763 m_d->coordinatesConverter,
764 0,
765 m_d->view->image(),
766 m_d->multiSurfaceState->multiConfig.canvasDisplayConfig(),
767 m_d->displayColorConverter.displayFilter(),
768 bitDepthMode);
769 m_d->frameCache = KisAnimationFrameCache::getFrameCache(canvasWidget->openGLImageTextures());
770
772}
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 731 of file kis_canvas2.cpp.

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

References canvasWidget, m_d, and setCanvasWidget().

◆ currentImage()

KisImageWSP KisCanvas2::currentImage ( ) const

Definition at line 1426 of file kis_canvas2.cpp.

1427{
1428 return m_d->view->image();
1429}

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:155

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 610 of file kis_canvas2.cpp.

611{
612 return m_d->groupModeShapeWrapper ? m_d->groupModeShapeWrapper->shape() : nullptr;
613}

References m_d.

◆ decoration()

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

Definition at line 1562 of file kis_canvas2.cpp.

1563{
1564 return m_d->canvasWidget->decoration(id);
1565}

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 1318 of file kis_canvas2.cpp.

1319{
1321 m_d->view->disconnect(object);
1322}
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 831 of file kis_canvas2.cpp.

832{
833 KisImageSP image = m_d->view->image();
834
843 disconnect(image.data(), 0, this, 0);
844 image->unlock();
845}
void immediateLockForReadOnly()
Definition kis_image.cc:794

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 925 of file kis_canvas2.cpp.

926{
927 return m_d->displayColorConverter.displayFilter();
928}

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 686 of file kis_canvas2.cpp.

687{
688 return m_d->displayColorConverter.displayRendererInterface();
689}

References m_d.

◆ documentOffset()

QPoint KisCanvas2::documentOffset ( ) const

Definition at line 1579 of file kis_canvas2.cpp.

1580{
1581 return m_d->coordinatesConverter->documentOffset();
1582}

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 1568 of file kis_canvas2.cpp.

1569{
1576 return QPoint();
1577}

◆ 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 955 of file kis_canvas2.cpp.

956{
957 QSharedPointer<KisDisplayFilter> displayFilter = m_d->displayColorConverter.displayFilter();
958
959 return displayFilter ?
960 displayFilter->correctionInterface() :
962}
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 964 of file kis_canvas2.cpp.

965{
967 if (!baseConfig) {
968 baseConfig = KisImageConfig(true).defaultProofingconfiguration();
969 }
970 *m_d->proofingConfig = *baseConfig;
971
973}
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 1050 of file kis_canvas2.cpp.

1051{
1052 m_d->canvasWidget->finishResizingImage(w, h);
1053}

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 691 of file kis_canvas2.cpp.

692{
693 return m_d->view->globalInputManager();
694}

References m_d.

◆ globalShapeManager()

KoShapeManager * KisCanvas2::globalShapeManager ( ) const

Return the shape manager associated with this canvas

Definition at line 605 of file kis_canvas2.cpp.

606{
607 return &m_d->shapeManager;
608}

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 const QPoint intOffset = m_d->view->document()->gridConfig().offset();
533
534 QPointF size = transform.map(QPointF(intSpacing));
535 spacing->rwidth() = size.x();
536 spacing->rheight() = size.y();
537
538 *offset = transform.map(QPointF(intOffset));
539}
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 1420 of file kis_canvas2.cpp.

1421{
1422 return m_d->view->image();
1423
1424}

References m_d.

◆ imageView()

QPointer< KisView > KisCanvas2::imageView ( ) const

Definition at line 1415 of file kis_canvas2.cpp.

1416{
1417 return m_d->view;
1418}

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 807 of file kis_canvas2.cpp.

808{
809 KisImageSP image = m_d->view->image();
810
811 m_d->displayColorConverter.setImageColorSpace(image->colorSpace());
812 m_d->coordinatesConverter->setImage(image);
813 m_d->toolProxy.initializeImage(image);
814
815 connect(image, SIGNAL(sigImageUpdated(QRect)), SLOT(startUpdateCanvasProjection(QRect)), Qt::DirectConnection);
816 connect(image->signalRouter(), SIGNAL(sigNotifyBatchUpdateStarted()), SLOT(slotBeginUpdatesBatch()), Qt::DirectConnection);
817 connect(image->signalRouter(), SIGNAL(sigNotifyBatchUpdateEnded()), SLOT(slotEndUpdatesBatch()), Qt::DirectConnection);
818 connect(image->signalRouter(), SIGNAL(sigRequestLodPlanesSyncBlocked(bool)), SLOT(slotSetLodUpdatesBlocked(bool)), Qt::DirectConnection);
819
820 connect(image, SIGNAL(sigProofingConfigChanged()), SLOT(slotChangeProofingConfig()));
821 connect(image, SIGNAL(sigSizeChanged(QPointF,QPointF)), SLOT(startResizingImage()), Qt::DirectConnection);
822 connect(image->undoAdapter(), SIGNAL(selectionChanged()), SLOT(slotTrySwitchShapeManager()));
823
824 connect(image, SIGNAL(sigColorSpaceChanged(const KoColorSpace*)), SLOT(slotImageColorSpaceChanged()));
825 connect(image, SIGNAL(sigProfileChanged(const KoColorProfile*)), SLOT(slotImageColorSpaceChanged()));
826
829}
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 634 of file kis_canvas2.cpp.

635{
636 KisNodeSP node = m_d->view->currentNode();
637 KoShapeManager *localShapeManager = fetchShapeManagerFromNode(node);
638
644 !m_d->groupModeShapeWrapper ||
646 localShapeManager->shapes().contains(m_d->groupModeShapeWrapper->shape())) {
647
648 m_d->groupModeShapeWrapper = std::nullopt;
649 }
650
651 if (m_d->groupModeShapeWrapper) {
652 auto textShape = dynamic_cast<KoSvgTextShape*>(m_d->groupModeShapeWrapper->shape());
653
654 // we currently support entering text shapes only
655 KIS_SAFE_ASSERT_RECOVER(textShape) {
656 m_d->groupModeShapeWrapper = std::nullopt;
657 }
658
659 if (textShape) {
660 localShapeManager = textShape->internalShapeManager();
661 }
662 }
663
664 if (localShapeManager != m_d->currentlyActiveShapeManager) {
665 m_d->setActiveShapeManager(localShapeManager);
666 }
667
668 return localShapeManager;
669}
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 1678 of file kis_canvas2.cpp.

1679{
1680 return m_d->lodPreferredInImage;
1681}

References m_d.

◆ notifyLevelOfDetailChange()

void KisCanvas2::notifyLevelOfDetailChange ( )
private

Definition at line 1386 of file kis_canvas2.cpp.

1387{
1388 KisImageSP image = this->image();
1389
1390 if (m_d->bootstrapLodBlocked || !m_d->lodIsSupported()) {
1392 } else {
1393 const qreal effectiveZoom = m_d->coordinatesConverter->effectiveZoom();
1394
1395 KisConfig cfg(true);
1396 const int maxLod = cfg.numMipmapLevels();
1397 const int lod = KisLodTransform::scaleToLod(effectiveZoom, maxLod);
1398 KisLodPreferences::PreferenceFlags flags = KisLodPreferences::LodSupported;
1399
1400 if (m_d->lodPreferredInImage) {
1402 }
1404 }
1405}
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 1683 of file kis_canvas2.cpp.

1684{
1685 KisCanvasDecorationSP deco = decoration("paintingAssistantsDecoration");
1686 return qobject_cast<KisPaintingAssistantsDecoration*>(deco.data());
1687}

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 1033 of file kis_canvas2.cpp.

1034{
1035 return m_d->proofingConfig;
1036}

References m_d.

◆ referenceImagesDecoration()

KisReferenceImagesDecorationSP KisCanvas2::referenceImagesDecoration ( ) const

Definition at line 1689 of file kis_canvas2.cpp.

1690{
1691 KisCanvasDecorationSP deco = decoration("referenceImagesDecoration");
1692 return qobject_cast<KisReferenceImagesDecoration*>(deco.data());
1693}

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

◆ refetchDataFromImage()

void KisCanvas2::refetchDataFromImage ( )

Definition at line 1483 of file kis_canvas2.cpp.

1484{
1485 KisImageSP image = this->image();
1486 KisImageReadOnlyBarrierLock l(image);
1488}

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 1164 of file kis_canvas2.cpp.

1165{
1170#if !KRITA_QT_HAS_UPDATE_COMPRESSION_PATCH
1171 m_d->canvasUpdateCompressor.start();
1172#else
1174#endif
1175}
void slotDoCanvasUpdate()

References m_d, and slotDoCanvasUpdate().

◆ resetCanvas()

void KisCanvas2::resetCanvas ( bool useOpenGL)
private

Definition at line 862 of file kis_canvas2.cpp.

863{
864 // we cannot reset the canvas before it's created, but this method might be called,
865 // for instance when setting the monitor profile.
866 if (!m_d->canvasWidget) {
867 return;
868 }
869
870 KisConfig cfg(true);
871
872 const bool canvasHasNativeSurface = bool(m_d->canvasWidget->widget()->windowHandle());
873 const bool canvasNeedsNativeSurface =
874 cfg.enableCanvasSurfaceColorSpaceManagement() &&
876
877 bool needReset = (m_d->currentCanvasIsOpenGL != useOpenGL) ||
878 (m_d->currentCanvasIsOpenGL &&
879 m_d->openGLFilterMode != cfg.openGLFilteringMode()) ||
880 canvasHasNativeSurface != canvasNeedsNativeSurface;
881
882 if (needReset) {
883 createCanvas(useOpenGL);
885 slotEffectiveZoomChanged(m_d->coordinatesConverter->effectiveZoom());
886 }
888}
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 546 of file kis_canvas2.cpp.

547{
548 return m_d->coordinatesConverter->rotationAngle();
549}

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 615 of file kis_canvas2.cpp.

616{
617 if (currentShapeManagerOwnerShape() == source) return;
618
619 m_d->groupModeShapeWrapper = std::nullopt;
620
621 // we currently support entering text shapes only
622 if (source && dynamic_cast<KoSvgTextShape*>(source)) {
623 m_d->groupModeShapeWrapper.emplace(source, [this] () {
625 });
626 }
627
632}
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 1597 of file kis_canvas2.cpp.

1598{
1599 canvasWidget()->setCursor(cursor);
1600}

References canvasWidget.

◆ setDisplayFilter()

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

Definition at line 913 of file kis_canvas2.cpp.

914{
915 m_d->displayColorConverter.setDisplayFilter(displayFilter);
916 KisImageSP image = this->image();
917
918 m_d->view->viewManager()->blockUntilOperationsFinishedForced(image);
919
921 m_d->canvasWidget->setDisplayFilter(displayFilter);
922 image->unlock();
923}

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

◆ setFavoriteResourceManager()

void KisCanvas2::setFavoriteResourceManager ( KisFavoriteResourceManager * favoriteResourceManager)

Definition at line 1584 of file kis_canvas2.cpp.

1585{
1586 m_d->popupPalette = new KisPopupPalette(viewManager(), m_d->coordinatesConverter, favoriteResourceManager, displayColorConverter()->displayRendererInterface(),
1587 m_d->canvasWidget->widget());
1588 connect(m_d->popupPalette, SIGNAL(zoomLevelChanged(int)), this, SLOT(slotPopupPaletteRequestedZoomChange(int)));
1589 connect(m_d->popupPalette, SIGNAL(sigUpdateCanvas()), this, SLOT(updateCanvas()));
1590 connect(m_d->view->mainWindow(), SIGNAL(themeChanged()), m_d->popupPalette, SLOT(slotUpdateIcons()));
1591}
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 1663 of file kis_canvas2.cpp.

1664{
1665 if (!KisOpenGL::supportsLoD()) {
1666 qWarning() << "WARNING: Level of Detail functionality is available only with openGL + GLSL 1.3 support";
1667 }
1668
1669 m_d->lodPreferredInImage =
1670 value && m_d->lodIsSupported();
1671
1673
1674 KisConfig cfg(false);
1675 cfg.setLevelOfDetailEnabled(m_d->lodPreferredInImage);
1676}
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 1023 of file kis_canvas2.cpp.

1024{
1025 m_d->proofingConfigUpdated = updated;
1026}

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 1365 of file kis_canvas2.cpp.

1366{
1367 m_d->renderingLimit = rc;
1368}

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 1624 of file kis_canvas2.cpp.

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

References INFINITY_DECORATION_ID, m_d, and value().

◆ setWrapAroundViewingModeAxis()

void KisCanvas2::setWrapAroundViewingModeAxis ( WrapAroundAxis value)

Definition at line 1641 of file kis_canvas2.cpp.

1642{
1643 m_d->canvasWidget->setWrapAroundViewingModeAxis(value);
1644 updateCanvas();
1645}

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 1135 of file kis_canvas2.cpp.

1136{
1137 KisUpdateInfoSP info =
1139 m_d->coordinatesConverter->imageRectInImagePixels());
1140 m_d->projectionUpdatesCompressor.putUpdateInfo(info);
1141 Q_EMIT sigCanvasCacheUpdated();
1142}

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

◆ slotCanvasStateChanged

void KisCanvas2::slotCanvasStateChanged ( )
privateslot

Definition at line 1431 of file kis_canvas2.cpp.

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

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

◆ slotChangeGlobalProofingConfig

void KisCanvas2::slotChangeGlobalProofingConfig ( )
slot

Definition at line 1006 of file kis_canvas2.cpp.

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

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

◆ slotChangeProofingConfig

void KisCanvas2::slotChangeProofingConfig ( )
slot

Definition at line 1015 of file kis_canvas2.cpp.

1016{
1018 if (imageView()->softProofing()) {
1020 }
1021}
void refetchDataFromImage()

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

◆ slotConfigChanged

void KisCanvas2::slotConfigChanged ( )
slot

Called whenever the configuration settings change.

Definition at line 1445 of file kis_canvas2.cpp.

1446{
1447 KisConfig cfg(true);
1448 m_d->regionOfInterestMargin = KisImageConfig(true).animationCacheRegionOfInterestMargin();
1449
1450 resetCanvas(cfg.useOpenGL());
1451
1452 QWidget *mainWindow = m_d->view->mainWindow();
1454
1455 QWidget *topLevelWidget = mainWindow->topLevelWidget();
1456 KIS_SAFE_ASSERT_RECOVER_RETURN(topLevelWidget);
1457
1458 KIS_SAFE_ASSERT_RECOVER_RETURN(m_d->multiSurfaceState);
1459 auto newState = m_d->multiSurfaceSetupManager.onConfigChanged(*m_d->multiSurfaceState,
1460 m_d->currentScreenId(),
1461 cfg.canvasSurfaceColorSpaceManagementMode(),
1463 m_d->assignChangedMultiSurfaceState(newState);
1464
1466}
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 1177 of file kis_canvas2.cpp.

1178{
1179
1180#if !KRITA_QT_HAS_UPDATE_COMPRESSION_PATCH
1186 if (m_d->canvasWidget->isBusy()) {
1187 // just restarting the timer
1188 m_d->canvasUpdateCompressor.start();
1189 return;
1190 }
1191#endif
1192
1193 QRect combinedUpdateRect = m_d->savedCanvasProjectionUpdateRect | m_d->savedOverlayUpdateRect;
1194 if (!combinedUpdateRect.isEmpty()) {
1195 // TODO: Remove this signal (only used by the old KisSketchView)
1196 Q_EMIT updateCanvasRequested(combinedUpdateRect);
1197
1198 if (wrapAroundViewingMode() && !m_d->savedCanvasProjectionUpdateRect.isEmpty()) {
1199 const QRect widgetRect = m_d->canvasWidget->widget()->rect();
1200 const QRect imageRect = m_d->coordinatesConverter->imageRectInImagePixels();
1201
1202 const QRect widgetRectInImagePixels =
1203 m_d->coordinatesConverter->widgetToImage(widgetRect).toAlignedRect();
1204
1205 const QRect rc = m_d->coordinatesConverter->widgetToImage(m_d->savedCanvasProjectionUpdateRect).toAlignedRect();
1206
1207 const QVector<QRect> updateRects =
1208 KisWrappedRect::multiplyWrappedRect(rc, imageRect, widgetRectInImagePixels, wrapAroundViewingModeAxis());
1209
1210 Q_FOREACH(const QRect &rc, updateRects) {
1211 const QRect widgetUpdateRect =
1212 m_d->coordinatesConverter->imageToWidget(rc).toAlignedRect() & widgetRect;
1213 m_d->canvasWidget->updateCanvasImage(widgetUpdateRect);
1214 }
1215 m_d->canvasWidget->updateCanvasDecorations(m_d->savedOverlayUpdateRect);
1216 } else {
1217 m_d->canvasWidget->updateCanvasImage(m_d->savedCanvasProjectionUpdateRect);
1218 m_d->canvasWidget->updateCanvasDecorations(m_d->savedOverlayUpdateRect);
1219 }
1220 } else if (m_d->updateSceneRequested) {
1221 m_d->canvasWidget->widget()->update();
1222 }
1223
1224 m_d->savedCanvasProjectionUpdateRect = QRect();
1225 m_d->savedOverlayUpdateRect = QRect();
1226 m_d->updateSceneRequested = false;
1227}
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 1324 of file kis_canvas2.cpp.

1325{
1326 Q_UNUSED(newZoom)
1327
1328
1329
1331}

References notifyLevelOfDetailChange().

◆ slotEndUpdatesBatch

void KisCanvas2::slotEndUpdatesBatch ( )
privateslot

Definition at line 1144 of file kis_canvas2.cpp.

1145{
1146 KisUpdateInfoSP info =
1148 m_d->coordinatesConverter->imageRectInImagePixels());
1149 m_d->projectionUpdatesCompressor.putUpdateInfo(info);
1150 Q_EMIT sigCanvasCacheUpdated();
1151}

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

◆ slotGamutCheck

void KisCanvas2::slotGamutCheck ( )
slot

Definition at line 998 of file kis_canvas2.cpp.

999{
1001 if (imageView()->softProofing()) {
1003 }
1004}

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

◆ slotImageColorSpaceChanged

void KisCanvas2::slotImageColorSpaceChanged ( )
privateslot

Definition at line 930 of file kis_canvas2.cpp.

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

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 1593 of file kis_canvas2.cpp.

1593 {
1594 m_d->view->canvasController()->setZoom(KoZoomMode::ZOOM_CONSTANT, (qreal)(zoom/100.0)); // 1.0 is 100% zoom
1595}
@ 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 1468 of file kis_canvas2.cpp.

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

References KIS_SAFE_ASSERT_RECOVER_RETURN, m_d, and warnUI.

◆ slotSelectionChanged

void KisCanvas2::slotSelectionChanged ( )
privateslot

Definition at line 1612 of file kis_canvas2.cpp.

1613{
1614 KisShapeLayer* shapeLayer = dynamic_cast<KisShapeLayer*>(viewManager()->activeLayer().data());
1615 if (!shapeLayer) {
1616 return;
1617 }
1618 m_d->shapeManager.selection()->deselectAll();
1619 Q_FOREACH (KoShape* shape, shapeLayer->shapeManager()->selection()->selectedShapes()) {
1620 m_d->shapeManager.selection()->select(shape);
1621 }
1622}
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 1153 of file kis_canvas2.cpp.

1154{
1155 KisUpdateInfoSP info =
1158 KisMarkerUpdateInfo::UnblockLodUpdates,
1159 m_d->coordinatesConverter->imageRectInImagePixels());
1160 m_d->projectionUpdatesCompressor.putUpdateInfo(info);
1161 Q_EMIT sigCanvasCacheUpdated();
1162}

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

◆ slotSoftProofing

void KisCanvas2::slotSoftProofing ( )
slot

Definition at line 992 of file kis_canvas2.cpp.

993{
996}

References refetchDataFromImage(), and updateProofingState().

◆ slotSurfaceFormatChanged()

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

Definition at line 1528 of file kis_canvas2.cpp.

1529{
1530#if KRITA_USE_SURFACE_COLOR_MANAGEMENT_API
1531
1532 KIS_SAFE_ASSERT_RECOVER_RETURN(m_d->multiSurfaceState);
1533 if (m_d->multiSurfaceState->multiConfig.canvasDisplayConfig() == config) return;
1534
1535 if (m_d->multiSurfaceState->isCanvasOpenGL) {
1536 if (config.isHDR &&
1537 m_d->canvasWidget->currentBitDepthMode() < KisOpenGLCanvas2::BitDepthMode::Depth10Bit) {
1538
1539 const QString warningMessage = i18n(
1540 "WARNING: HDR mode was activated on surface working in 8-bit mode!\n"
1541 "Please activate 10-bit mode in Krita's Preferences dialog and restart "
1542 "Krita to avoid color banding!");
1543
1544 m_d->view->showFloatingMessage(warningMessage, koIcon("warning"), 7000, KisFloatingMessage::High);
1545 warnOpenGL.noquote() << QString(warningMessage).replace('\n', ' ');
1546 warnOpenGL << ppVar(QSurfaceFormat::defaultFormat());
1547 }
1548 }
1549
1550 auto newState = m_d->multiSurfaceSetupManager.onCanvasSurfaceFormatChanged(*m_d->multiSurfaceState, config);
1551 m_d->assignChangedMultiSurfaceStateSkipCanvasSurface(newState);
1552#else
1553 Q_UNUSED(config);
1554#endif
1555}
#define warnOpenGL
Definition kis_debug.h:102
#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 1380 of file kis_canvas2.cpp.

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

References localShapeManager().

◆ slotUpdateReferencesBounds

void KisCanvas2::slotUpdateReferencesBounds ( )
privateslot

Definition at line 1354 of file kis_canvas2.cpp.

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

References KisReferenceImagesLayer::boundingImageRect(), and m_d.

◆ slotUpdateRegionOfInterest

void KisCanvas2::slotUpdateRegionOfInterest ( )
privateslot

Definition at line 1338 of file kis_canvas2.cpp.

1339{
1340 const QRect oldRegionOfInterest = m_d->regionOfInterest;
1341
1342 const qreal ratio = m_d->regionOfInterestMargin;
1343 const QRect proposedRoi = KisAlgebra2D::blowRect(m_d->coordinatesConverter->widgetRectInImagePixels(), ratio).toAlignedRect();
1344
1345 const QRect imageRect = m_d->coordinatesConverter->imageRectInImagePixels();
1346
1347 m_d->regionOfInterest = proposedRoi & imageRect;
1348
1349 if (m_d->regionOfInterest != oldRegionOfInterest) {
1350 Q_EMIT sigRegionOfInterestChanged(m_d->regionOfInterest);
1351 }
1352}
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 541 of file kis_canvas2.cpp.

542{
543 return m_d->view->document()->gridConfig().snapToGrid();
544}

References m_d.

◆ startResizingImage

void KisCanvas2::startResizingImage ( )
slot

Definition at line 1038 of file kis_canvas2.cpp.

1039{
1040 KisImageWSP image = this->image();
1041 qint32 w = image->width();
1042 qint32 h = image->height();
1043
1044 Q_EMIT sigContinueResizeImage(w, h);
1045
1046 QRect imageBounds(0, 0, w, h);
1047 startUpdateInPatches(imageBounds);
1048}
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 1055 of file kis_canvas2.cpp.

1056{
1057 KisUpdateInfoSP info = m_d->canvasWidget->startUpdateCanvasProjection(rc);
1058 if (m_d->projectionUpdatesCompressor.putUpdateInfo(info)) {
1059 Q_EMIT sigCanvasCacheUpdated();
1060 }
1061}

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 890 of file kis_canvas2.cpp.

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

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 707 of file kis_canvas2.cpp.

708{
710
711 KisImageWSP image = m_d->view->image();
712 if (image) {
713 if (!qFuzzyCompare(image->xRes(), image->yRes())) {
714 warnKrita << "WARNING: resolution of the image is anisotropic"
715 << ppVar(image->xRes())
716 << ppVar(image->yRes());
717 }
718
719 const qreal resolution = image->xRes();
720 unit.setFactor(resolution);
721 }
722
723 return unit;
724}
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 1245 of file kis_canvas2.cpp.

1246{
1248}

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 1257 of file kis_canvas2.cpp.

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

References m_d, and updateCanvasWidgetImpl().

◆ updateCanvasDecorations [1/2]

void KisCanvas2::updateCanvasDecorations ( )
slot

Definition at line 1276 of file kis_canvas2.cpp.

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

References m_d, and requestCanvasUpdateMaybeCompressed().

◆ updateCanvasDecorations [2/2]

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

Definition at line 1282 of file kis_canvas2.cpp.

1283{
1284 QRect widgetRect = m_d->docUpdateRectToWidget(docRect);
1285 if (!widgetRect.isEmpty()) {
1286 m_d->savedOverlayUpdateRect |= widgetRect;
1288 }
1289}

References m_d, and requestCanvasUpdateMaybeCompressed().

◆ updateCanvasProjection [1/2]

void KisCanvas2::updateCanvasProjection ( )
privateslot

Definition at line 1063 of file kis_canvas2.cpp.

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

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 1267 of file kis_canvas2.cpp.

1268{
1269 QRect widgetRect = m_d->docUpdateRectToWidget(docRect);
1270 if (!widgetRect.isEmpty()) {
1271 m_d->savedCanvasProjectionUpdateRect |= widgetRect;
1273 }
1274}

References m_d, and requestCanvasUpdateMaybeCompressed().

◆ updateCanvasRequested

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

◆ updateCanvasScene

void KisCanvas2::updateCanvasScene ( )
slot

Definition at line 1312 of file kis_canvas2.cpp.

1313{
1314 m_d->updateSceneRequested = true;
1316}

References m_d, and requestCanvasUpdateMaybeCompressed().

◆ updateCanvasToolOutlineDoc

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

Definition at line 1291 of file kis_canvas2.cpp.

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

References m_d, and updateCanvasToolOutlineWdg().

◆ updateCanvasToolOutlineWdg

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

Definition at line 1299 of file kis_canvas2.cpp.

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

References m_d, and slotDoCanvasUpdate().

◆ updateCanvasWidgetImpl()

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

Definition at line 1229 of file kis_canvas2.cpp.

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

References m_d, and requestCanvasUpdateMaybeCompressed().

◆ updateProofingState()

void KisCanvas2::updateProofingState ( )

Definition at line 975 of file kis_canvas2.cpp.

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

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 676 of file kis_canvas2.cpp.

677{
678 return m_d->coordinatesConverter;
679}

References m_d.

◆ viewConverter() [2/2]

KoViewConverter * KisCanvas2::viewConverter ( )
overridevirtual

Implements KoCanvasBase.

Definition at line 681 of file kis_canvas2.cpp.

682{
683 return m_d->coordinatesConverter;
684}

References m_d.

◆ viewManager()

KisViewManager * KisCanvas2::viewManager ( ) const

Definition at line 1407 of file kis_canvas2.cpp.

1408{
1409 if (m_d->view) {
1410 return m_d->view->viewManager();
1411 }
1412 return 0;
1413}

References m_d.

◆ wrapAroundViewingMode()

bool KisCanvas2::wrapAroundViewingMode ( ) const

Definition at line 1636 of file kis_canvas2.cpp.

1637{
1638 return m_d->canvasWidget->wrapAroundViewingMode();
1639}

References m_d.

◆ wrapAroundViewingModeAxis()

WrapAroundAxis KisCanvas2::wrapAroundViewingModeAxis ( ) const

Definition at line 1647 of file kis_canvas2.cpp.

1648{
1649 return m_d->canvasWidget->wrapAroundViewingModeAxis();
1650}

References m_d.

◆ xAxisMirrored

bool KisCanvas2::xAxisMirrored ( ) const
slot

Bools indicating canvasmirroring.

Definition at line 551 of file kis_canvas2.cpp.

552{
553 return m_d->coordinatesConverter->xAxisMirrored();
554}

References m_d.

◆ yAxisMirrored

bool KisCanvas2::yAxisMirrored ( ) const
slot

Definition at line 556 of file kis_canvas2.cpp.

557{
558 return m_d->coordinatesConverter->yAxisMirrored();
559}

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: