|Date:||April 28, 2006 / year-entry #149|
|Summary:||If you specify the CS_SAVEBITS class style, then the window manager will try to save the bits covered by the window. But the real question is why, because that is your guide to using this power only for good, not for evil. When a window whose class specifies the CS_SAVEBITS class style is displayed, the...|
If you specify the
When a window whose class specifies the
What invalidates the saved pixels? Anything that would cause those pixels to be out of sync with what should be on the screen once the popup window is removed. Here are some examples:
You get the idea. If copying the saved pixels back to the screen would result in an inconsistent display, then the saved pixels are discarded.
So how do you use this power for good and not for evil?
One consideration is that the region should cover a relatively small portion of the screen, because the larger the saved bitmap, the less likely it will fit into available off-screen video memory, which means the more likely it will have to travel across the bus in a video-to-system-memory blit, the dreaded "vid-sys blt" that game developers are well familiar with. In the grand scheme of vid/sys blts, "vid-vid" is the fastest (since the video card is very good at shuffling memory around within itself), "sys-sys" is next best (since the motherboard can shuffle memory around within itself, though it'll cost you CPU cache space), "sys-vid" is in third place, and "vid-sys" is the worst: Programs write to video memory much more often than they read from it. As a result, the bandwidth between the video card and system memory is optimized for writing to video, not reading from it.
But the primary concern for deciding when to use the
Consequently, the best candidates for
(Some people appear to be under the mistaken impression that
<-- Back to Old New Thing Archive Index