unload brush texture from main memory, preload brush on preview to free render thread

This commit is contained in:
2019-03-01 23:28:30 +01:00
parent 0be47c7fb6
commit 1edbc27ae6
5 changed files with 84 additions and 13 deletions

View File

@@ -487,10 +487,19 @@ void NodeStrokePreview::draw_stroke()
auto node = s_queue.Get();
if (node)
{
// if the brush is not already loaded, load it and then destroy it
bool to_unload = (node->m_brush->m_tip_texture == nullptr);
node->m_brush->preload();
node->async_start();
gl_state gl;
gl.save();
node->m_brush->load();
node->draw_stroke_immediate();
if (to_unload)
node->m_brush->unload();
gl.restore();
node->app_redraw();
node->async_end();