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

#include <kis_opengl_canvas2.h>

+ Inheritance diagram for KisOpenGLCanvas2:

Classes

class  CanvasBridge
 
struct  Private
 

Public Slots

void slotConfigChanged ()
 
void slotPixelGridModeChanged ()
 
void slotUpdateCursorColor ()
 

Public Member Functions

void channelSelectionChanged (const QBitArray &channelFlags) override
 
BitDepthMode currentBitDepthMode () const override
 
QString currentBitDepthUserReport () const override
 
void finishResizingImage (qint32 w, qint32 h) override
 
void focusInEvent (QFocusEvent *event) override
 
void focusOutEvent (QFocusEvent *event) override
 
void hideEvent (QHideEvent *event) override
 
void initializeGL () override
 
void inputMethodEvent (QInputMethodEvent *event) override
 
QVariant inputMethodQuery (Qt::InputMethodQuery query) const override
 
bool isBusy () const override
 
 KisOpenGLCanvas2 (KisCanvas2 *canvas, KisCoordinatesConverter *coordinatesConverter, QWidget *parent, KisImageWSP image, const KisDisplayConfig &displayConfig, QSharedPointer< KisDisplayFilter > displayFilter, BitDepthMode bitDepthRequest)
 
void notifyImageColorSpaceChanged (const KoColorSpace *cs) override
 set/update the color space of the attached image
 
KisOpenGLImageTexturesSP openGLImageTextures () const
 
void paintEvent (QPaintEvent *e) override
 
void paintGL () override
 
void paintToolOutline (const KisOptimizedBrushOutline &path, int thickness=1)
 
void resizeGL (int width, int height) override
 
void setDisplayConfig (const KisDisplayConfig &config) override
 
void setDisplayFilter (QSharedPointer< KisDisplayFilter > displayFilter) override
 set the specified display filter on the canvas
 
void setLodResetInProgress (bool value) override
 
void setWrapAroundViewingMode (bool value) override
 
void setWrapAroundViewingModeAxis (WrapAroundAxis value) override
 
void showEvent (QShowEvent *event) override
 
KisUpdateInfoSP startUpdateCanvasProjection (const QRect &rc) override
 
void updateCanvasDecorations (const QRect &decoUpdateRect) override
 
void updateCanvasImage (const QRect &imageUpdateRect) override
 
QVector< QRect > updateCanvasProjection (const QVector< KisUpdateInfoSP > &infoObjects) override
 
QRect updateCanvasProjection (KisUpdateInfoSP info) override
 
QWidget * widget () override
 
bool wrapAroundViewingMode () const override
 
WrapAroundAxis wrapAroundViewingModeAxis () const override
 
 ~KisOpenGLCanvas2 () override
 
- Public Member Functions inherited from KisCanvasWidgetBase
void addDecoration (KisCanvasDecorationSP deco) override
 
QColor borderColor () const
 
KisCoordinatesConvertercoordinatesConverter () const
 
KisCanvasDecorationSP decoration (const QString &id) const override
 
QList< KisCanvasDecorationSPdecorations () const override
 
void drawDecorations (QPainter &gc, const QRect &updateWidgetRect) const override
 
 KisCanvasWidgetBase (KisCanvas2 *canvas, KisCoordinatesConverter *coordinatesConverter)
 
void notifyDecorationsWindowMinimized (bool minimized)
 
void removeDecoration (const QString &id) override
 
void setDecorations (const QList< KisCanvasDecorationSP > &) override
 
KoToolProxytoolProxy () const override
 
 ~KisCanvasWidgetBase () override
 
- Public Member Functions inherited from KisAbstractCanvasWidget
 KisAbstractCanvasWidget ()
 
virtual ~KisAbstractCanvasWidget ()
 

Protected Member Functions

bool callFocusNextPrevChild (bool next) override
 To be implemented by the derived canvas.
 
- Protected Member Functions inherited from KisCanvasWidgetBase
KisCanvas2canvas () const
 
void notifyConfigChanged ()
 
void processFocusInEvent (QFocusEvent *event)
 
