Opened 12 years ago

Closed 4 years ago

Last modified 4 years ago

#66 closed enhancement/feature request (fixed)

Cairo instead of GDK

Reported by: bugs@… Owned by: sleske
Priority: minor Milestone: version 1.0
Component: graphics/gtk_drawing Version:
Severity: normal Keywords:
Cc: sebastian.leske@…

Description

Cairo would be a much better choice than GDK for the rendering of lines.

Attachments (2)

navit-gdk-cairo.png (131.6 KB) - added by sleske 4 years ago.
Comparison of rendering. Left: GDK, right: Cairo
bayer-staatsbibliothek-josm.png (25.3 KB) - added by sleske 4 years ago.
Geometry of Bayer. Staatsbibliothek in the test map OSM data

Download all attachments as: .zip

Change History (13)

comment:1 Changed 12 years ago by KaZeR

  • Milestone set to version 0.1.0
  • Owner changed from somebody to KaZeR
  • Status changed from new to assigned

It has been planed for some times, but has low priority currently, as the current renderer 'works'.

I'll assign it to 0.1.0 for now.

comment:2 Changed 12 years ago by anonymous

maybe you rather want to consider OpenVG, interfacing easier to OpenGL, and promising hardware acceleration on embedded devices?

comment:3 Changed 11 years ago by KaZeR

  • Milestone changed from version 0.1.0 to version 0.2.0

If you have some knowledge of openVG or cairo, help is welcome :) I postpone the ticket for now.

comment:4 Changed 11 years ago by KaZeR

  • Resolution set to wontfix
  • Status changed from assigned to closed

Maybe later, i'm closing it for now.

comment:5 Changed 5 years ago by sleske

  • Cc sebastian.leske@… added
  • Milestone changed from version 0.2.0 to To be discussed - Give your opinion!
  • Resolution wontfix deleted
  • Severity set to normal
  • Status changed from closed to reopened

As discussed in #1270, it is probably a good idea to switch rendering to Cairo, so I'm reopening this ticket.

comment:6 Changed 5 years ago by sleske

  • Owner changed from KaZeR to sleske
  • Status changed from reopened to new

I have started work on this, and hope to have it working shortly. In theory, the switch should be fairly straightforward. Of course, there might be some problems, so we'll see...

comment:7 Changed 4 years ago by sleske

Took some time, but now it's done :-).

gtk_drawing_area now renders using Cairo, instead of GDK.

That means transparency now works properly, and as a bonus all lines are finally anti-aliased. See the attached navit-gdk-cairo.png for a before-after comparison.

Changed 4 years ago by sleske

Comparison of rendering. Left: GDK, right: Cairo

comment:8 Changed 4 years ago by sleske

  • Resolution set to fixed
  • Status changed from new to closed

comment:9 follow-up: Changed 4 years ago by tryagain

I'm just wondering, what's happened to the "8" shaped house to the North of Schonfeldstrasse? Is it a regression, or just osm data has changed since left picture?

Last edited 4 years ago by tryagain (previous) (diff)

comment:10 in reply to: ↑ 9 Changed 4 years ago by sleske

Replying to https://wiki.navit-project.org/index.php/user:tryagain:

I'm just wondering, what's happened to the "8" shaped house to the North of Schonfeldstrasse?

Good catch - I did a lot of image comparison during development, but missed this one.

Well, I suppose technically it is a regression, as it stopped working due to my changes, but I'd say it is a problem with the OSM data.

The images are from the test map created by the CMake build. I looked at the OSM data it is built from (osm_bbox_11.3,47.9,11.7,48.2.osm), and the building in question has a weird geometry. It has empty areas inside (inner courtyards in reality), but it is modeled as a single line, which loops on itself. This looks right when rendered, but is arguable not the right way to map it. The attached JOSM screenshot bayer-staatsbibliothek-josm.png shows the geometry.

So for now I'd consider this an (arguably invalid) edge case. If it happens regularly, we'll have to take a closer look.

Note 1:

If I change the fill rule Cairo uses from CAIRO_FILL_RULE_WINDING (default) to CAIRO_FILL_RULE_EVEN_ODD, the building renders like with the old GDK code. However, I don't fully understand the implications of changing the fill rule, so I'd prefer keeping the default for now.

Note 2:

The building in question (which is the Bayerische Staatsbibliothek [Bavarian State Library]) has been edited in OSM. It is now represented as a multipolygon relation, which I think is a better way to map it. This also means the old and new code Navit code now render it identically - namely not at all, as we still do not render multipolygon relations :-(.

Changed 4 years ago by sleske

Geometry of Bayer. Staatsbibliothek in the test map OSM data

comment:11 Changed 4 years ago by kazer

Installed in my car. I can confirm that the map looks nicer, and that it fixes the transparency issue i was seeing with one specific icon. Great job sleske :)

Note: See TracTickets for help on using tickets.