[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Drawing optimization question

From: Adrian Robert
Subject: Drawing optimization question
Date: Wed, 09 Mar 2005 12:15:17 -0500


I'm drawing directly to a view, either using [NSString -drawAtPoint..] or,
say, with NSRectFill() and friends.

I do something like:

    [view lockFocus]
      (draw comands ...)
    [view unlockFocus]
    [[view window] flushWindow]

The problem is high CPU consumption occurs for the X server (not
the app) when this happens repeatedly.  I'm guessing this is because
the entire window is being flushed, rather than just the changed portion
(which is usually small).  My questions:

- Is this a correct interpretation of what is happening?  NeXT's
( D_ImprovingResponseTime.htmld/)
  say the Window Server maintains a "dirty rect" of what has been
  touched in the buffer and just flushes this, but is this true in

- Is there any way to explicitly flush just a portion of the window?

- Alternatively, could I just cause the drawing to go directly to X,
  and do away with the flush completely?
  I thought NSBackingStoreRetained would do this, but the results I
  get with it are not what I'd expect.

If there is a good RTFM reference somewhere on this that would be
helpful too; I haven't had success finding useful explanations in
Apple's docs.

Thanks for any help!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]