03.01.2013 Views

Chapter 1

Chapter 1

Chapter 1

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Figure 18.7<br />

If Symbian OS had no FBS, then a client program that wanted to blit a bitmap to the screen<br />

would have two options:<br />

� If the bitmap is already in ROM, the client can pass the address of the bitmap to the<br />

window server, and the window server can use the BITGDI to blit the bitmap from the<br />

ROM to the screen window.<br />

� If the bitmap is created and drawn by the client in its own RAM, the client uses the<br />

BITGDI to draw the bitmap and then sends a message to the window server to draw the<br />

bitmap. The window server must then copy the bitmap from the client into its own<br />

memory and use the BITGDI to blit it to screen. This would involve considerable<br />

interthread data transfer from client to window server and also serious space allocation<br />

issues inside the window server.<br />

To avoid the waste of both space and time involved in this kind of data transfer, the font and<br />

bitmap server mediates access to a shared heap that contains all RAM-based bitmaps. With<br />

the FBS, the following take place:<br />

� The usage patterns for ROM-based bitmaps are essentially unchanged.<br />

� To use a RAM-based bitmap, the client requests the FBS create the bitmap in its<br />

shared heap. The client uses the BITGDI to draw to the bitmap. The client locks the<br />

bitmap before it starts drawing and unlocks it again when it has finished.<br />

� When the client wants the window server to draw the bitmap to the screen, it sends a<br />

request specifying the bitmap's FBS-owned handle. The window server then uses this<br />

handle to identify the address of the bitmap in its address space (which may be different<br />

from the address in the client's). Finally, the window server uses the BITGDI to blit the<br />

bitmap to the screen.<br />

This makes Symbian OS very efficient at handling bitmaps, which in turn contributes<br />

significantly to the speed of its graphics.<br />

There is an interesting interaction between the FBS and the window server's client-side<br />

buffer. Imagine a client specifies the following sequence of events:<br />

� Create a shared, RAM-loaded bitmap<br />

� Use the BITGDI to initialize the bitmap contents

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!