[Interest] Drawing slow.

Tomasz Olszak olszak.tomasz at gmail.com
Sun Aug 19 19:21:15 CEST 2018


It would be nice if you can provide simple main.cpp that proves performance
issue and submit a bug. Perhaps it can have impact on other QPainter
related bits.

19 sie 2018 13:10 "william.crocker at analog.com" <william.crocker at analog.com>
napisaƂ(a):


>>
>>   From some experimentation it appears that the CPU time required by the
>> QPainterPath system is quite non-linear in the number of control points.
>> So, if I break my one long path up into a number of shorter paths, it
>> draws MUCH faster.
>>
> Is that the case with both antialiasing on and off? (They use different
> rasterization backends)
>

Yes.
I suspected AA in the beginning, but that was not the problem.
QPainterPaths with a large element count was the problem.
And I am not doing anything too fancy.
Just a lot of lineTo/moveTo.

After every added segment:

         if( path.elementCount() > 100 ) {
               // Long paths take too long to draw.
             QPointF cur = path.currentPosition();
             painter->drawPath(path); path = QPainterPath();
             path.moveTo(cur);
         }

Bill

_______________________________________________
Interest mailing list
Interest at qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20180819/802b896b/attachment.html>


More information about the Interest mailing list