About Names…

I was named after the then-king of Belgium and my parents. Apparently, discussions with both the minister and the grandparents were getting heated enough that naming me in the Rempt family tradition (Simon, Cornelis, Simon, Cornelis, ad infinitum) wasn’t going to fly, and putting in the names of the granddads as second, third name wasn’t going to work either.

So I was a Boudewijn Simon Anthonie. My mom has always been pissed it wasn’t Anthony, but that was a spelling mistake on my dad’s part, at the registry office. My dad is Simon, my mom was Antonia (born 1939, so what was the connection to the NSB’s Mussert again? Though I also had an Antonia aunt who was born before WWI.) And my “roepnaam” — what my parents put on the birth card as what they were going to call me was “Boudy”.

Yeah. When that got known in primary school, it heralded much bullying.

And in secondary school, feminizing my name to “Boudewina” was pretty much a fave of the bullies — and that group comprised all of my classmates, pretty much. Hey! Boudewina! You’re sitting like a bitch — kick. Hey Boudewina, you’re walking like a tart, push. Hey, Boudewina, your test resultts are good like a girl’s — stomp.

(And years later, when I was in my fifties, and I was out to my wife, though not in public yet, when I was fifty, the local comic book shop owner revived “Boudewina” all on his own…)

When I got into free software, and irc, and Linux, “Boudewijn” was too long — too many characters for a Linux user name back in in 1993. So, I shortened it to “Boud”. And that worked?

Pretty much the only problem I had was teaching people the right pronunciation, but I didn’t really care about that. There was one Krita sprint where I was near the table where Cyrille, Dmitry and others were hacking, and one after another put their finger in the air and shouted, “Boud, boud, can you take a look at this?”

And then corona happend, and I had no reason anymore to fake being male, and came out, first to my wife, who also doesn’t live with her baptismal name.

And I was like, I need a new name, and, NOOOOOO, it doesn’t need to start with a “B”. Fuck that letter ‘B’! Like so many of us, I went through all the table-top RPG player character names of all the people I had played in the past thirty years. Unlike many of us, they all had different names — I didn’t want to contaminate one character with another — but I didn’t figure out anything appropriate. Maybe because I had so many names I had used before?

At that point, Irina, my wife, suggested “Halla”. It’s an Ilaini word (and Irina and I got together over our respective invented worlds and languages) and it means “blackbird”, and I’ve always been really partial to blackbirds… And I had never used this, the most common girls’ name in Ilaini, for any of my PC’s, so it was free!

So, in the end, I once again didn’t name myself, but got named by someone else, by  the woman I’ve been with for over thirty years, and the name just fits!

(The really weird thing right now is that I not only never played any PC with the name Halla, but also that meeting other Halla’s in Valdyas is really making me feel discombobulated.)

My Librem 5 has arrived

Well, it arrived two weeks ago, but I had a pretty terrible cold so I didn’t really take a look… Here are my initial findings:

  • It’s a brick. It thick, fat, heavy and feel awkward to hold. But it’s got three manual kill switches.
  • On startup, it asks for a disk encryption password, which the manual didn’t say anything about. I guessed it would be 123456, based on some quick googling, and it was. You need to press OK yourself, it doesn’t figure out that the password has been entered.
  • Then you get a bit of text scrolling past when the thing is booting
  • Then there is no wizard to set up accounts or anything — I got asked for a password and again it was 123456
  • Then I noticed that when it’s charging it gets REALLY hot.
  • And then I could start exploring the software a bit…

I know how hard developing for mobile Linux is. I worked with Nokia on the Maemo/MeeGo Documents application based on KOffice/Calligra. I’ve worked on Plasma Mobile for Blue Systems. I know that after the N900, with its mostly GTK stack, everyone until Purism has tried to build their mobile Linux UI on Qt and later QML. (Well, FirefoxOS was different, but Blackberry, Nokia, Ubuntu, Palm… That was all Qt.) And they all failed, for various reasons.

This thing runs GTK-based software again. And it’s really bad. It’s slow; even scrolling in the Settings application is not smooth. The browser doesn’t scroll smoothly. And its’s buggy. Starting the Usage applet randomly pops up a dialog asking whether this or that applet should be force-quit. There are two back buttons in the system update applet next to each other, but only one works.

  • And finally, battery life is abysmal.

