|
Krita Source Code Documentation
|
#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 |
| KisCoordinatesConverter * | coordinatesConverter () const |
| KisCanvasDecorationSP | decoration (const QString &id) const override |
| QList< KisCanvasDecorationSP > | decorations () 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 |
| KoToolProxy * | toolProxy () 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 | |
| KisCanvas2 * | canvas () 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) |
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.
| 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 82 of file kis_opengl_canvas2.cpp.
References KisCanvasWidgetBase::canvas(), KisViewManager::canvasResourceProvider(), d, KisSharedPtr< T >::data(), KisAbstractCanvasWidget::Depth10Bit, KisConfig::effectiveShouldUseNativeSurfaceForCanvas(), KisLongPressEventFilter::ENABLED_PROPERTY, 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().
|
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 166 of file kis_opengl_canvas2.cpp.
References d.
|
overrideprotectedvirtual |
To be implemented by the derived canvas.
Implements KisCanvasWidgetBase.
Definition at line 455 of file kis_opengl_canvas2.cpp.
|
overridevirtual |
Implements KisAbstractCanvasWidget.
Definition at line 416 of file kis_opengl_canvas2.cpp.
References KisOpenGLCanvasRenderer::channelSelectionChanged(), d, and KisOpenGLCanvas2::Private::renderer.
|
overridevirtual |
Reimplemented from KisCanvasWidgetBase.
Definition at line 465 of file kis_opengl_canvas2.cpp.
References KisAbstractCanvasWidget::Depth10Bit, and KisAbstractCanvasWidget::Depth8Bit.
|
overridevirtual |
Reimplemented from KisCanvasWidgetBase.
Definition at line 476 of file kis_opengl_canvas2.cpp.
|
overridevirtual |
Implements KisAbstractCanvasWidget.
Definition at line 422 of file kis_opengl_canvas2.cpp.
References d, KisOpenGLCanvasRenderer::finishResizingImage(), and KisOpenGLCanvas2::Private::renderer.
|
override |
Definition at line 388 of file kis_opengl_canvas2.cpp.
References KisCanvasWidgetBase::processFocusInEvent().
|
override |
Definition at line 393 of file kis_opengl_canvas2.cpp.
References KisCanvasWidgetBase::processFocusOutEvent().
|
override |
Definition at line 398 of file kis_opengl_canvas2.cpp.
References KisCanvasWidgetBase::notifyDecorationsWindowMinimized().
|
override |
Definition at line 220 of file kis_opengl_canvas2.cpp.
References d, KisOpenGLSync::init(), KisOpenGLCanvasRenderer::initializeGL(), and KisOpenGLCanvas2::Private::renderer.
|
override |
Definition at line 383 of file kis_opengl_canvas2.cpp.
References KisCanvasWidgetBase::processInputMethodEvent().
|
override |
Definition at line 378 of file kis_opengl_canvas2.cpp.
References KisCanvasWidgetBase::processInputMethodQuery().
|
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 342 of file kis_opengl_canvas2.cpp.
References d, KisOpenGLCanvas2::Private::glSyncObject, KisOpenglCanvasDebugger::instance(), and KisOpenglCanvasDebugger::notifySyncStatus().
|
overridevirtual |
set/update the color space of the attached image
Implements KisAbstractCanvasWidget.
Definition at line 192 of file kis_opengl_canvas2.cpp.
References d, KisOpenGLCanvasRenderer::notifyImageColorSpaceChanged(), and KisOpenGLCanvas2::Private::renderer.
| KisOpenGLImageTexturesSP KisOpenGLCanvas2::openGLImageTextures | ( | ) | const |
Definition at line 460 of file kis_opengl_canvas2.cpp.
References d, KisOpenGLCanvasRenderer::openGLImageTextures(), and KisOpenGLCanvas2::Private::renderer.
|
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 282 of file kis_opengl_canvas2.cpp.
References d, isBusy(), KIS_SAFE_ASSERT_RECOVER_RETURN, qFuzzyCompare(), and KisOpenGLCanvas2::Private::updateRect.
|
override |
Definition at line 232 of file kis_opengl_canvas2.cpp.
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().
| 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 327 of file kis_opengl_canvas2.cpp.
References d, KisOpenGLCanvasRenderer::paintToolOutline(), KisOpenGLCanvas2::Private::renderer, and KisOpenGLCanvas2::Private::updateRect.
|
override |
Definition at line 226 of file kis_opengl_canvas2.cpp.
References KisOpenGLCanvas2::Private::canvasImageDirtyRect, d, KisOpenGLCanvas2::Private::renderer, and KisOpenGLCanvasRenderer::resizeGL().
|
overridevirtual |
Implements KisAbstractCanvasWidget.
Definition at line 410 of file kis_opengl_canvas2.cpp.
References d, KisOpenGLCanvas2::Private::renderer, and KisOpenGLCanvasRenderer::setDisplayConfig().
|
overridevirtual |
set the specified display filter on the canvas
Implements KisAbstractCanvasWidget.
Definition at line 186 of file kis_opengl_canvas2.cpp.
References d, KisOpenGLCanvas2::Private::renderer, and KisOpenGLCanvasRenderer::setDisplayFilter().
|
overridevirtual |
Implements KisAbstractCanvasWidget.
Definition at line 349 of file kis_opengl_canvas2.cpp.
References d, KisOpenGLCanvas2::Private::renderer, KisOpenGLCanvasRenderer::setLodResetInProgress(), and value().
|
overridevirtual |
Reimplemented from KisCanvasWidgetBase.
Definition at line 198 of file kis_opengl_canvas2.cpp.
References d, KisOpenGLCanvas2::Private::renderer, KisOpenGLCanvasRenderer::setWrapAroundViewingMode(), and value().
|
overridevirtual |
Reimplemented from KisCanvasWidgetBase.
Definition at line 209 of file kis_opengl_canvas2.cpp.
References d, KisOpenGLCanvas2::Private::renderer, KisOpenGLCanvasRenderer::setWrapAroundViewingModeAxis(), and value().
|
override |
Definition at line 404 of file kis_opengl_canvas2.cpp.
References KisCanvasWidgetBase::notifyDecorationsWindowMinimized().
|
slot |
Definition at line 354 of file kis_opengl_canvas2.cpp.
References d, KisCanvasWidgetBase::notifyConfigChanged(), KisOpenGLCanvas2::Private::renderer, and KisOpenGLCanvasRenderer::updateConfig().
|
slot |
Definition at line 361 of file kis_opengl_canvas2.cpp.
References d, KisOpenGLCanvas2::Private::renderer, and KisOpenGLCanvasRenderer::updatePixelGridMode().
|
privateslot |
Definition at line 373 of file kis_opengl_canvas2.cpp.
References KisCanvasWidgetBase::canvas(), KisFloatingMessage::High, KisCanvas2::imageView(), and KisFloatingMessage::Medium.
|
slot |
Definition at line 368 of file kis_opengl_canvas2.cpp.
References d, KisOpenGLCanvas2::Private::renderer, and KisOpenGLCanvasRenderer::updateCursorColor().
|
overridevirtual |
Implements KisAbstractCanvasWidget.
Definition at line 428 of file kis_opengl_canvas2.cpp.
References d, KisOpenGLCanvas2::Private::renderer, and KisOpenGLCanvasRenderer::startUpdateCanvasProjection().
|
overridevirtual |
Implements KisAbstractCanvasWidget.
Definition at line 451 of file kis_opengl_canvas2.cpp.
|
overridevirtual |
Implements KisAbstractCanvasWidget.
Definition at line 445 of file kis_opengl_canvas2.cpp.
References KisOpenGLCanvas2::Private::canvasImageDirtyRect, and d.
|
overridevirtual |
Reimplemented from KisCanvasWidgetBase.
Definition at line 439 of file kis_opengl_canvas2.cpp.
References KisCanvasWidgetBase::updateCanvasProjection().
|
overridevirtual |
Reimplemented from KisCanvasWidgetBase.
Definition at line 434 of file kis_opengl_canvas2.cpp.
References d, KisOpenGLCanvas2::Private::renderer, and KisOpenGLCanvasRenderer::updateCanvasProjection().
|
inlineoverridevirtual |
Implements KisAbstractCanvasWidget.
Definition at line 86 of file kis_opengl_canvas2.h.
|
overridevirtual |
Implements KisAbstractCanvasWidget.
Definition at line 204 of file kis_opengl_canvas2.cpp.
References d, KisOpenGLCanvas2::Private::renderer, and KisOpenGLCanvasRenderer::wrapAroundViewingMode().
|
overridevirtual |
Implements KisAbstractCanvasWidget.
Definition at line 215 of file kis_opengl_canvas2.cpp.
References d, KisOpenGLCanvas2::Private::renderer, and KisOpenGLCanvasRenderer::wrapAroundViewingModeAxis().
|
private |
Definition at line 111 of file kis_opengl_canvas2.h.