The use and relationships of the Font and Bitmap Server is summarised in the following diagram:
The server performs two main functions, bitmap sharing and font sharing:
The diagram shows a bitmap in the shared heap:
Only the server may allocate into the heap.
The server maintains a usage count for each object in the heap, and destroys objects when their usage count reaches zero.
The client may use a bitmaps graphics context to draw the bitmap directly:
A single handle is passed to the window server to reference a unique shared bitmap.
The window server uses a bitmaps graphics context to blit to the screen.
A callback is needed - when the client releases, the window server buffer may not be flushed yet.
The server may move objects on the heap to maintain heap
compactness — therefore a locking API is needed (cf. Begin()
and
End()
in TBitmapUtil
). To minimize this, only large
bitmaps need locking — they use another heap.
The server has a fontstore (not shown in diagram)
Handles loading from removable media
Fonts are released when their usage count reaches zero.