I haven’t seen a Fairphone yet, but literally nothing in the Librem 5 is an improvement over the Nokia N9. Well, maybe the killswitches. It’s as if there have been no developments whatsoever for the past ten years. And in the meantime, since I first backed the 2017 crowdfunding campaign I have sort of lost interest in mobile devices…

Should we stop flying to our free software conferences?

Whelp, the latest IPCC report doesn’t beat about the bush. It whacks right into it. And, yes, while governments and companies need to take responsibility and finally start to DO something, we all still have a personal responsibility.

As KDE we’re working on the energy consumption of our applications (which already has shown something we, the Krita developers, can do right away), I changed to buying the electricity I use for building Krita (and everything else) from the local windmill coop… I don’t drive, never have, and that pile of wood next to the stove dates back to 2018, and we’re not going to burn it any more. (Why would we — it’s too warm in winter, when we came to live here in 2007, we needed that stove because it was too cold otherwise!)

All of that is peanuts.

But there is one place where we, as a free software community, have to take responsibility (that word again) and stop doing something we absolutely love to do, and for which we’ve been pining.

In-person conferences with a world-wide attendance.

I’m hating having to say this, and I’m hating that I have to say that it is inevitable, and I hate that many of my Krita collaborators won’t actually be meeting me, the improved second release, but… We, as a free software community need to have this discussion, and until now, all I’ve seen has been silence.

Flying always scared me irrationally, but that’s not the reason I think we should stop it. Cheap air travel is only possible because it’s subsidized, untaxed and airlines are being kept alive only as a matter of national pride. And that’s the only reason we can actually afford to fly people from all around the world to conferences, sprints, Akademies and the like.

Our conference model is built upon something we wouldn’t be able to afford if air travel was priced in accordance with its real cost.

And, we’re probably not going to miss the presentations, much? Most presentations at free software conferences are, honestly, a bit meh. A conference with presentations is something we’ve copied from Academia. What we’re really missing is the meetings, the chats, the sitting together at a table and making notes, the occasional pair programming, the making new acquaintances, the gossip.

And the remote conference format pretty much only provides the presentations, with a bit of chat, which we already have next to it. And I really cannot handle remote conferences myself. For meetings and BoF sessions, I get a headache in a minute or ten. For presentations, especially when pre-recorded, I get bored in under a minute. That sucks.

Maybe we can find a better on-line get-together activity. Max Miller from Tasting History has a virtual cocktail party with his patreons. Maybe the next virtual conference could start with planning and facilitating the socializing, and only add in a program as an afterthought?

But whatever, we still should not go back to burning enormous amounts of kerosene for our get-togethers. Would it be too much to say that that would be criminal?

Krita, Qt and OpenGL — again.

I have previously written about this subject, and back then couldn’t reach any conclusion. The options open to us were all confusing: we could try to write Krita’s canvas directly in Metal, OpenGL and Direct3D and show those in native windows in our QtWidgets based application.

We could try to rewrite our canvas in QRhi, the semi-private GPU API  abstraction Qt 5.15 and up provides — though it might not have enough functionality for us, since it us just written for what Qt needs for QtQuick.

We could try to rewrite all of Krita in QtQuick and integrate our canvas into QtQuick’s render loop: but yes, that means a complete rewrite, because you cannot put a QWidget in a QtQuickWindow, and putting QtQuick into a QWidget window means you’re rendering using OpenGL, which breaks on Windows, now that Qt6 doesn’t come with an Angle option.

So we had a big blue button meeting on Friday, where we discussed this issue and some other issues.

Here’s what we concluded:

We will patch Qt6 to render OpenGL using Angle on Windows and macOS.

In the meantime, using Qt 5.12, we’ll move forward adding QtQuick based elements to Krita.

And we’ll try  to make a QtQuickWindow based version of Krita for Android. Sharaf Zaman has succeeded in prototyping that, so we know it can be done now; something we lost in the migration from Qt4 to Qt5.

We also want to strip out the CPU-based canvas in Krita and port our usage of QPainter on OpenGL surfaces to straight OpenGL.

And finally, something we should have done during the port to Qt5, we’ll move uploading the canvas textures into a thread, which should solve the performance problems on macOS.

All in all, it was a very focused and very productive meeting, though I guess the conclusion might be a bit startling. And we’re a bit daunted, but only a bit: we already patch the heck out of Qt anyway.

 

A new macbook pro — first impressions

Two days ago, my macbook pro M1 arrived. I mainly got this device to test Krita on and make ARM builds of Krita, but it’s also the first macbook anyone in the Krita community that allows playing with sidecar and has a touch strip.

So, SideCar works, as expected. There is one problem, though, and that’s that the pressure curve of the Apple Pencil seems to be seriously weird, so I first thought I was painting with a sketch engine brush. But apart from that, it’s nice and smooth.

KDAB has published a library to integrate support for the touchbar: kdmactouchbar — so on that front we might see some support coming.

Krita itself, the x86 build, runs fine: the performance is much better than on my 2015 15″ macbook pro, and rosetta seems to even translate the AVX2 vectorization instructions we use a lot. Weirdly enough, X86 Firefox doesn’t seem to be able to load any website, and Safari is very annoying. Looks like the macOS build of Kate isn’t notarized yet, or maybe I need to use the binary factory build for that. XCode took about two hours to install and managed to crash the system settings applet in the process.

We haven’t succeeded in actually making an ARM build yet. We first need to build the libraries that Krita uses, and some of those seem to build as X86, and some as ARM, and we haven’t figured out how to fix that yet.

The laptop itself is, well, a laptop. It’s not bad, but it would never be my favorite. Yes, it’s very fast, that’s what everyone says, and it’s true: Qt builds in a mere 20 minutes.

The keyboard is nice, much better than the one on the 2015 macbook pro, so Apple was able to make some progress. But the edges of the palm rest — well, all of the edges are really sharp, which is quite painful when typing.

Really cute was the way the language choice on installation tells you to press Enter in all the language, including four dialects of English.

MacOS 11 is also really annoying, with an endless stream of notifications and please-use-your-finger-to-unlock for the most innocuous things. The visuals are appallingly ugly, too, with really ugly titlebars, a cramped system settings applet and weird little pauses now and then. And if the performance monitor can still be put in the menubar, I haven’t found the way to do that.

Anyway, that’s it. We’ll be making ARM builds of Krita one of these days. If you value your freedom, if you like the idea of actually owning the hardware and being able to do whatever you want with it, don’t buy one.

Two New “Tablets”: Wacom Cintiq Pro 24″ Touch and Remarkable 2

In 2018, I discussed the digital painting devices I had used up til then. These were a Lenovo Thinkpad X61t, a Lenovo Thinkpad Helix, a Microsoft Surface Pro 3, a Wacom Cintiq Hybrid Companion, an iPad Pro 12.9″, a Wacom Mobile Studio Pro 16″ and a Lenovo Yoga 920.

I didn’t discuss the Wacom Graphire, the Wacom Intuos 3, the Huion H610 or the Yiyniva MVP22U that I also had around, probably because apart from the Intuos 3, all of that hardware was stored in the Hardware Attic.

But recently, the Hybrid Companion became even more unusable (it was already bad because of the enormous parallax): the screen’s brightness just couldn’t reach visible levels anymore.

And the Wacom Mobile Studio Pro has been dying for over a year now — not good for expensive hardware bought only in 2017. When running as a computer, it would shut itself down randomly, probably because it was getting too hot. So I got myself a Wacom Link device so I could use it as a regular cintiq, but after two days of usage… The display would reset itself randomly and finally it wouldn’t power up anymore, at all.

Of the hardware in the original survey, I still have the Lenovo Yoga 920 — it just has had its screen replaced for the second time, but apart from that, it’s fine.

The screen was broken… The motherboard too. The replacement was too dim, and had to be replaced.

And the iPad is also still fine, probably because I don’t use it for anything but reading comics. The pencil these days never gets even charged because I don’t want to port Krita to iOS and I dislike all the drawing applications that are available for iOS. And the Pencil is really nasty to hold, because it’s top-heavy.

So, what came next…

In 2019, we acquired a Pixel Chromebook (a loaner from Google) and a Samsung Tab S4, for the ChromeOS and Android port. The Tab S4 is nice for reading comics, too, but screen is small and the pen is a bit too small to hold comfortably, for me at least. And Krita on Android is still a bit rough, so no way that would be my main drawing device. (Though Sharaf is working full-time now on improving Krita on ChromeOS and Android.)

