I'd like to add a new flag GGIFLAG_TIDYBUF for ggiSetFlags(), for use on targets (right now just the new X one) which have a backbuffer and do dirty region management. The reasoning is such:
Some apps are ports of apps that assume db is available, and have no facilities for tracking their dirty region, so any target with a backbuffer must assume that the entire screen needs to be refreshed on any call to ggiFlush() when these apps currently hold the write buffer resource lock. And, mansync, if it is used, must periodically flush the entire screen as long as the write resource lock is being held. In addition, when the db is not locked, a target with dirty-region management of its backbuffer is not obligated to flush the entire contents of an area even when explicitly asked to do so by the application with ggiFlush() -- the backbuffer code has the option of only flushing the intersection of the application's request and it's dirty region(s). The above is the default behavior of the current X code. Other applications (this is being instigated by a fresco issue) do their own dirty region management and know what areas need to be flushed, and call ggiFlush explicitly on just that region. Those apps will benefit from a speedup if the whole backbuffer is not dirtied. So the behavior would be that by default GGIFLAG_TIDYBUF is not set, the entire directbuffer is considered dirty when its lock is acquired, and calling ggiFlush does not guarantee that the entire region will be copied from the front-buffer to the back-buffer regardless of what the target thinks is dirty. In contrast, when GGIFLAG_TIDYBUF is set, mansync will not flush the back-buffer at all when the lock is acquired, and will only flush areas it considered dirty when the db lock is not acquired. An explicit ggiFlush will flush the whole region specified by the application regardless of whether it thinks it is dirty or not. Comments? -- Brian
