Compare commits

..

1 Commits

Author SHA1 Message Date
Martín Capello d40bb219b3
Merge 5d8a50d009 into fa0b25fe87 2025-09-26 12:05:21 +00:00
10 changed files with 8 additions and 36 deletions

2
laf

@ -1 +1 @@
Subproject commit 39706c11063fb53cf4c8e865102c6f71e2606906
Subproject commit de781a5066732d700ac4520ee5fc9034e92875ad

View File

@ -325,15 +325,10 @@ void FilterManagerImpl::applyToTarget()
void FilterManagerImpl::initTransaction()
{
ASSERT(!m_tx);
m_writer = std::make_unique<ContextWriter>(m_reader);
m_writer.reset(new ContextWriter(m_reader));
m_tx.reset(new Tx(*m_writer, m_filter->getName(), ModifyDocument));
}
void FilterManagerImpl::updateWriterThread()
{
document()->updateWriterThread();
}
bool FilterManagerImpl::isTransaction() const
{
return (m_tx != nullptr);

View File

@ -93,7 +93,6 @@ public:
void applyToTarget();
void initTransaction();
void updateWriterThread();
bool isTransaction() const;
void commitTransaction();

View File

@ -118,13 +118,7 @@ FilterWorker::~FilterWorker()
void FilterWorker::run()
{
// Initialize writing transaction from the main thread. This is
// required to get the activeSite() from the UIContext from
// CmdTransaction::calcSpritePosition().
//
// The document will keep the UI thread associated as the "writer"
// thread, but that will be updated later in
// applyFilterInBackground() with the worker thread ID.
// Initialize writting transaction
m_filterMgr->initTransaction();
std::thread thread;
@ -188,11 +182,6 @@ bool FilterWorker::isCancelled()
void FilterWorker::applyFilterInBackground()
{
try {
// This background thread is the new writer. This is required to
// avoid read-locking from the UI thread from Editor and Timeline
// onPaint() events.
m_filterMgr->updateWriterThread();
// Apply the filter
m_filterMgr->applyToTarget();

View File

@ -124,11 +124,6 @@ Doc::LockResult Doc::upgradeToWrite(int timeout)
return res;
}
void Doc::updateWriterThread()
{
m_rwLock.updateWriterThread();
}
void Doc::downgradeToRead(LockResult lockResult)
{
DOC_TRACE("DOC: downgradeToRead", this, (int)lockResult);

View File

@ -82,7 +82,6 @@ public:
LockResult readLock(int timeout);
LockResult writeLock(int timeout);
LockResult upgradeToWrite(int timeout);
void updateWriterThread();
void downgradeToRead(LockResult lockResult);
void unlock(LockResult lockResult);

View File

@ -2812,7 +2812,7 @@ void Editor::pasteImage(const Image* image, const Mask* mask, const gfx::Point*
ASSERT(image);
std::unique_ptr<Mask> temp_mask;
if (!mask || mask->bounds().isEmpty()) {
if (!mask) {
gfx::Rect visibleBounds = getVisibleSpriteBounds();
gfx::Rect imageBounds = image->bounds();

View File

@ -4631,13 +4631,13 @@ void Timeline::onDrop(ui::DragEvent& e)
std::string txmsg;
std::unique_ptr<docapi::DocProvider> docProvider = nullptr;
if (droppedImage) {
txmsg = "Drop Image";
txmsg = "Dropped image on timeline";
doc::ImageRef image = nullptr;
convert_surface_to_image(surface.get(), 0, 0, surface->width(), surface->height(), image);
docProvider = std::make_unique<DocProviderFromImage>(image);
}
else {
txmsg = "Drop File";
txmsg = "Dropped paths on timeline";
docProvider = std::make_unique<DocProviderFromPaths>(m_document->context(), paths);
}

View File

@ -25,7 +25,6 @@
#include "app/ui/workspace.h"
#include "app/ui/workspace_tabs.h"
#include "doc/sprite.h"
#include "ui/manager.h"
#include "ui/system.h"
#include <algorithm>
@ -121,10 +120,6 @@ void UIContext::setActiveView(DocView* docView)
mainWin->getTimeline()->updateUsingEditor(editor);
mainWin->getPreviewEditor()->updateUsingEditor(editor);
// Update mouse widgets immediately after changing views rather
// than waiting for mouse movement.
mainWin->manager()->_updateMouseWidgets();
// Change the image-type of color bar.
ColorBar::instance()->setPixelFormat(app_get_current_pixel_format());

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (c) 2024-2025 Igara Studio S.A.
// Copyright (c) 2024 Igara Studio S.A.
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
@ -26,7 +26,7 @@ uint32_t convert_color_to_image(gfx::Color c, const os::SurfaceFormatData* fd)
uint8_t b = ((c & fd->blueMask) >> fd->blueShift);
uint8_t a = ((c & fd->alphaMask) >> fd->alphaShift);
if (a > 0 && fd->pixelAlpha == os::PixelAlpha::kPremultiplied) {
if (fd->pixelAlpha == os::PixelAlpha::kPremultiplied) {
r = r * 255 / a;
g = g * 255 / a;
b = b * 255 / a;