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

@@ -121,7 +121,7 @@ bool NodePanelStroke::import_abr(const std::string& path)
{
auto presets = App::I.stroke->m_presets_popup;
async_start();
if (pr->load())
if (pr->valid())
{
LOG("add preset %s", pr->m_name.c_str());
presets->add_brush(pr);
@@ -303,6 +303,7 @@ void NodePanelStroke::init_controls()
auto old_color = Canvas::I->m_current_brush->m_tip_color;
*Canvas::I->m_current_brush = *b;
Canvas::I->m_current_brush->m_tip_color = old_color;
Canvas::I->m_current_brush->load();
m_preview->draw_stroke();
m_brush_thumb->set_image(b->m_brush_thumb_path);
m_dual_brush_thumb->set_image(b->m_dual_thumb_path);