Then we had the 2019 Krita Sprint, and I wanted to setup a working HDR test system, so I got an Intuos Pro Large. I hadn’t realized Large meant Huge though… It’s not a display tablet. I actually still like the old Intuos 3 we got crowdfunded in 2007 better.

The demise of the Mobile Studio Pro left me without a display tablet, so I decided to invest in a real Cintiq.

The 16″ model has been out of stock for quite some time now in the Netherlands. I thought, whatever, and got the 24″ one. There’s this saying about donkeys, and I guess I’ve proven I’m not a donkey, because once again, this was waaaaaaaay bigger than I had expected.

It has completely conquered my analog art table:

I’ve had it for three weeks now. Let me sum up my experience with it in the first part of this blog post. The second part is about the Remarkable 2 I received around the same time (I backed their fundraiser way back then).

First: this is the right size for a display tablet. Everything I’ve used before felt cramped, and that’s coming from someone who likes to paint on 3″ by 3″ panels with oils and brushes. At first, it feels downright heavenly to work on.

But…

There are a bunch of severe issues with it, Windows 10 and the latest Wacom drivers. There are also issues using it with Linux + KDE’s Tablet KCM, but those aren’t really Wacom’s fault. I haven’t used it with my mac yet.

  • I won’t whine about size and weight. But the bezels are ginormous, and though they are a nice magnetic area for the expresskeys remote to latch on to, they are just too much.
  • If you turn up the display brightness, the fans start impersonating fighter jets taking off. If you don’t it’s really quite dim. And after a while, you get the fans anyway. I wish my drawing was good enough to get fans that easily.
  • The thingy you click in to put your pen is is tacky, ugly and flimsy. Not a 2500 euro including VAT experience, not at all.
  • The legs only have one elevation, though it’s quite a good elevation, for me.
  • The driver and settings software and Windows 10 is GHASTLY.

Let me elaborate on that, because it really is a big deal.

On Windows, there are two ways for applications to talk to tablets, and vice-versa. The ancient and usually reliable “wintab” and the not-really-new-but-we-pretend-it-is and OS-supported “Windows 8 Pointer API, most often called “Windows Ink”.

By default Windows Ink is enabled. This totally makes it impossible to map either side of the rocker switch to right-click. If you do that, and try to use it, Windows will draw a round circle around the cursor and do nothing. You cannot even use it to right-click in Windows Explorer. Whether this is a Windows bug or a Wacom driver bug, I don’t know. I do know that the regular workaround for this issues, switching off flicks, is no longer possible in the latest builds of Windows 10.

This means, with Windows Ink enabled, you cannot right-click with the stylus. At all.

But if I disable Windows Ink in the calibration screen of the Wacom display settings utility (that means, we switch to Wintab), suddenly the right click button starts working! Yay! Both pan and the popup palette work in Krita!

Only… If you have a multi-monitor setup, and given that this is a display tablet, that’s a given, you will get offsets. The offsets get worse the more screens there are to the left of the cintiq. But even if you place the cintiq lef-most in Windows’ display configuration setting, tablet events arrive a bit to the left of the stylus point. And if your displays have a heterogenous scaling factor, the offset gets wild.

This is not a bug in Krita; it happens everywhere, but it doesn’t happen for the mouse events that are generated after the tablet events are discarded. Those are pretty much in the right place.

In short… You can have a right-click button on the stylus or accurate stylus mapping, but not both.

I guess we’ll learn to work around this in Krita by also looking at the mouse events, and taking the coordinates from that. But please, Wacom and Microsoft, work together to fix this?

So this weekend I wanted to test our last release by painting for a couple of hours. Instead it’s the third weekend I’ve spent investigating mouse/stylus/button issues and settings.

And now about the other device that arrived! It’ll never run Krita, but it promised to be very cool indeed. I got a Remarkable 2 tablet. That’s an e-ink display which promises the best ever writing experience.

I wanted to use it for notes, jottings, character sheets, and making diagrams while thinking. Also reading PDF’s of standards documents, programming manuals and articles about graphics and painting.

The hardware looks gorgeous, too. Very stylish, with a nice black pen, a nice leatherette cover and a flush screen design.

There are two problems, one I don’t care much about, and the other one damning.

The meh problem is that in order to put PDF’s on the tablet, you need an account and a Windows, Android or ipadOS application. Or you can futz around with ssh. Well, given that I ssh into our music sever laptop to start a screen session in which I run ogg123, that’s not a biggie. Might be for others, isn’t for me.