void processFocusOutEvent (QFocusEvent *event)
 
void processInputMethodEvent (QInputMethodEvent *event)
 
QVariant processInputMethodQuery (Qt::InputMethodQuery query) const
 

Private Slots

void slotShowFloatingMessage (const QString &message, int timeout, bool priority)
 

Private Attributes

Private *const d
 

Additional Inherited Members

- Public Types inherited from KisAbstractCanvasWidget
enum class  BitDepthMode { Depth8Bit = 0 , Depth10Bit }
 
- Static Public Member Functions inherited from KisCanvasWidgetBase
static QImage createCheckersImage (qint32 checkSize=-1)
 

Detailed Description

KisOpenGLCanvas is the widget that shows the actual image using OpenGL

NOTE: if you change something in the event handling here, also change it in the qpainter canvas.

Definition at line 30 of file kis_opengl_canvas2.h.

Constructor & Destructor Documentation

◆ KisOpenGLCanvas2()

KisOpenGLCanvas2::KisOpenGLCanvas2 ( KisCanvas2 * canvas,
KisCoordinatesConverter * coordinatesConverter,
QWidget * parent,
KisImageWSP image,
const KisDisplayConfig & displayConfig,
QSharedPointer< KisDisplayFilter > displayFilter,
BitDepthMode bitDepthRequest )

When in pure OpenGL mode, the canvas surface will have alpha channel. Therefore, if our canvas blending algorithm produces semi-transparent pixels (and it does), then Krita window itself will become transparent. Which is not good.

In Angle mode, GL_RGB8 is not available (and the transparence effect doesn't exist at all).

Definition at line 81 of file kis_opengl_canvas2.cpp.

88 : QOpenGLWidget(parent)
90 , d(new Private())
91{
92 setProperty("krita_skip_srgb_surface_manager_assignment", true);
93
94 KisConfig cfg(false);
95 cfg.setCanvasState("OPENGL_STARTED");
96
97 d->renderer = new KisOpenGLCanvasRenderer(new CanvasBridge(this), image, displayConfig, displayFilter);
98
100 SIGNAL(sigShowFloatingMessage(QString, int, bool)),
101 SLOT(slotShowFloatingMessage(QString, int, bool)));
102
103 setAcceptDrops(true);
104 setAutoFillBackground(false);
105
106 setFocusPolicy(Qt::StrongFocus);
107 setAttribute(Qt::WA_NoSystemBackground, true);
108#ifdef Q_OS_MACOS
109 setAttribute(Qt::WA_AcceptTouchEvents, false);
110#else
111 setAttribute(Qt::WA_AcceptTouchEvents, true);
112#endif
113 setAttribute(Qt::WA_InputMethodEnabled, true);
114 setAttribute(Qt::WA_DontCreateNativeAncestors, true);
115
116 const bool osManagedSurfacePresent = KisPlatformPluginInterfaceFactory::instance()->surfaceColorManagedByOS();
117 bool useNativeSurfaceForCanvas = osManagedSurfacePresent && cfg.enableCanvasSurfaceColorSpaceManagement();
118 if (qEnvironmentVariableIsSet("KRITA_USE_NATIVE_CANVAS_SURFACE")) {
119 useNativeSurfaceForCanvas = qEnvironmentVariableIntValue("KRITA_USE_NATIVE_CANVAS_SURFACE");
120 qDebug() << "FPS-DEBUG: Krita canvas mode is overridden:" << (useNativeSurfaceForCanvas ? "native surface" : "legacy mode") << useNativeSurfaceForCanvas << qEnvironmentVariableIsSet("KRITA_USE_NATIVE_CANVAS_SURFACE");
121 }
122
123 if (useNativeSurfaceForCanvas) {
124 setAttribute(Qt::WA_NativeWindow, true);
125 }
126
127 setUpdateBehavior(PartialUpdate);
128
129 // we should make sure the texture doesn't have alpha channel,
130 // otherwise blending will not work correctly.
131 if (KisOpenGLModeProber::instance()->useHDRMode()) {
132 setTextureFormat(GL_RGBA16F);
133 } else {
134 if (bitDepthRequest == BitDepthMode::Depth10Bit) {
135 if (QSurfaceFormat::defaultFormat().redBufferSize() < 10) {
136 warnOpenGL <<
137 "WARNING: KisOpenGLCanvas2 was created with a 10-bit surface, "
138 "while the global surface format is still set to 8-bit. Expect "
139 "color banding to appear";
140 }
141 setTextureFormat(GL_RGB10_A2);
142 } else {
152 if (!KisOpenGL::hasOpenGLES()) {
153 setTextureFormat(GL_RGB8);
154 }
155 }
156 }
157
158 connect(KisConfigNotifier::instance(), SIGNAL(configChanged()), SLOT(slotConfigChanged()));
159 connect(KisConfigNotifier::instance(), SIGNAL(pixelGridModeChanged()), SLOT(slotPixelGridModeChanged()));
160
161 connect(canvas->viewManager()->canvasResourceProvider(), SIGNAL(sigEffectiveCompositeOpChanged()), SLOT(slotUpdateCursorColor()));
162 connect(canvas->viewManager()->canvasResourceProvider(), SIGNAL(sigPaintOpPresetChanged(KisPaintOpPresetSP)), SLOT(slotUpdateCursorColor()));
163
166 cfg.writeEntry("canvasState", "OPENGL_SUCCESS");
167}
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
KisViewManager * viewManager() const
KisCoordinatesConverter * coordinatesConverter() const
KisCanvasWidgetBase(KisCanvas2 *canvas, KisCoordinatesConverter *coordinatesConverter)
KisCanvas2 * canvas() const
static KisConfigNotifier * instance()
void slotShowFloatingMessage(const QString &message, int timeout, bool priority)
KisOpenGLImageTexturesSP openGLImageTextures() const
static KisOpenGLModeProber * instance()
static bool hasOpenGLES()
static KisPlatformPluginInterfaceFactory * instance()
KisCanvasResourceProvider * canvasResourceProvider()
#define warnOpenGL
Definition kis_debug.h:102
KisOpenGLCanvasRenderer * renderer

