diff -r 89d6a7a84779 -r 25a17d01db0c Symbian3/PDK/Source/GUID-E5CDDA05-CD86-5C44-B9DA-3249D9C14396.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/PDK/Source/GUID-E5CDDA05-CD86-5C44-B9DA-3249D9C14396.dita Fri Jan 22 18:26:19 2010 +0000 @@ -0,0 +1,104 @@ + + + + + +Client-Side +BufferThe Window Server client-side buffer enables drawing functions +to be buffered and executed in sequence. This saves many client-server context +switches and makes the system fast and responsive. +

The Window Server handles many application function calls +as follows:

+
    +
  1. The client packages +the information to send to the server.

  2. +
  3. A context switch to +the server.

  4. +
  5. Processing in the Window +Server—with possible inter-thread communication to and from the client.

  6. +
  7. A context switch back +to the client.

  8. +
+

This guarantees that operations are performed in the right sequence and +that operations have been performed when control returns to the application +program.

+

However, for drawing and many other function calls, this approach is too +slow, and is not strictly necessary.

+ +

Because of this, drawing functions, and other functions that do not need +a synchronous response, are buffered by the client interface in a command +buffer. When necessary, this buffer is flushed by a call to the Window Server, +which executes all the drawing functions in sequence. Thus, two context switches +are sufficient for an entire buffer full of drawing requests.

+

The Window Server buffer is flushed when:

+ +

It is desirable that the buffer is flushed when the application has finished +a unit of drawing. This is usually done as a natural consequence of calling +the function to wait for the next event from the Window Server. This covers +all cases where drawing is initiated in response to a Window Server event. +There are a few cases where drawing is initiated in response to other events. +In these cases, an explicit Flush() call must be made.

+

The use of a buffer has two main impacts on drawing logic:

+ +

The Window Server manages the buffer intelligently so as to minimize flushing. +The opcodes stored in the buffer are short, and repeated use of the same graphics +context is indicated by a single bit rather than repeated reference to the +graphics context.

+

Applications may modify the size, or the maximum size of the buffer to +tune performance or to accommodate long messages. A larger buffer may reduce +flicker by collecting more drawing commands. A smaller buffer uses less memory. +Setting a maximum size allows the Window Server to perform its own optimizations.

+

If a message is too big for the buffer, a panic (#5 - EW32PanicDataExceedsBufferLength) +occurs. optimizations

+
+Window Server +Client-Side Library Concepts +
\ No newline at end of file