But… I’m a leftie. I’m not just to the left of AOC when it comes to politics, but I draw, paint and write with my left hand. Most of us lefties have learned to turn the paper counter-clockwise until the top is parallel with our hand.

Then we start to write.

On the remarkable this wil every friggin’ TIME that I start writing at the top of a page close that page because a gesture from the top downwards closes the open document.

It’s as if I’m crumpling up every piece of paper I’m writing on, always, all the time.

But apart from that, the acccuracy, speed, handwriting detection, screen quality, build quality — it’s all close to perfect. The pen is a bit too rough for my fingers, but okay, that would erode with enough use. Only, using the Remarkable is next to impossible for me!

ETA: I figured it out! I can hide the ui for selecting tools, and that also hides the thingy that closes the document on touch. I can finally use the Remarkable  — though I still tend to create new pages all the time with the palm of my hand.

Checking out the Competition: Clip Studio

So, last week I read a review in the German C’t magazine of Krita 4.4.0. It was all very complimentary, but the conclusion was:

Mit seinen Animations- und Vektorfähigkeiten hebt sich Krita von der Konkurrenz ab. Funktional bleibt das Programm allenfalls hinter dem japanischen Clip Studio Paint (ehemals Manga Studio) zurück.

Well! I mean to say, that’s not what we want to hear. I’ve played a bit with Clip Studio on iOS, but I never really dug into what made the application different from, say, Paint Tool Sai or Medibang.

So I got a trial license and gave it a try, first on my macbook pro (2015), then on Windows on my Thinkpad T470p. I recently got a new cintiq, a 24″ Cintiq Pro Touch, to replace the broken Cintiq Hybrid Companion and the even more broken Mobile Studio Pro. It’s conquered my painting table…

The first thing you notice when starting Clip Studio is the really busy opening screen, which is actually separate from the actual painting application. Just like Krita, it shows the latest news, but also featured images, new tutorials and so on. There is a row of options on the left side, some of which open a browser, some of which open a page in the right-hand panel and one of which starts the application.

Clip Studio's Starting Screen
Clip Studio’s Starting Screen

I kind of like the presentation of the news items, and the featured image on top.

Starting Clip Studio shows a rather traditional window. On macOS, you can only open Clip Studio on the primary display, you cannot move the application from, say, the monitor to the Cintiq without making the Cintiq the primary display. On Windows, that’s not a problem, but several of the dialogs will show up on the primary display, not the one where the Clip Studio window is placed. This even happens for the brush editor floating palette.

Clip Studio's main window
Clip Studio’s main window

Also on macOS, Clip Studio comes with its own titlebar and titlebar buttons which don’t work like the default ones on macOS do.

Then I loaded one of my old comic pages in PSD format, and started experimenting.

I found out, in the settings, that Clip Studio has the same problems with Wintab vs Windows Ink Krita has, which is kind of a relief. I also got the same problems with the rocker switch set to right-button, and with misplaced cursors if not all screens have the same display scaling. In general, the touch screen functionality of the Cintiq is quite bad…

Something that Krita has, that Photoshop doesn’t is group layers that are either pass-through (as in Photoshop) or have their own projection. Clip Studio has that, too, but it’s a global option in the preferences dialog, and cannot be set per group layer.

Another setting is between “default” and “high quality” canvas — that sounds a bit like Krita’s setting where you can choose between nearest neighbour, bilinear, trilinear and high-quality scaling mode. It suggests that Clip Studio is also using OpenGL for their canvas implementation, but… Their canvas is really smooth and responsive on macOS, where we are still struggling with OpenGL on macOS.

Their tool system is different: they have separate tools for pencil, pen, brush and eraser. Tools then have “sub tools” that you can select in the top-left second column panel, and then settings in a panel underneath. That works quite well, much better than Photoshop’s fold-out toolbar buttons where you long-click, then select a tool, and the others are hidden again.

The panels show text and icon for the currently selected tab, and icons for the unselected tabs. Those icons are, on Windows, a bit cut off, and hard to recognize. To me, it looked a bit like Hangul…