References KisCanvasWidgetBase::canvas(), KisViewManager::canvasResourceProvider(), connect(), d, KisSharedPtr< T >::data(), KisAbstractCanvasWidget::Depth10Bit, KisConfig::enableCanvasSurfaceColorSpaceManagement(), KisOpenGL::hasOpenGLES(), KisConfigNotifier::instance(), KisPlatformPluginInterfaceFactory::instance(), KisOpenGLModeProber::instance(), KisOpenGLCanvasRenderer::openGLImageTextures(), KisOpenGLCanvas2::Private::renderer, KisConfig::setCanvasState(), slotConfigChanged(), slotPixelGridModeChanged(), slotShowFloatingMessage(), slotUpdateCursorColor(), KisPlatformPluginInterfaceFactory::surfaceColorManagedByOS(), KisCanvas2::viewManager(), warnOpenGL, and KisConfig::writeEntry().

◆ ~KisOpenGLCanvas2()

KisOpenGLCanvas2::~KisOpenGLCanvas2 ( )
override

Since we delete openGL resources, we should make sure the context is initialized properly before they are deleted. Otherwise resources from some other (current) context may be deleted due to resource id aliasing.

The main symptom of resources being deleted from wrong context, the canvas being locked/backened-out after some other document is closed.

Definition at line 169 of file kis_opengl_canvas2.cpp.

170{
182 makeCurrent();
183
184 delete d;
185
186 doneCurrent();
187}

References d.

Member Function Documentation

◆ callFocusNextPrevChild()

bool KisOpenGLCanvas2::callFocusNextPrevChild ( bool next)
overrideprotectedvirtual

To be implemented by the derived canvas.

Implements KisCanvasWidgetBase.

Definition at line 458 of file kis_opengl_canvas2.cpp.

459{
460 return focusNextPrevChild(next);
461}

◆ channelSelectionChanged()

void KisOpenGLCanvas2::channelSelectionChanged ( const QBitArray & channelFlags)
overridevirtual

