Context.get_current_texture() can now raise DrawCancelled#820
Conversation
Vipitis
left a comment
There was a problem hiding this comment.
I skimmed the diff and looks good to me. Is the whole dummy thing not needed anymore? Feels great.
|
Also is there some reasonable way to automatically test for this? Or would you need gui automation etc? |
No, because we can use the same frame-skip mechanism for these cases. The dummy texture was there to allow
The manual test is to run an example with glfw, hide the window, check that there are no errors, and observe that reported fps is low at first when you bring it back to front. Automating that in CI is very tricky at the least. |
Closes #819.
Since the latest update, when a window is hidden, we cannot obtain the surface texture. We had two options:
Since this is a reliable method to detect that a window is not actually visible, and not all GUI toolkits have a way to determine the visibility of a window, we decided for the latter.
This does mean downstream code needs to adjust. Any code based on rendercanvas can simply update rendercanvas, see pygfx/rendercanvas#221.