How to draw an arc using Xrender?

phillbush at cock.li phillbush at cock.li
Mon Sep 14 23:17:43 UTC 2020


I'm trying to rewrite an application of mine from core X drawing
primitives into Xrender Picture drawing.  For this, I need to draw
an arc.

I wrote a sample code I posted on pastebin to practice Xrender drawing.
I wrote a simple function drawarc() that uses XTriangle's to compose
an arc.  It is called in main() to draw a 90-degrees white arc.  But
the drawn arc is not white; it is grayish. That's probably because of
the smooth edge attribute of the individual triangles.  But I want the
arc to be white.

Am I using the correct Picture attributes?
What is the best way to draw an solid-color arc using XRender?

I am really new to Xrender (and to Xlib and compositing in general),
so I have no idea what should I do.

Here is the code:
https://pastebin.com/raw/a6vd1WcL

PS: I'm using 1/64 of a degree as angle unit (just as core X does).


More information about the xorg mailing list