Implements KisAbstractCanvasWidget.

Definition at line 419 of file kis_opengl_canvas2.cpp.

420{
421 d->renderer->channelSelectionChanged(channelFlags);
422}
void channelSelectionChanged(const QBitArray &channelFlags)

References KisOpenGLCanvasRenderer::channelSelectionChanged(), d, and KisOpenGLCanvas2::Private::renderer.

◆ currentBitDepthMode()

KisOpenGLCanvas2::BitDepthMode KisOpenGLCanvas2::currentBitDepthMode ( ) const
overridevirtual

Reimplemented from KisCanvasWidgetBase.

Definition at line 468 of file kis_opengl_canvas2.cpp.

469{
470 return
471 textureFormat() == GL_RGB10_A2 &&
472 format().redBufferSize() == 10 &&
473 format().greenBufferSize() == 10 &&
474 format().blueBufferSize() == 10 ?
477}

References KisAbstractCanvasWidget::Depth10Bit, and KisAbstractCanvasWidget::Depth8Bit.

◆ currentBitDepthUserReport()

QString KisOpenGLCanvas2::currentBitDepthUserReport ( ) const
overridevirtual

Reimplemented from KisCanvasWidgetBase.

Definition at line 479 of file kis_opengl_canvas2.cpp.

479 {
480 QString report;
481 QDebug str(&report);
482
483 str << "Texture Format: " << Qt::hex << Qt::showbase << textureFormat() << Qt::reset;
484
485 switch (textureFormat()) {
486 case GL_RGB10_A2:
487 str << " (" << "GL_RGB10_A2" << ")";
488 break;
489// not available in openGLES
490#ifdef GL_RGB10
491 case GL_RGB10:
492 str << " (" << "GL_RGB10" << ")";
493 break;
494#endif /* GL_RGB10 */
495// not available in openGLES
496#ifdef GL_RGB12
497 case GL_RGB12:
498 str << " (" << "GL_RGB12" << ")";
499 break;
500#endif /* GL_RGB12 */
501// not available in openGLES
502#ifdef GL_RGBA16
503 case GL_RGBA16:
504 str << " (" << "GL_RGBA16" << ")";
505 break;
506#endif /* GL_RGBA16 */
507// not available in openGLES
508#ifdef GL_RGB16
509 case GL_RGB16:
510 str << " (" << "GL_RGB16" << ")";
511 break;
512#endif /* GL_RGB16 */
513 case GL_RGBA16F:
514 str << " (" << "GL_RGBA16F" << ")";
515 break;
516 case GL_RGB8:
517 str << " (" << "GL_RGB8" << ")";
518 break;
519 case GL_RGBA8:
520 str << " (" << "GL_RGBA8" << ")";
521 break;
522 default:
523 str << " (" << "<unknown>" << ")";
524 break;
525 }
526 str << Qt::endl;
527
528 str << "FBO Buffer Size: "
529 << "R: " << format().redBufferSize() << " "
530 << "G: " << format().greenBufferSize() << " "
531 << "B: " << format().blueBufferSize() << " "
532 << "A: " << format().alphaBufferSize() << Qt::endl;
533
534 QWindow *win = windowHandle();
535 if (win) {
536 str << "Window Buffer Size: "
537 << "R: " << win->format().redBufferSize() << " "
538 << "G: " << win->format().greenBufferSize() << " "
539 << "B: " << win->format().blueBufferSize() << " "
540 << "A: " << win->format().alphaBufferSize() << Qt::endl;
541 }
542
543 if (win) {
544 str << "Global Buffer Size: "
545 << "R: " << QSurfaceFormat::defaultFormat().redBufferSize() << " "
546 << "G: " << QSurfaceFormat::defaultFormat().greenBufferSize() << " "
547 << "B: " << QSurfaceFormat::defaultFormat().blueBufferSize() << " "
548 << "A: " << QSurfaceFormat::defaultFormat().alphaBufferSize() << Qt::endl;
549 }
550
551 return report;
552}

◆ finishResizingImage()

void KisOpenGLCanvas2::finishResizingImage ( qint32 w,
qint32 h )
overridevirtual

Implements KisAbstractCanvasWidget.

Definition at line 425 of file kis_opengl_canvas2.cpp.

426{
427 KisOpenGLContextSwitchLockSkipOnQt5 contextLock(this);
429}
void finishResizingImage(qint32 w, qint32 h)

References d, KisOpenGLCanvasRenderer::finishResizingImage(), and KisOpenGLCanvas2::Private::renderer.

◆ focusInEvent()

void KisOpenGLCanvas2::focusInEvent ( QFocusEvent * event)
override

Definition at line 391 of file kis_opengl_canvas2.cpp.

392{
393 processFocusInEvent(event);
394}
void processFocusInEvent(QFocusEvent *event)

References KisCanvasWidgetBase::processFocusInEvent().

◆ focusOutEvent()

void KisOpenGLCanvas2::focusOutEvent ( QFocusEvent * event)
override

Definition at line 396 of file kis_opengl_canvas2.cpp.

397{
399}
void processFocusOutEvent(QFocusEvent *event)

References KisCanvasWidgetBase::processFocusOutEvent().

◆ hideEvent()

void KisOpenGLCanvas2::hideEvent ( QHideEvent * event)
override

Definition at line 401 of file kis_opengl_canvas2.cpp.

402{
403 QOpenGLWidget::hideEvent(e);
405}
void notifyDecorationsWindowMinimized(bool minimized)

References KisCanvasWidgetBase::notifyDecorationsWindowMinimized().

◆ initializeGL()

void KisOpenGLCanvas2::initializeGL ( )
override

◆ inputMethodEvent()

void KisOpenGLCanvas2::inputMethodEvent ( QInputMethodEvent * event)
override

Definition at line 386 of file kis_opengl_canvas2.cpp.

387{
389}
void processInputMethodEvent(QInputMethodEvent *event)

References KisCanvasWidgetBase::processInputMethodEvent().

◆ inputMethodQuery()

QVariant KisOpenGLCanvas2::inputMethodQuery ( Qt::InputMethodQuery query) const
override

Definition at line 381 of file kis_opengl_canvas2.cpp.

382{
383 return processInputMethodQuery(query);
384}
QVariant processInputMethodQuery(Qt::InputMethodQuery query) const

References KisCanvasWidgetBase::processInputMethodQuery().

◆ isBusy()

bool KisOpenGLCanvas2::isBusy ( ) const
overridevirtual

Returns true if the asynchronous engine of the canvas (e.g. openGL pipeline) is busy with processing of the previous update events. This will make KisCanvas2 to postpone and compress update events.

Implements KisAbstractCanvasWidget.

Definition at line 345 of file kis_opengl_canvas2.cpp.

346{
347 const bool isBusyStatus = d->glSyncObject && !d->glSyncObject->isSignaled();
349 return isBusyStatus;
350}
static KisOpenglCanvasDebugger * instance()
QScopedPointer< KisOpenGLSync > glSyncObject

References d, KisOpenGLCanvas2::Private::glSyncObject, KisOpenglCanvasDebugger::instance(), and KisOpenglCanvasDebugger::notifySyncStatus().

◆ notifyImageColorSpaceChanged()

void KisOpenGLCanvas2::notifyImageColorSpaceChanged ( const KoColorSpace * cs)
overridevirtual

set/update the color space of the attached image

Implements KisAbstractCanvasWidget.

Definition at line 195 of file kis_opengl_canvas2.cpp.

196{
197 KisOpenGLContextSwitchLockSkipOnQt5 contextLock(this);
199}
void notifyImageColorSpaceChanged(const KoColorSpace *cs)

References d, KisOpenGLCanvasRenderer::notifyImageColorSpaceChanged(), and KisOpenGLCanvas2::Private::renderer.

◆ openGLImageTextures()

KisOpenGLImageTexturesSP KisOpenGLCanvas2::openGLImageTextures ( ) const

◆ paintEvent()

void KisOpenGLCanvas2::paintEvent ( QPaintEvent * e)
override

Enable partial updates only for the case when we have integer scaling. There is a bug in Qt that causes artifacts otherwise:

See https://bugs.kde.org/show_bug.cgi?id=441216

Definition at line 285 of file kis_opengl_canvas2.cpp.

286{
288
289 if (qFuzzyCompare(devicePixelRatioF(), qRound(devicePixelRatioF()))) {
297 d->updateRect = e->rect();
298 } else {
299 d->updateRect = this->rect();
300 }
301
302#if KRITA_QT_HAS_UPDATE_COMPRESSION_PATCH
308 if (isBusy()) {
309 //qWarning() << "WARNING: paint event delivered with the canvas non-ready, rescheduling...";
310 d->shouldSkipRenderingPass = true;
311 QOpenGLWidget::paintEvent(e);
312 d->shouldSkipRenderingPass = false;
313 QTimer::singleShot(0, this,
314 [this, updateRect = *d->updateRect] () {
315 if (updateRect.isEmpty()) {
316 this->update();
317 } else {
318 this->update(updateRect);
319 }
320 });
321 } else
322#endif
323 {
324 QOpenGLWidget::paintEvent(e);
325 }
326
327 d->updateRect = boost::none;
328}
bool isBusy() const override
static bool qFuzzyCompare(half p1, half p2)
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
Definition kis_assert.h:128
boost::optional< QRect > updateRect

References d, isBusy(), KIS_SAFE_ASSERT_RECOVER_RETURN, qFuzzyCompare(), and KisOpenGLCanvas2::Private::updateRect.

◆ paintGL()

void KisOpenGLCanvas2::paintGL ( )
override

Definition at line 235 of file kis_opengl_canvas2.cpp.

236{
237#if KRITA_QT_HAS_UPDATE_COMPRESSION_PATCH
238 if (d->shouldSkipRenderingPass) {
239 return;
240 }
241#endif
242
243 const QRect updateRect = d->updateRect ? *d->updateRect : QRect();
244
245 if (!OPENGL_SUCCESS) {
246 KisConfig cfg(false);
247 cfg.writeEntry("canvasState", "OPENGL_PAINT_STARTED");
248 }
249
251 QRect canvasImageDirtyRect = d->canvasImageDirtyRect & rect();
252 d->canvasImageDirtyRect = QRect();
253 d->renderer->paintCanvasOnly(canvasImageDirtyRect, updateRect);
254 {
255 QPainter gc(this);
256 if (!updateRect.isEmpty()) {
257 gc.setClipRect(updateRect);
258 }
259
260 QRect decorationsBoundingRect = coordinatesConverter()->imageRectInWidgetPixels().toAlignedRect();
261
262 if (!updateRect.isEmpty()) {
263 decorationsBoundingRect &= updateRect;
264 }
265
266 drawDecorations(gc, decorationsBoundingRect);
267 }
268
269 d->repaintDbg.paint(this, updateRect.isEmpty() ? rect() : updateRect);
270
271 // We create the glFenceSync object here instead of in KisOpenGLRenderer,
272 // because the glFenceSync object should be created after all render
273 // commands in a frame, not just the OpenGL canvas itself. Putting it
274 // outside of KisOpenGLRenderer allows the canvas widget to do extra
275 // rendering, which a QtQuick2-based canvas will need.
276 d->glSyncObject.reset(new KisOpenGLSync());
277
278 if (!OPENGL_SUCCESS) {
279 KisConfig cfg(false);
280 cfg.writeEntry("canvasState", "OPENGL_SUCCESS");
281 OPENGL_SUCCESS = true;
282 }
283}
void drawDecorations(QPainter &gc, const QRect &updateWidgetRect) const override
void paintCanvasOnly(const QRect &canvasImageDirtyRect, const QRect &viewportUpdateRect=QRect())
void paint(QPaintDevice *paintDevice, const QRect &widgetRect)
static bool OPENGL_SUCCESS