What I really appreciated is that the layer properties aren’t in a dialog, but in a panel, and this works really quite well. There are layer-style like things you can add to a layer, and mark a layer as “draft” — so for instance the fill tool doesn’t take that layer into account when using the composed image for filling, or as a “reference” layer. I want to convert Krita’s layer properties dialog to a panel, too!

There are two color modes: dark and light, and both lack contrast a bit. It doesn’t help that if you make the cintiq brighter than 50% a boeing 747 starts taking off in your work room, drowning out music and speech. Such fans…

Clip Studio Paint really is geared towards making manga, manhwa or manhua (even though it isn’t for sale in the PRC, only Taiwan). So there are lots of options for showing things like bleed margins, and I want that, too, for Krita. A new canvas decoration would be the best place to implement that.

Krita does have a comic book manager which handles pages and generating epubs, so we’re equal in that regard. What we’re missing is the number of templates and presets; what is also missing is the frame layer type, for comic book frames. And our text tool and balloon collection isn’t good, but I already knew that.

There are a bunch of other useful features, some of which already got discussed on krita-artists.org, like an option to assign a color to a grayscale layer and use that color to render the pixels. That should be implementable, though, and the workarounds discussed in that thread shouldn’t be necessary.

There’s a filter that makes raster line-art fatter — not sure how useful that is.

There are two other big differences that I could see in one Sunday of playing around and following tutorials: materials and 3d models. Materials are things like patterns, but also models of buildings and other resources that you can use to, for instance, easily add a lace border to a dress. This is worth investigating. The inclusion of the 3D models is something we had tried to achieve in one or two Summer of Code projects, but it never got anywhere. Might be worth reviving as a project.

Another thing worth investigating is whether we shouldn’t create something like Blender Cloud or the Clip Studio community system, where people can take out a subscription and access and share resources, tutorials and so on.

Painting-wise, I think Clip Studio is doing fine, though our brush engines are more versatile, but their performance on macOS is much better.

In the end, I probably should go through all the menus and make a detailed feature comparison, and then we, Krita developers, could decide which features are neat enough to nick. I wonder when Adobe will then poach those new features for Photoshop…

 

Krita, OpenGL and Qt

The Beginning

Adrian Page first coded an OpenGL-based canvas implementation for Krita in 2005. That was back in the Qt3 days. OpenGL was fairly simple back then, but we had to duplicate all our canvas handling code, once implemented in OpenGL, once implemented with QPainter.

Krita’s canvas code executes in three phases. There’s the image projection, that is, the result of combining all the layers, which is drawn first. Then we draw the canvas decorations: that’s the selection outline, the guides, the assistants, the reference images and so on. Then we draw the tool decorations: that’s the outline cursor, the line for the straight line or ruler tool and so on.

Obviously, implementing all of that twice, once in  OpenGL, once with QPainter isn’t ideal.

The Good Days

So we were elated when Qt4 appeared. Qt4 came with an OpenGL based QPainter engine. This was ideal; we could split up our canvas code. The image would be drawn with pure OpenGL on a QGLWidget or with QPainter on a QWidget, and the canvas decorations and tool decorations would be drawn with QPainter on either canvas.

The Qt documentation even came with a nice example showing how this was to be done.

The First Fly in the Ointment

However, the Qt developers apparently saw the OpenGL QPainter engine more as a way to speed up the drawing of QWidgets than something that application developers would use. And the OpenGL QPainter engine never was able to render a complex application completely correctly.

So at some point, the engine stopped working on macOS. Mostly because Apple doesn’t want people to use OpenGL, so they’re starving their drivers from development, but also because the Qt developers thought that the OpenGL QPainter engine was a failed experiment because it didn’t improve performance when painting their widgets: they had forgotten that applications developers are using QPainter in their OpenGL applications. Or even told them not to do that. Though the documentation never reflected that opinion.

That sucked, since we needed it, and in 2016 we had to spend a Summer of Code slot on fixing the OpenGL QPainter engine so it worked on macOS with OpenGL 3.2 Core Profile. That landed in Qt.

R.I.P Touch UI for Krita

With the migration from Qt4 to Qt5 something else happened: Qt4 QML was based on QGraphicsView. I’ve always suspected that QGraphicsView was created for companies that needed mapping software, but in the Nokia days there were several attempts to use QGraphicsView as a basis for a mobile ui framework, DUI (best link I could find; there’s serious loss of history here).

