Don't access newBlend preference from background threads

Continuation of 673e1955fa
This commit is contained in:
David Capello 2019-04-01 15:29:48 -03:00
parent 9c98f9c4df
commit c6fb34ef4a
4 changed files with 5 additions and 3 deletions

View File

@ -175,6 +175,8 @@ namespace app {
void setEmbeddedColorProfile() { m_embeddedColorProfile = true; }
bool hasEmbeddedColorProfile() const { return m_embeddedColorProfile; }
bool newBlend() const { return m_newBlend; }
private:
FileOp(); // Undefined
FileOp(FileOpType type, Context* context);

View File

@ -217,7 +217,7 @@ bool FliFormat::onSave(FileOp* fop)
// Create the bitmaps
ImageRef bmp(Image::create(IMAGE_INDEXED, sprite->width(), sprite->height()));
render::Render render;
render.setNewBlend(Preferences::instance().experimental.newBlend());
render.setNewBlend(fop->newBlend());
// Write frame by frame
flic::Frame fliFrame;

View File

@ -1333,7 +1333,7 @@ private:
void renderFrame(frame_t frame, Image* dst) {
render::Render render;
render.setNewBlend(Preferences::instance().experimental.newBlend());
render.setNewBlend(m_fop->newBlend());
render.setBgType(render::BgType::NONE);
clear_image(dst, m_clearColor);

View File

@ -285,7 +285,7 @@ bool IcoFormat::onSave(FileOp* fop)
sprite->height()));
render::Render render;
render.setNewBlend(Preferences::instance().experimental.newBlend());
render.setNewBlend(fop->newBlend());
for (n=frame_t(0); n<num; ++n) {
render.renderSprite(image.get(), sprite, n);