mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-25 10:43:46 +00:00
We cannot create a ContextReader in the filter background thread
This is because ContextReader gets the activeSite, which (in case of the UIContext) asks to the UI thread this information (app::Editor).
This commit is contained in:
parent
f248d8ed65
commit
b5547251f5
@ -50,8 +50,8 @@ using namespace std;
|
|||||||
using namespace ui;
|
using namespace ui;
|
||||||
|
|
||||||
FilterManagerImpl::FilterManagerImpl(Context* context, Filter* filter)
|
FilterManagerImpl::FilterManagerImpl(Context* context, Filter* filter)
|
||||||
: m_context(context)
|
: m_reader(context)
|
||||||
, m_site(context->activeSite())
|
, m_site(*const_cast<Site*>(m_reader.site()))
|
||||||
, m_filter(filter)
|
, m_filter(filter)
|
||||||
, m_cel(nullptr)
|
, m_cel(nullptr)
|
||||||
, m_src(nullptr)
|
, m_src(nullptr)
|
||||||
@ -281,8 +281,7 @@ void FilterManagerImpl::applyToTarget()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Initialize writting operation
|
// Initialize writting operation
|
||||||
ContextReader reader(m_context);
|
ContextWriter writer(m_reader);
|
||||||
ContextWriter writer(reader);
|
|
||||||
m_tx.reset(new Tx(writer.context(), m_filter->getName(), ModifyDocument));
|
m_tx.reset(new Tx(writer.context(), m_filter->getName(), ModifyDocument));
|
||||||
|
|
||||||
m_progressBase = 0.0f;
|
m_progressBase = 0.0f;
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "app/commands/filters/cels_target.h"
|
#include "app/commands/filters/cels_target.h"
|
||||||
|
#include "app/context_access.h"
|
||||||
#include "app/site.h"
|
#include "app/site.h"
|
||||||
#include "app/tx.h"
|
#include "app/tx.h"
|
||||||
#include "base/exception.h"
|
#include "base/exception.h"
|
||||||
@ -139,8 +140,8 @@ namespace app {
|
|||||||
void redrawColorPalette();
|
void redrawColorPalette();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Context* m_context;
|
ContextReader m_reader;
|
||||||
Site m_site;
|
Site& m_site;
|
||||||
Filter* m_filter;
|
Filter* m_filter;
|
||||||
doc::Cel* m_cel;
|
doc::Cel* m_cel;
|
||||||
doc::ImageRef m_src;
|
doc::ImageRef m_src;
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
#include "app/app.h"
|
#include "app/app.h"
|
||||||
#include "app/commands/filters/filter_manager_impl.h"
|
#include "app/commands/filters/filter_manager_impl.h"
|
||||||
#include "app/console.h"
|
#include "app/console.h"
|
||||||
|
#include "app/context_access.h"
|
||||||
#include "app/i18n/strings.h"
|
#include "app/i18n/strings.h"
|
||||||
#include "app/ini_file.h"
|
#include "app/ini_file.h"
|
||||||
#include "app/modules/editors.h"
|
#include "app/modules/editors.h"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user