mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:37:35 +00:00
PixelPaint: Use the parallel ImageProcessor to apply filters
The main advantage of this change is that heavy-weight filters do not lock up the GUI anymore. This first cut has several flaws: - We do not account for modification of the referenced images while the filter is running. Depending on the exact filter behavior this might have all sorts of weird effects. A simple fix would be to show a progress dialog to the user, preventing them from performing other modifications in the meantime. - We do not use the image processor for previews. Preview behavior has a couple of other considerations that are intentionally not addressed in this commit or pull request.
This commit is contained in:
parent
ade868aa56
commit
5294fd671e
3 changed files with 10 additions and 6 deletions
|
@ -20,7 +20,7 @@ void FilterApplicationCommand::execute()
|
|||
m_filter->m_editor->gui_event_loop().deferred_invoke([strong_this = NonnullRefPtr(*this)]() {
|
||||
// HACK: we can't tell strong_this to not be const
|
||||
(*const_cast<NonnullRefPtr<Layer>*>(&strong_this->m_target_layer))->did_modify_bitmap(strong_this->m_target_layer->rect());
|
||||
strong_this->m_filter->m_editor->did_complete_action();
|
||||
strong_this->m_filter->m_editor->did_complete_action(String::formatted("Filter {}", strong_this->m_filter->filter_name()));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue