[cairo] Delphi: Cairo hardware acceleration

Bill Spitzak spitzak at gmail.com
Sun Jan 4 12:53:21 PST 2015

GL_POLYGON_SMOOTH is useless, it either is ignored by drivers, causes 
everything to be rendered in software, or causes antialiased gap lines 
to appear between each triangle (similar to Cairo's problem if you try 
to draw two shapes that touch, but you cannot make any shape more 
complex than a triangle).

GL_LINE_SMOOTH and GL_POINT_SMOOTH does seem to work nicely, but often 
have limits to the size of the point and line.

Really nice OpenGL graphics typically use shaders to draw antialiased 
lines and also do dashes and other patterns.

On 01/03/2015 04:05 PM, Harald Friedrich wrote:
> You are right, the more pixels you have on your screen, the less weight
> has the single pixel as our eye resolution is limited.
> The answer at "stackoverflow" helps with OpenGL: Fill a triangle and
> overwrite its 3 edges with a thin antialiased line. That looks pretty
> good and seems to be fully hardware accelerated: 100.000 triangles in
> less than 2 seconds.
> Thanks again for your hints, Stefan!
> Am 03.01.2015 um 23:21 schrieb Stefan Salewski:
>> On Sat, 2015-01-03 at 22:49 +0100, Harald Friedrich wrote:
>>> Hello Stefan,
>>> thank you for your answer and your hints. I checked more exactly and
>>> found that cairo is faster than GDI but it is way slower than OpenGL.
>>> The quality is much better using cairo.
>>> So I think I have to use OpenGL directly without any wrapper because
>>> I
>>> need the speed.
>> Indeed my expectation was a much greater difference than a factor of 10
>> between Cairo and GL drawing. For GL you may know that some tuning of
>> drawing quality is possible, but it may depend on the used graphic card,
>> see for example
>> http://wiki.delphigl.com/index.php/OpenGL_Smooth
>> http://stackoverflow.com/questions/3512456/how-to-draw-smooth-line-with-antialias
>> Generally I think that the demand for smooth anti-aliased drawing will
>> decrease when high resolution display (4k, UHD) will become more
>> popular, which should happen soon.

More information about the cairo mailing list