mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-01 01:13:40 +00:00
Refactor to remove filter_worker.h
This commit is contained in:
parent
08b3e76719
commit
4dd2b1877d
@ -13,7 +13,6 @@
|
|||||||
#include "app/commands/command.h"
|
#include "app/commands/command.h"
|
||||||
#include "app/commands/filters/filter_manager_impl.h"
|
#include "app/commands/filters/filter_manager_impl.h"
|
||||||
#include "app/commands/filters/filter_window.h"
|
#include "app/commands/filters/filter_window.h"
|
||||||
#include "app/commands/filters/filter_worker.h"
|
|
||||||
#include "app/commands/new_params.h"
|
#include "app/commands/new_params.h"
|
||||||
#include "app/context.h"
|
#include "app/context.h"
|
||||||
#include "app/ini_file.h"
|
#include "app/ini_file.h"
|
||||||
@ -120,7 +119,7 @@ void BrightnessContrastCommand::onExecute(Context* context)
|
|||||||
window.doModal();
|
window.doModal();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
start_filter_worker(&filterMgr);
|
filterMgr.startWorker();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
#include "app/commands/filters/color_curve_editor.h"
|
#include "app/commands/filters/color_curve_editor.h"
|
||||||
#include "app/commands/filters/filter_manager_impl.h"
|
#include "app/commands/filters/filter_manager_impl.h"
|
||||||
#include "app/commands/filters/filter_window.h"
|
#include "app/commands/filters/filter_window.h"
|
||||||
#include "app/commands/filters/filter_worker.h"
|
|
||||||
#include "app/commands/new_params.h"
|
#include "app/commands/new_params.h"
|
||||||
#include "app/context.h"
|
#include "app/context.h"
|
||||||
#include "app/ini_file.h"
|
#include "app/ini_file.h"
|
||||||
@ -130,7 +129,7 @@ void ColorCurveCommand::onExecute(Context* context)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
start_filter_worker(&filterMgr);
|
filterMgr.startWorker();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
#include "app/commands/filters/convolution_matrix_stock.h"
|
#include "app/commands/filters/convolution_matrix_stock.h"
|
||||||
#include "app/commands/filters/filter_manager_impl.h"
|
#include "app/commands/filters/filter_manager_impl.h"
|
||||||
#include "app/commands/filters/filter_window.h"
|
#include "app/commands/filters/filter_window.h"
|
||||||
#include "app/commands/filters/filter_worker.h"
|
|
||||||
#include "app/commands/new_params.h"
|
#include "app/commands/new_params.h"
|
||||||
#include "app/context.h"
|
#include "app/context.h"
|
||||||
#include "app/doc.h"
|
#include "app/doc.h"
|
||||||
@ -202,7 +201,7 @@ void ConvolutionMatrixCommand::onExecute(Context* context)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
start_filter_worker(&filterMgr);
|
filterMgr.startWorker();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
#include "app/commands/command.h"
|
#include "app/commands/command.h"
|
||||||
#include "app/commands/filters/filter_manager_impl.h"
|
#include "app/commands/filters/filter_manager_impl.h"
|
||||||
#include "app/commands/filters/filter_window.h"
|
#include "app/commands/filters/filter_window.h"
|
||||||
#include "app/commands/filters/filter_worker.h"
|
|
||||||
#include "app/commands/new_params.h"
|
#include "app/commands/new_params.h"
|
||||||
#include "app/context.h"
|
#include "app/context.h"
|
||||||
#include "app/doc.h"
|
#include "app/doc.h"
|
||||||
@ -152,7 +151,7 @@ void DespeckleCommand::onExecute(Context* context)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
start_filter_worker(&filterMgr);
|
filterMgr.startWorker();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
#include "app/commands/command.h"
|
#include "app/commands/command.h"
|
||||||
#include "app/commands/filters/filter_manager_impl.h"
|
#include "app/commands/filters/filter_manager_impl.h"
|
||||||
#include "app/commands/filters/filter_window.h"
|
#include "app/commands/filters/filter_window.h"
|
||||||
#include "app/commands/filters/filter_worker.h"
|
|
||||||
#include "app/commands/new_params.h"
|
#include "app/commands/new_params.h"
|
||||||
#include "app/context.h"
|
#include "app/context.h"
|
||||||
#include "app/ini_file.h"
|
#include "app/ini_file.h"
|
||||||
@ -183,7 +182,7 @@ void HueSaturationCommand::onExecute(Context* ctx)
|
|||||||
window.doModal();
|
window.doModal();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
start_filter_worker(&filterMgr);
|
filterMgr.startWorker();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
#include "app/commands/command.h"
|
#include "app/commands/command.h"
|
||||||
#include "app/commands/filters/filter_manager_impl.h"
|
#include "app/commands/filters/filter_manager_impl.h"
|
||||||
#include "app/commands/filters/filter_window.h"
|
#include "app/commands/filters/filter_window.h"
|
||||||
#include "app/commands/filters/filter_worker.h"
|
|
||||||
#include "app/commands/new_params.h"
|
#include "app/commands/new_params.h"
|
||||||
#include "app/context.h"
|
#include "app/context.h"
|
||||||
#include "app/ini_file.h"
|
#include "app/ini_file.h"
|
||||||
@ -85,7 +84,7 @@ void InvertColorCommand::onExecute(Context* context)
|
|||||||
window.doModal();
|
window.doModal();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
start_filter_worker(&filterMgr);
|
filterMgr.startWorker();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
#include "app/commands/command.h"
|
#include "app/commands/command.h"
|
||||||
#include "app/commands/filters/filter_manager_impl.h"
|
#include "app/commands/filters/filter_manager_impl.h"
|
||||||
#include "app/commands/filters/filter_window.h"
|
#include "app/commands/filters/filter_window.h"
|
||||||
#include "app/commands/filters/filter_worker.h"
|
|
||||||
#include "app/commands/new_params.h"
|
#include "app/commands/new_params.h"
|
||||||
#include "app/context.h"
|
#include "app/context.h"
|
||||||
#include "app/ini_file.h"
|
#include "app/ini_file.h"
|
||||||
@ -257,7 +256,7 @@ void OutlineCommand::onExecute(Context* context)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
start_filter_worker(&filterMgr);
|
filterMgr.startWorker();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
#include "app/commands/commands.h"
|
#include "app/commands/commands.h"
|
||||||
#include "app/commands/filters/filter_manager_impl.h"
|
#include "app/commands/filters/filter_manager_impl.h"
|
||||||
#include "app/commands/filters/filter_window.h"
|
#include "app/commands/filters/filter_window.h"
|
||||||
#include "app/commands/filters/filter_worker.h"
|
|
||||||
#include "app/commands/new_params.h"
|
#include "app/commands/new_params.h"
|
||||||
#include "app/context.h"
|
#include "app/context.h"
|
||||||
#include "app/find_widget.h"
|
#include "app/find_widget.h"
|
||||||
@ -196,7 +195,7 @@ void ReplaceColorCommand::onExecute(Context* context)
|
|||||||
set_config_int(ConfigSection, "Tolerance", filter.getTolerance());
|
set_config_int(ConfigSection, "Tolerance", filter.getTolerance());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
start_filter_worker(&filterMgr);
|
filterMgr.startWorker();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,6 +125,8 @@ namespace app {
|
|||||||
doc::Palette* getNewPalette() override;
|
doc::Palette* getNewPalette() override;
|
||||||
doc::PalettePicks getPalettePicks() override;
|
doc::PalettePicks getPalettePicks() override;
|
||||||
|
|
||||||
|
void startWorker();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void init(doc::Cel* cel);
|
void init(doc::Cel* cel);
|
||||||
void apply();
|
void apply();
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
#include "app/commands/filters/filter_window.h"
|
#include "app/commands/filters/filter_window.h"
|
||||||
|
|
||||||
#include "app/commands/filters/filter_manager_impl.h"
|
#include "app/commands/filters/filter_manager_impl.h"
|
||||||
#include "app/commands/filters/filter_worker.h"
|
|
||||||
#include "app/i18n/strings.h"
|
#include "app/i18n/strings.h"
|
||||||
#include "app/ini_file.h"
|
#include "app/ini_file.h"
|
||||||
#include "app/modules/gui.h"
|
#include "app/modules/gui.h"
|
||||||
@ -123,7 +122,7 @@ bool FilterWindow::doModal()
|
|||||||
stopPreview();
|
stopPreview();
|
||||||
|
|
||||||
// Apply the filter in background
|
// Apply the filter in background
|
||||||
start_filter_worker(m_filterMgr);
|
m_filterMgr->startWorker();
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -220,9 +220,9 @@ void FilterWorker::onMonitoringTick()
|
|||||||
//
|
//
|
||||||
// [main thread]
|
// [main thread]
|
||||||
//
|
//
|
||||||
void start_filter_worker(FilterManagerImpl* filterMgr)
|
void FilterManagerImpl::startWorker()
|
||||||
{
|
{
|
||||||
FilterWorker filterWorker(filterMgr);
|
FilterWorker filterWorker(this);
|
||||||
filterWorker.run();
|
filterWorker.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
// Aseprite
|
|
||||||
// Copyright (C) 2001-2015 David Capello
|
|
||||||
//
|
|
||||||
// This program is distributed under the terms of
|
|
||||||
// the End-User License Agreement for Aseprite.
|
|
||||||
|
|
||||||
#ifndef APP_COMMANDS_FILTERS_FILTER_BG_H_INCLUDED
|
|
||||||
#define APP_COMMANDS_FILTERS_FILTER_BG_H_INCLUDED
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
namespace app {
|
|
||||||
|
|
||||||
class FilterManagerImpl;
|
|
||||||
|
|
||||||
void start_filter_worker(FilterManagerImpl* filterMgr);
|
|
||||||
|
|
||||||
} // namespace app
|
|
||||||
|
|
||||||
#endif
|
|
Loading…
x
Reference in New Issue
Block a user