mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-02 11:59:58 +00:00
Fix RenderTaskJob compilation on MSVC
We cannot refer the "job" instance in the lambda captures on the same statement on MSVC compiler.
This commit is contained in:
parent
239ac42378
commit
93d59f87e9
@ -485,8 +485,8 @@ void ChangePixelFormatCommand::onExecute(Context* context)
|
||||
return;
|
||||
|
||||
{
|
||||
RenderTaskJob job(
|
||||
"Converting Color Mode",
|
||||
RenderTaskJob job("Converting Color Mode");
|
||||
job.startJob(
|
||||
[this, &job, context, flatten]{
|
||||
ContextWriter writer(context);
|
||||
Transaction transaction(writer.context(), "Color Mode Change");
|
||||
@ -503,7 +503,6 @@ void ChangePixelFormatCommand::onExecute(Context* context)
|
||||
if (!job.isCanceled())
|
||||
transaction.commit();
|
||||
});
|
||||
job.startJob();
|
||||
job.waitJob();
|
||||
}
|
||||
|
||||
|
@ -114,14 +114,13 @@ void ColorQuantizationCommand::onExecute(Context* context)
|
||||
|
||||
Palette tmpPalette(frame, entries.picks());
|
||||
|
||||
RenderTaskJob job(
|
||||
"Creating Palette",
|
||||
RenderTaskJob job("Creating Palette");
|
||||
job.startJob(
|
||||
[sprite, withAlpha, &tmpPalette, &job]{
|
||||
render::create_palette_from_sprite(
|
||||
sprite, 0, sprite->lastFrame(),
|
||||
withAlpha, &tmpPalette, &job);
|
||||
});
|
||||
job.startJob();
|
||||
job.waitJob();
|
||||
if (job.isCanceled())
|
||||
return;
|
||||
|
@ -18,10 +18,14 @@ namespace app {
|
||||
class RenderTaskJob : public Job,
|
||||
public render::TaskDelegate {
|
||||
public:
|
||||
RenderTaskJob(const char* jobName)
|
||||
: Job(jobName) {
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
RenderTaskJob(const char* jobName, T&& func)
|
||||
: Job(jobName)
|
||||
, m_func(std::move(func)) {
|
||||
void startJob(T&& func) {
|
||||
m_func = std::move(func);
|
||||
Job::startJob();
|
||||
}
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user