fix drawing box chars, avoid storing and saving state all the time
ClosedPublic

Authored by sandsmark on Nov 17 2018, 10:07 AM.

Details

Summary

to get the box chars to be drawn correctly we need to turn on high
quality antialiasing in qpainter. in addition only turn it on if
antialiasing is enabled.

lastly qpainter.save()/restore() is called very often, so try to avoid
that if it isn't necessary.

BUG: 401463

Test Plan

cat tests/boxes.txt

old:

new:

Diff Detail

Repository
R319 Konsole
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
sandsmark created this revision.Nov 17 2018, 10:07 AM
Restricted Application added a project: Konsole. · View Herald TranscriptNov 17 2018, 10:07 AM
Restricted Application added a subscriber: konsole-devel. · View Herald Transcript
sandsmark requested review of this revision.Nov 17 2018, 10:07 AM

uhm, never mind this for now. I didn't notice that it actually just didn't draw any antialiasing on the corners. but I guess that also explains why the current antialiasing doesn't work very well.

hindenburg edited the summary of this revision. (Show Details)Nov 20 2018, 12:52 AM

OK the boxes look better w/ patch regardless

so should I go ahead and push this patch?

Ok if you want - I thought you might be still working on it

I tested a bit more, the problem is that drawArc and drawLine look very different with antialiasing on.

So to get the hardcoded line chars to look good with antialiasing they basically have to be remade (I started using QPainterPath, but it's pretty boring work without much in return).

But I can push this patch (without the HighQualityAntialiasing bit, it just worked because it's obsolete and QPainter ignored it), it removes some state thrashing in QPainter (so a tiny performance improvement).

sandsmark updated this revision to Diff 46657.Dec 1 2018, 10:55 PM
sandsmark edited the test plan for this revision. (Show Details)

fixed it

The arc patch is moving files - can you re-upload?

rename from src/TerminalDisplay.cpp
rename to TerminalDisplay.cpp

sandsmark updated this revision to Diff 46843.Dec 4 2018, 4:02 PM

fix format for phabricator

OK so this is for when 'Use Line characters contained in in Font' is disabled. I see a big improvement then.

wbauer added a subscriber: wbauer.Dec 6 2018, 10:04 AM

Just to confirm: this does fix https://bugs.kde.org/show_bug.cgi?id=401463 for me.

hindenburg edited the summary of this revision. (Show Details)Dec 6 2018, 3:08 PM
hindenburg accepted this revision.Dec 6 2018, 3:26 PM
This revision is now accepted and ready to land.Dec 6 2018, 3:26 PM
This revision was automatically updated to reflect the committed changes.