Those attempts failed, until someone came up with QML, which initially was also rendered with QGraphicsView.

We used QML to create Krita Sketch and Krita Gemini. Because it was based on QGraphicsView, the touch ui we created worked seamlessly with our OpenGL-based canvas.

When Qt5 came out, QML was based on OpenGL and a scenegraph. We spent several months and quite a bit of money trying to integrate our OpenGL canvas in in the new scenegraph, but it just did not work. At all. It couldn’t be made to work, and Krita Sketch and Krita Gemini died.

(As an aside: it was much harder than we had expected to port our OpenGL code from Qt4 to Qt5. It was a huge hassle, in fact.)

The Next Episode

And then Google Chrome happened.

The quality of OpenGL drivers on Windows was always variable, sometimes even really bad. We had already encountered that when developing Krita Sketch, when we suddenly had a lot of Windows users.

Google encountered the same problems with Chrome, and they implemented a solution: Angle.

Angle seamlessly translates OpenGL into Direct3D. And once Chrome used that, all their crashes were gone.

And the GPU manufacturers had no reason all anymore to fix their drivers, so they didn’t. Games would use Direct3D, Chrome used Angle, and pretty soon Qt added an option to use Angle, too, because otherwise QML-based applications on Windows would keep crashing.

This was excellent news for us. We started using Angle, and the number of bug reports dropped a serious amount. And when we wanted to support HDR screens on Windows, the fact that we were using Angle already was great, because that enabled us to make HDR work, because on Windows, HDR can only be made to work when the window is rendered using Direct3D.

The HDR patches still haven’t landed in Qt, so we are carrying them, along with a lot of other patches that are needed to make Krita work well.

We regularly port those patches to newer versions of Qt5, but we make all our Krita binary builds with Qt 5.12, because every version of Qt since 5.12 has been too buggy to use. For example: with 5.15, using a QMdiArea in subwindow mode will hang on Windows.

Except for the fact that Krita Sketch was still dead, and we were porting to Android, and a mobile UI would have been nice, everything was fine.

Qt6 Drops Angle

Because, obviously, Qt’s Angle build option only  existed to make sure that QML apps would work on Windows, not for anything, Qt6 has dropped the Angle option…

Because there’s going to be a new framework which will use the various GPU API’s (Metal, Vulkan, Direct3D, OpenGL) directly with a abstraction layer (Rendering Hardware Interface ) above them that will be used to render the QML scenegraph: RHI. It looks like that’s all internal to Qt, though.

It’s really hard to find documentation, but it looks like QPainter will render using those modules; but what isn’t clear is what will happen when we’re going to use QPainter on a QOpenGLWidget. Or would we have to implement a Metal canvas, a Direct3 canvas, and an OpenGL canvas? And will we be able to access the HDR functionality on Windows?

Or should we just patch Qt6 so it can be built with Angle again?

Update

This blog post appeared on hackernews, and one of the reactions (the one I linked to) was really helpful: Jean-Michaël Celerier has actually implemented something outside Qt, using Qt’s RHI interface. So that is possible! Even though the documentation says “Aim to be a product – and in the bigger picture, part of a product (Qt) – that is usable out of the box both by internal (such as, Qt Quick) and, eventually, external users.”

So, I guess the choice for Krita boils down to using RHI — after we’ve determined that it is possible to use that, or using Angle.

In both cases we would be running an abstraction on top of Metal, Direct3D, OpenGL or Vulkan. In the first case, we’d tie Krita even closer to Qt (and every Qt major release changes its approach to graphics, so in a couple of years, who knows…) In the second case, we will have to maintain patches against Qt.

We haven’t come to a conclusion yet.

Nightmares and Bugs

(Recommended music while reading this: Peggy Seeger singing “The Housewive’s Lament)

I’ve been having nightmares, well, really weird dreams for quite some time now. Things like finding myself trying to clear up the floor of a large DIY store just before the first opening day, and not managing it, no matter how many friends were helping. Trying to pack all my luggage when leaving a rented holiday home, and never being able to fit everything in. Trying to pack furniture and stuff into boxes before moving out because someone needs to replace the floor, and having to squash ancient china cups in a carton box, breaking them all in the process. If I manage to wake up, I’m exhausted and tired.

And I guess I’ve grokked why I keep having these dreams. And it’s not lockdown or Covid-19. It’s this:

