[Solved] Cairo is not working

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
Agola
Member
Member
Posts: 155
Joined: Sun Nov 20, 2016 7:26 am
Location: Somewhere

[Solved] Cairo is not working

Post by Agola »

EDIT: Solved. I had to learn some Cairo before testing it :|
Last edited by Agola on Sat May 27, 2017 3:32 am, edited 3 times in total.
Keyboard not found!

Press F1 to run setup.
Press F2 to continue.
goku420
Member
Member
Posts: 51
Joined: Wed Jul 10, 2013 9:11 am

Re: Cairo is not working

Post by goku420 »

You say you ported those applications but appear to be trying to run it in kernel space. You're also writing directly to a physical address (instead of using the LFB information Grub/VBE gave you) when you should be mapping that to virtual memory. You're not checking the return value of the cairo functions (I'm assuming they return NULL or something else upon failure).
User avatar
Agola
Member
Member
Posts: 155
Joined: Sun Nov 20, 2016 7:26 am
Location: Somewhere

Re: Cairo is not working

Post by Agola »

goku420 wrote:You say you ported those applications but appear to be trying to run it in kernel space. You're also writing directly to a physical address (instead of using the LFB information Grub/VBE gave you) when you should be mapping that to virtual memory. You're not checking the return value of the cairo functions (I'm assuming they return NULL or something else upon failure).
It was for a simple test, not for real gui.
I'm working with QEMU, so I assume framebuffer is 0xFD000000.

I fixed the problem, looks I should learn the basics of Cairo. Now everything looks good.
Last edited by Agola on Sat May 27, 2017 3:30 am, edited 1 time in total.
Keyboard not found!

Press F1 to run setup.
Press F2 to continue.
goku420
Member
Member
Posts: 51
Joined: Wed Jul 10, 2013 9:11 am

Re: Cairo is not working

Post by goku420 »

Agola wrote:It is for a simple test, not for real gui.
I'm running my os in QEMU, so I assume framebuffer is 0xFD000000.

I fixed the problem, looks I should learn the basics of Cairo. Now everything looks good.
For the benefit of future readers, what was the problem/solution?
User avatar
Agola
Member
Member
Posts: 155
Joined: Sun Nov 20, 2016 7:26 am
Location: Somewhere

Re: Cairo is not working

Post by Agola »

goku420 wrote:
Agola wrote:It is for a simple test, not for real gui.
I'm running my os in QEMU, so I assume framebuffer is 0xFD000000.

I fixed the problem, looks I should learn the basics of Cairo. Now everything looks good.
For the benefit of future readers, what was the problem/solution?
Cairo wasn't working.

cairo_format_stride_for_width expects format and width as arguments, but I passed height.
cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, 480) had to be cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, 640)
Keyboard not found!

Press F1 to run setup.
Press F2 to continue.
no92
Member
Member
Posts: 307
Joined: Wed Oct 30, 2013 1:57 pm
Libera.chat IRC: no92
Location: Germany
Contact:

Re: [Solved] Cairo is not working

Post by no92 »

User avatar
Agola
Member
Member
Posts: 155
Joined: Sun Nov 20, 2016 7:26 am
Location: Somewhere

Re: [Solved] Cairo is not working

Post by Agola »

Sorry, but I thought it was such a rookie mistake and nobody (except me) can do a mistake like that.
Keyboard not found!

Press F1 to run setup.
Press F2 to continue.
Post Reply