References KisOpenGLCanvas2::Private::canvasImageDirtyRect, KisCanvasWidgetBase::coordinatesConverter(), d, KisCanvasWidgetBase::drawDecorations(), KisOpenGLCanvas2::Private::glSyncObject, KisCoordinatesConverter::imageRectInWidgetPixels(), KisOpenglCanvasDebugger::instance(), KisOpenglCanvasDebugger::notifyPaintRequested(), OPENGL_SUCCESS, KisRepaintDebugger::paint(), KisOpenGLCanvasRenderer::paintCanvasOnly(), KisOpenGLCanvas2::Private::renderer, KisOpenGLCanvas2::Private::repaintDbg, KisOpenGLCanvas2::Private::updateRect, and KisConfig::writeEntry().

◆ paintToolOutline()

void KisOpenGLCanvas2::paintToolOutline ( const KisOptimizedBrushOutline & path,
int thickness = 1 )

paintToolOutline() is called from drawDecorations(), which has clipping set only for QPainter-based painting; here we paint in native mode, so we should care about clipping manually

d->updateRect might be empty in case the fractional DPI workaround is active.

Definition at line 330 of file kis_opengl_canvas2.cpp.

331{
340 const QRect updateRect = d->updateRect ? *d->updateRect : QRect();
341
342 d->renderer->paintToolOutline(path, updateRect, thickness);
343}
void paintToolOutline(const KisOptimizedBrushOutline &path, const QRect &viewportUpdateRect, const int thickness=1)

References d, KisOpenGLCanvasRenderer::paintToolOutline(), KisOpenGLCanvas2::Private::renderer, and KisOpenGLCanvas2::Private::updateRect.

◆ resizeGL()

void KisOpenGLCanvas2::resizeGL ( int width,
int height )
override

Definition at line 229 of file kis_opengl_canvas2.cpp.

230{
231 d->renderer->resizeGL(width, height);
232 d->canvasImageDirtyRect = QRect(0, 0, width, height);
233}
void resizeGL(int width, int height)

References KisOpenGLCanvas2::Private::canvasImageDirtyRect, d, KisOpenGLCanvas2::Private::renderer, and KisOpenGLCanvasRenderer::resizeGL().

◆ setDisplayConfig()

void KisOpenGLCanvas2::setDisplayConfig ( const KisDisplayConfig & config)
overridevirtual

Implements KisAbstractCanvasWidget.

Definition at line 413 of file kis_opengl_canvas2.cpp.

414{
415 KisOpenGLContextSwitchLockSkipOnQt5 contextLock(this);
416 d->renderer->setDisplayConfig(config);
417}
void setDisplayConfig(const KisDisplayConfig &config)

References d, KisOpenGLCanvas2::Private::renderer, and KisOpenGLCanvasRenderer::setDisplayConfig().

◆ setDisplayFilter()

void KisOpenGLCanvas2::setDisplayFilter ( QSharedPointer< KisDisplayFilter > displayFilter)
overridevirtual

set the specified display filter on the canvas

Implements KisAbstractCanvasWidget.

Definition at line 189 of file kis_opengl_canvas2.cpp.

190{
191 KisOpenGLContextSwitchLockSkipOnQt5 contextLock(this);
192 d->renderer->setDisplayFilter(displayFilter);
193}
void setDisplayFilter(QSharedPointer< KisDisplayFilter > displayFilter)

References d, KisOpenGLCanvas2::Private::renderer, and KisOpenGLCanvasRenderer::setDisplayFilter().

◆ setLodResetInProgress()

void KisOpenGLCanvas2::setLodResetInProgress ( bool value)
overridevirtual

Implements KisAbstractCanvasWidget.

Definition at line 352 of file kis_opengl_canvas2.cpp.

353{
355}
float value(const T *src, size_t ch)

References d, KisOpenGLCanvas2::Private::renderer, KisOpenGLCanvasRenderer::setLodResetInProgress(), and value().

◆ setWrapAroundViewingMode()

void KisOpenGLCanvas2::setWrapAroundViewingMode ( bool value)
overridevirtual

◆ setWrapAroundViewingModeAxis()

void KisOpenGLCanvas2::setWrapAroundViewingModeAxis ( WrapAroundAxis value)
overridevirtual

◆ showEvent()

