theuni/xbmc — comment on commit 2daa4f49bc92bb44f954f9444d7f62d0967b26d0
File:  line 0
By theuni:

@topfs2: i still don't think we're on the same page. here's what i'm trying to fix:

With VIEWPORT_ON_CHANGE and noflip, we render/flip the entire screen when dirty, and don't render or flip when idle.
Imagine this scenario (it's reproducible as i describe by sticking a printf in just before swapbuffers())

1. move from one confluence home-screen item to another, we're animating/rendering/flipping the whole time.
2. move to a sub-item. this is a single-render, single-flip operation.

Because it takes 3 frames to age these buffers down to zero, we end up rendering/flipping the entire viewport several extra times. This applies _every time_ we stop rendering, so basically every gui movement renders/flips a few extra times.

This is why I think we should set m_buffers to 0 for this mode. There's no reason why we need to keep any region around for more than one render/flip, because (with noflip), we never worry that the contents of the back-buffers are undefined. We could essentially delete the array after each render, but in order to keep CleanMarkedRegions behavior unified, imo, m_buffers=0 is the way to go.