Skip to content

Draft: [RFC] Proof-of-concept canvas using QQuickWidget

Alvin Wong requested to merge alvinwong/krita:alvin/qquickwidget-canvas into master

I decided to make this experiment to reimplement the canvas using a QQuickWidget. This is not the canvas ported to QtQuick2/QML, but only rendering is moved into the QQuickWindow hierarchy as an underlay. The approach is similar to https://doc.qt.io/archives/qt-5.12/qtquick-scenegraph-openglunderqml-example.html.

The reason I chose this approach is that it can keep the current QWidget input stack. This allows us to experiment with rendering the canvas and stuff with a QQuickItem (probably QQuickFramebufferObject) and porting other canvas-related things over, without having to worry about the input handling now.

When running with this patch, you can set the environment variable KIS_GLCANVAS to gl or quick switch between the old KisOpenGLCanvas2 and KisQuickWidgetCanvas. The default is quick.

Please review the 3rd commit for the actual changes. The first two commits are just juggling to keep the git blame history.

Task ref: https://phabricator.kde.org/T13339

Current issues:

  • Doesn't render correctly with FBO (useFBOForToolOutlineRendering) so I've disabled it. I haven't been able to figure out what's the issue. Solved
  • Performance is really bad with ANGLE
  • Partial redraw not implemented.
Edited by Alvin Wong

Merge request reports

Loading