void KisOpenGLCanvas2::showEvent ( QShowEvent * event)
override

Definition at line 407 of file kis_opengl_canvas2.cpp.

408{
409 QOpenGLWidget::showEvent(e);
411}

References KisCanvasWidgetBase::notifyDecorationsWindowMinimized().

◆ slotConfigChanged

◆ slotPixelGridModeChanged

void KisOpenGLCanvas2::slotPixelGridModeChanged ( )
slot

◆ slotShowFloatingMessage

void KisOpenGLCanvas2::slotShowFloatingMessage ( const QString & message,
int timeout,
bool priority )
privateslot

Definition at line 376 of file kis_opengl_canvas2.cpp.

377{
378 canvas()->imageView()->showFloatingMessage(message, QIcon(), timeout, priority ? KisFloatingMessage::High : KisFloatingMessage::Medium);
379}
QPointer< KisView > imageView() const
The KisFloatingMessage class shows the given message in a semi-transparent bubble that doesn't take f...

References KisCanvasWidgetBase::canvas(), KisFloatingMessage::High, KisCanvas2::imageView(), and KisFloatingMessage::Medium.

◆ slotUpdateCursorColor

void KisOpenGLCanvas2::slotUpdateCursorColor ( )
slot

◆ startUpdateCanvasProjection()

KisUpdateInfoSP KisOpenGLCanvas2::startUpdateCanvasProjection ( const QRect & rc)
overridevirtual

◆ updateCanvasDecorations()

void KisOpenGLCanvas2::updateCanvasDecorations ( const QRect & decoUpdateRect)
overridevirtual

Implements KisAbstractCanvasWidget.

Definition at line 454 of file kis_opengl_canvas2.cpp.

455{
456 update(decoUpdateRect);
457}

◆ updateCanvasImage()

void KisOpenGLCanvas2::updateCanvasImage ( const QRect & imageUpdateRect)
overridevirtual

Implements KisAbstractCanvasWidget.

Definition at line 448 of file kis_opengl_canvas2.cpp.

449{
450 d->canvasImageDirtyRect |= imageUpdateRect;
451 update(imageUpdateRect);
452}

References KisOpenGLCanvas2::Private::canvasImageDirtyRect, and d.

◆ updateCanvasProjection() [1/2]

QVector< QRect > KisOpenGLCanvas2::updateCanvasProjection ( const QVector< KisUpdateInfoSP > & infoObjects)
overridevirtual

Reimplemented from KisCanvasWidgetBase.

Definition at line 442 of file kis_opengl_canvas2.cpp.

443{
444 KisOpenGLContextSwitchLockSkipOnQt5 contextLock(this);
446}
QVector< QRect > updateCanvasProjection(const QVector< KisUpdateInfoSP > &infoObjects) override

References KisCanvasWidgetBase::updateCanvasProjection().

◆ updateCanvasProjection() [2/2]

QRect KisOpenGLCanvas2::updateCanvasProjection ( KisUpdateInfoSP info)
overridevirtual

Reimplemented from KisCanvasWidgetBase.

Definition at line 437 of file kis_opengl_canvas2.cpp.

438{
439 return d->renderer->updateCanvasProjection(info);
440}
QRect updateCanvasProjection(KisUpdateInfoSP info)

References d, KisOpenGLCanvas2::Private::renderer, and KisOpenGLCanvasRenderer::updateCanvasProjection().

◆ widget()

QWidget * KisOpenGLCanvas2::widget ( )
inlineoverridevirtual

Implements KisAbstractCanvasWidget.

Definition at line 86 of file kis_opengl_canvas2.h.

86 {
87 return this;
88 }

◆ wrapAroundViewingMode()

bool KisOpenGLCanvas2::wrapAroundViewingMode ( ) const
overridevirtual

◆ wrapAroundViewingModeAxis()

WrapAroundAxis KisOpenGLCanvas2::wrapAroundViewingModeAxis ( ) const
overridevirtual

Member Data Documentation

◆ d

Private* const KisOpenGLCanvas2::d
private

Definition at line 111 of file kis_opengl_canvas2.h.


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