"TheEndless" wrote:
Yes, the key is to not dispose (or modify?) any 2D objects after you've initiated drawing to the screen. This flicker/tearing issue is restricted to the original Roku LT (2400), Roku 2 HD, Roku 2 XD, Roku 2 XS, and Roku Streaming Sticks (i.e., 2400 and all 3XXX models).
Hm, don't you think this is the same issue discussed in a February '15 thread "
SwapBuffers not blocking if animation longer than 1/60 sec."? I haven't seen it till now but read it thanks to @Komag's linking above to @oomzay thread. Here is the essential part, what Joel said:
"RokuJoel" wrote:
The issue you are seeing is as I understand it a platform dependent issue (affecting our "Giga" series of hardware, the Roku 2 XS/XD, LT2400, 2400SK, MHL Streaming Stick and possibly the USB stick). Essentially SwapBuffers will de-sync from the vertical blanking interval if you take more than 16 ms before calling it. This was a hack to improve performance of our home screen on these hardware platforms.
The way i read this is that when SwapBuffers() is called, depending on the time "delta" elapsed since previous SwapBuffers():
- if delta < 17 ms then block&wait for VSYNC, then swap the buffers
- if delta >= 17 ms, then switch buffers immediately, w/o wait
If we are in case (a), there won't be a flicker/tear. If we are in (b) though, all bets are off - there is potential for flicker and it may happen or not. It's a gamble, depending on how different the two buffers are and when exactly displaying the current frame ends - then VSYNC happens - then drawing next frame begins. So you may get upper half of the screen drawn from the old buffer and the lower half drawn from the new one.
That may sound like word salad - but returning to practice, that would mean at any time when one's double-buffered app frame rate drops below 60fps, it is the flicker "splash zone". So, if drawing a frame brings you close to the 17 ms cut-off, e.g. you are at 15-16 ms and then a relatively small change delays code by 1-2 ms - now we are in screen refresh out-of-sync territory.