Jump to content

Krita/OpenGL

From KDE Community Wiki

Overview

KisOpenGL canvas renders using opengl, in a couple of steps starting in paintGL. Then we have Krita Sketch/Krita Gemini, which are QML applications. QML/QtQtuick2 is also opengl these days, it's a scene graph. It offers hooks to draw opengl before and after the scene graph is rendered. Previously, Sketch was a QGraphicsView based application, which offers a hook to draw something in the background. To do that, we called the KisOpenGLCanvas methods to render the background, tiles, image and tool decorations from that function.

Now, those things need to be called in the right place from the QQuickView-based class, but for some reason, the opengl contexts aren't shared, or shared in the wrong way. (Qt examples do all initialization in the paintGL method.) There's a second problem with our opengl code, and that's that we use a lot of compatibility profile stuff, because we use QPainter to render on the opengl canvas a lot. That's broken on OSX, but it's a completely different issue.


Projects

  • Implement more efficient canvas updates, updating only the dirty area, not the whole canvas. // FIXME: Implement dirty rect for OpenGL
  • Refactor code to share rendering pipeline between Krita desktop and Krita sketch
  • Rewrite code to avoid Core profile calls
  • Rewrite KisCanvasDecoration not to use QPainter