The previous commit disable the fast drawing if the background texture was not ready, but it did not detect the Painting mode, so the fast was always disabled.
Now the check is done inside paint mode.
There were some problems in the engine because the data was saved inside e_data struct, but this struct is reset sometimes and the background texture is not valid.
Now, the data has been moved to stl->g_data and all creation and free has been moved to use stl->g_data. This fix also some small memory leak for the Buffer GPUBatch data.
The background texture has been moved to texture list because must be available all the time. When is not drawing, the texture is removed to safe memory. Also, if the mode is painting and the texture is not ready because it was removed by Draw Manager, the texture is reloaded with the background image again. This ensure the background image is always visible when painting.
Also I have used this patch to reduce the size of texture used for background to 16F instead of 32F and the blank texture to 1x1 pixels instead of 16x16.
Reviewed by: @fclem
See D5115 for more details
* Follow Blender code style a bit more closely
* Fix mixed tabs and spaces
* Remove old README now that it's part of the script
* Make less tied to specific Blender version numbers
Pre-calculates values needed for unprojecting to avoid
a matrix invert and extracting projection matrix dimensions for
every call to GPU_matrix_unproject.
Use for gizmo selection drawing.
Using a capitalized app name fits the platform guidelines. Since macOS file
systems are case insensitive by default this should not break scripts that
assume lowercase.
Separate temporary windows, like Preferences, should be restored (if minimized) before bringing to top
Differential Revision: https://developer.blender.org/D5105
Reviewed by Brecht Van Lommel
This solution checks if `persp_mat` has changed. If positive, the selection buffer is redrawn.
Differential Revision: https://developer.blender.org/D5081
Switch to Gregory basis patches which are tangent continuous across their
boundaries.
Originally we've used BSpline basis patches to be more compatible with the
old subdivision code, but a lot of things changed anyway.