#LinuxMobile Played a bit with example of #GTK4 tutorial and #Cairo, to have a light/ basic drawing/note application on my #LinuxPhone.

8 colours (Oric/Spectrum style KRGBCMYW palette) until a palette definition tool
2 modes: dynamic (tested several possibilities, made this one for the demo) or uniform line (need to add a thickness setting).
no save or anything, it’s like a Télécran (english name:”Etch A Sketch“)for now. It’s pure compiled C, and very simple, code, but it is already really slow, far under the capabilities of the device. Don’t know why for. Maybe linked to screen event? It is very smooth on my 10+ years old desktop computer.


Manipulation video of basic usa…
Follow

@popolon I think trying it on a faster and more up to date phone will help the speed. The PinePhone is slow at everything.

@carbonatedcaffeine I use a PinePhone Pro, not a Pinephone, that isn’t slow at all. There are 6 64bits cores, a powerfull Mali GPU, far more powerful, than phone from between 10 and 5 years ago, that was already able to do this kind of stuff or complex 3d games. There are bottlenecks to remove here.

@popolon it's still dated hardware (2016). That was 6 years ago!

@carbonatedcaffeine So he can render at least at the speed from 10 times ago hardware, and probably at the speed of 5~6times ago hardware, it was on the top of ARM chips at this time.

@carbonatedcaffeine I Noticed by a htop, than, between the fact that #Cairo doesn’t use hardware acceleration, it is also mono-threaded, beside, probably wrong usage on my side, as a beginner in this toolkit, this doesn’t help either. This is still a high quality and fast renderer (and still very useful for output to SVG/PDF.

@carbonatedcaffeine I believe I found why for it was so slow. when I launch the application, drawing is fast, but after “blanking the surface” it become slower, and it’s worst at each blanking ^^. If I restart the application it is very fast. For the demo, I made several tries, to not be too long on explanation, on the vidéo. If I quit

As I reused GTK4 tutorial example as base for blanking, it really looks like painting the surface for cleaning the screen, is adding a new element on stack, and then previews drawing has been cumulated in rendering stack, and everything is drawn at each event.

I didn’t found a reference to that in the manual, There is cairo recording surfaces, that record every draw to be played in another format. And notion of push/pop groups that can be used to render intermediate surface, as example.

I didn’t find this clearly in the part of the documentation, that explain the global mean of using all of this an efficient way for now.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.