[Lazarus] (no subject)

jpnuage at free.fr jpnuage at free.fr
Thu Sep 10 08:58:34 CEST 2009


Lazarus has the TCarbonBitmapContext class, implemented as a Quartz CGBitmapContext. User interface 
objects use a CGImage as pixel cache. During profiling a Lazarus application on Mac OS X, I noticed 
that the application spends a lot of time in TCarbonDeviceContext.DrawCGImage.

Apple writes 
<http://developer.apple.com/mac/library/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_context/dq_context.html>

Graphics Contexts
Note: If you want to perform offscreen drawing, before you use a bitmap graphics context, you 
should first read “CGLayer Drawing.” CGLayer objects, introduced in Mac OS X v10.4 and available in 
iPhone OS, support drawing to layers and provide a much more optimized solution for offscreen 
drawing than bitmap graphics contexts provide.

and

Creating a Bitmap Graphics Context
CGLayer objects (CGLayerRef), available in Mac OS X v10.4 and later, are optimized for offscreen 
drawing because, whenever possible, Quartz caches layers on the video card.

Therefore - unless someone else is working on it - I would like to add CGLayer support to the 
Carbon widget, using CGLayers as pixel cache for interface objects. Is this a change that the 
Lazarus team would welcome ? My work will is being sponsored by PGMusic <http://www.pgmusic.com>.

Regards,

Adriaan van Os





More information about the Lazarus mailing list