3 ms·
Sure, but things have progressed quite a bit since XLIB. After all it's designed for high latency/low bandwidth network connections using an ancient protocol w
by sliken 7y ago
Sure, but things have progressed quite a bit since XLIB. After all it's designed for high latency/low bandwidth network connections using an ancient protocol with all kinds of caching, complexity, and vector oriented UIs out of tech with today's mostly bitmapped UIs.
There's something crazy like 64 ways to join to vectors. 100s of dot/dash combinations for drawing a line, caching of color maps, etc. etc. etc.
- DonHopkins 7y agoX11 is hardly vector oriented. You can draw lines and ovals, but the graphics model itself is totally pixel oriented. See the 'X-Windows Disaster' section 'Myth: X is "Device Independent"': https://medium.com/@donhopkins/the-x-windows-disaster-128d398ebd47#9d2d https://medium.com/@donhopkins/the-x-windows-disaster-128d39... Myth: X is “Device Independent” X is extremely device dependent because all X graphics are specified in pixel coordinates. Graphics drawn on different resolution screens come out at different sizes, so you have to scale all the coordinates yourself if you want to draw at a certain size. Not all screens even have square pixels: unless you don’t mind rectangular squares and oval circles, you also have to adjust all coordinates according to the pixel aspect ratio. A task as simple as filing and stroking shapes is quite complicated because of X’s bizarre pixel-oriented imaging rules. When you fill a 10x10 square with XFillRectangle, it fills the 100 pixels you expect. But you get extra “bonus pixels” when you pass the same arguments to XDrawRectangle, because it actually draws an 11x11 square, hanging out one pixel below and to the right!!! If you find this hard to believe, look it up in the X manual yourself: Volume 1, Section 6.1.4. The manual patronizingly explains how easy it is to add 1 to the x and y position of the filled rectangle, while subtracting 1 from the width and height to compensate, so it fits neatly inside the outline. Then it points out that “in the case of arcs, however, this is a much more difficult proposition (probably impossible in a portable fashion).” This means that portably filling and stroking an arbitrarily scaled arc without overlapping or leaving gaps is an intractable problem when using the X Window System. Think about that. You can’t even draw a proper rectangle with a thick outline, since the line width is specified in unscaled pixel units, so if your display has rectangular pixels, the vertical and horizontal lines will have different thicknesses even though you scaled the rectangle corner coordinates to compensate for the aspect ratio.