Krita's Bug Graph

When we held our last bug fundraiser in 2018, we decided to focus for a year on stability. we had about 300 bugs. And we’ve never even managed to come close to that number of bugs ever since! And yet, in the past year, we’ve closed more than a thousand issues.

Clearly, something is wrong here. This isn’t sustainable. We have managed to deflect a lot of reports that were actually cries for support to a new community website, krita-artists.org and to r/krita. Our experiment with ask.krita.org wasn’t successful, but krita-artists really works. We still do get a lot of worthless bug reports, but I think it could be a lot worse, now that we really have millions of users on four platforms.

But it’s still not sustainable. Every report needs to be read, often deciphered, triaged, investigated, fixed — and all those steps involve communication with the reporter. Even the most useless bug of reports can take an hour to resolve with the reporter.

11:32:47. Eep, incoming bug interrupt. Bug 422729No action (assignable shortcut) for Magnetic Selection Tool. 11:33:24: Check, yes, reporter is right. 11:34:32: Confirm. Check code. Notice that all .action files that define actions in the plugins/tools folder are wrong. 11:37:35: Add note to bug report. Fix all of them. 11:47:49: reporter asks a question that needs to be answered, but is not very relevant. 11:56:29: answer given, while I’m building Krita with my fix. 11:57:03: Tested fix, isn’t complete, more work needed. Oh, wait, tested the wrong build. Tested the right build, but the new action isn’t found. 12:00:00 Debug more. 12:25:45: fixed some more broken xml files, ready to make the commit. 12:27:41: Bug is fixed. 12:31:33: Fix is backported to krita/4.3 branch and an extra commit is added that in future will print a warning if the xml parser cannot read the .action files.

Back to this blog post… This was a fast fix: it took about an hour, and in between I also had to run downstairs to receive my new book on Jan van Eyck.

So, this bug report reported a small, but real issue and uncovered a deeper issue. Without the report we probably wouldn’t have noticed the issue. Krita is better because of the report, and the reporter is one of our “known-good” reporters: he has reported 16 bugs this year, one is still in Reported state because we couldn’t reproduce it, six are Confirmed, two are Assigned and seven are Resolved Fixed. Yu-Hsuan Lai has helped us make Krita materially better!

But… Even with me, Dmitry, Agata, Wolthera, Emmett, Eoin, Ivan, Mathias and more people fixing bugs all the time, we’re not getting the numbers down. The floor remains littered, the luggage unpacked and the china unboxed.

Of course we’re not the only ones in this situation: every project that takes bug reports from the general public faces this issue. Some people argue that any bug that has a workaround should be documented and closed; but workaround don’t make for a happy workflow. Others argue that every bug report that is older than two weeks, or a month should be closed because it’s clearly not a priority. But the issue reported is real, and will get reported over and again, with no way of chaining the reports together.

It’s also possible to treat reports like a funnel: first ask people to report on a user-support forum, like krita-artists.org, and only when it seems to be a real bug create a bug report, and only when it’s triaged, put it in a queue. But the problem with that is that nobody’s queue is ever empty. That can be done by assigning the bug to one of us: currently we have 64 bugs in the Assigned state. that means, on average, ten bugs each person’s queue. That in turn probably means betwee a week and a month of tasks already in our queue… Which means we shouldn’t actually look at any newly reported bugs, before we funnel them into our queue. (Another option would be to create issues on invent.kde.org for every bug we really want to work on, something we used to do with phabricator… But pretty quickly we drowned in those tasks as well.)

Which in turns means that either reporting bugs is useless or our todo queues are useless.

And that todo list doesn’t even include working on new features, refactoring old code so we decrease technical depth or working on regressions — that is, features we broke accidentally.

So, even though bug reports help make Krita better, the one  thing I’m sure of is that we shouldn’t do anything that will make it easier to report bugs. We have more than enough reports to keep us busy.

It would be nice, though, if we could make it easier to make good bug reports, for instance by automatically attaching our system information and usage logs to a bug report made with the Help->Report Bug functionality.

Theoretically, that can be done, bugzilla offers a complete REST interface. And I seem to remember that we had that in KDE, years ago, but that it broke because of an update of bugzilla. There’s a new version of bugzilla coming, apparently, and maybe it’ll be worthwhile to investigate that again, in the future.

Argh… I think the dreams will continue for a while.