[Development] iMX6 EGLGS 2D (QtWidgets) painting acceleration

Uwe Rathmann Uwe.Rathmann at tigertal.de
Tue Sep 4 09:03:10 CEST 2018


On Mon, 03 Sep 2018 12:39:22 -0700, Thiago Macieira wrote:

> Your criteria for "competitive" are different than the maintainers'.

I was referring to the work of Gunnar and Kim, but comparing X11 with 
Raster and the quality of the implementation of the Raster paint engine 
are interesting topics as well.

> You're not including the pathological cases where the X11 graphics
> system didn't perform as well and required the raster engine to kick in.

As being the maintainer of a cross platform library build on top of 
QPainter I have some experience in this area:

when it comes to vector graphics X11 just rocks. Performance is much 
better and I never had all these bugs of Raster coming and going with 
every version. Actually my code is full of #ifdefs with enabling/
disabling workarounds for specific bugs in specific Qt versions.

F.e:

- https://bugreports.qt.io/browse/QTBUG-42398
- https://bugreports.qt.io/browse/QTBUG-70101

The situation for doing raster operations is the opposite. Actually I 
have code that fills QImages with gradients before drawing them to a 
QPixmap to get around X11 issues.

--

Concerning the performance: the use case of technical plots is often 
about drawing curves ( unfilled painter paths, with a simple pen ) of 
many points.

I once played with doing my own rasterization ( setting the pixels 
manually to a QImage ) by implementing a few algos you need:

- https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm
- https://en.wikipedia.org/wiki/De_Casteljau%27s_algorithm
- https://en.wikipedia.org/wiki/Xiaolin_Wu%27s_line_algorithm

Unfortunately I don't have the code anymore and of course it is not fair 
to compare a feature rich API like QPainter with something that is 
optimized for a specific use case, but: AFAIR the improvement was 
significant.

> And you're not including the need to produce the exact same result in
> all platforms.

This is also a quite interesting topic, as the incompatibilities between 
the different paint engines is in fact a nasty problem.

F.e. drawing a simple line with a FlatCap: for some reason it is 
specified ( https://doc.qt.io/qt-5/qpen.html#cap-style ) not to draw the 
"endpoint". Actually this not what the X11 paint engine does - never did 
- and you have a mismatch with Raster over all Qt4 releases.

The OpenGL paint engine shifts everything by one pixel to the left 
compared to Raster. I thought I added a bug report for this very 
fundamental problem a couple of years ago, but I can't find it.
Anyway, I'm not the only one:

- https://bugreports.qt.io/browse/QTBUG-27500

Please note, that the final comment of this report indicates, that the 
incompatibility between raster and opengl won't be fixed, because X11 is 
no longer supported !

Uwe









More information about the Development mailing list