Compare commits

...

10 Commits

Author SHA1 Message Date
Azamat H. Hackimov 72772c8024
Merge 25c629f5ed into 577caa4793 2025-10-01 14:34:00 +03:30
David Capello 577caa4793 Reword action names when dropping files/images onto the timeline
build / build (Debug, macos-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, macos-latest, noscripts, cli) (push) Has been cancelled Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Has been cancelled Details
build / build (Debug, windows-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, windows-latest, noscripts, cli) (push) Has been cancelled Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Has been cancelled Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Has been cancelled Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Has been cancelled Details
2025-09-30 08:26:44 -03:00
David Capello f3a372e78e Fix div by zero crash dropping image (fix #5447) 2025-09-30 08:24:50 -03:00
Joshua Lopez 41e5097c33 Fix mouse gestures not working after switching tabs (fix aseprite#4388)
build / build (Debug, macos-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, macos-latest, noscripts, cli) (push) Waiting to run Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Waiting to run Details
build / build (Debug, windows-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, windows-latest, noscripts, cli) (push) Waiting to run Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Waiting to run Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Waiting to run Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Waiting to run Details
2025-09-29 18:06:45 -03:00
Christian Kaiser cf290b7679 Check mask validity before pasting (fix #5361)
build / build (Debug, macos-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, macos-latest, noscripts, cli) (push) Waiting to run Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Waiting to run Details
build / build (Debug, windows-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, windows-latest, noscripts, cli) (push) Waiting to run Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Waiting to run Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Waiting to run Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Waiting to run Details
2025-09-29 11:32:39 -03:00
David Capello d7b2faca6d Fix crash painting deleted cels while applying filter (fix #4991)
build / build (Debug, macos-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, macos-latest, noscripts, cli) (push) Waiting to run Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Waiting to run Details
build / build (Debug, windows-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, windows-latest, noscripts, cli) (push) Waiting to run Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Waiting to run Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Waiting to run Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Waiting to run Details
build-auto / build-auto (Debug, macos-latest) (push) Has been cancelled Details
build-auto / build-auto (Debug, ubuntu-latest) (push) Has been cancelled Details
build-auto / build-auto (Debug, windows-latest) (push) Has been cancelled Details
build-auto / build-auto (RelWithDebInfo, macos-latest) (push) Has been cancelled Details
build-auto / build-auto (RelWithDebInfo, ubuntu-latest) (push) Has been cancelled Details
build-auto / build-auto (RelWithDebInfo, windows-latest) (push) Has been cancelled Details
This could happen in the Editor::onPaint() or Timeline::onPaint().
2025-09-24 16:36:34 -03:00
David Capello f26ce64208 [lua] Update scripting API version to 36 2025-09-22 09:04:57 -03:00
Azamat H. Hackimov 25c629f5ed Switch TinyEXIF to use CPM.cmake
Use imported target `TinyEXIF` to simplify including a library to the
project.
2025-07-31 14:46:18 +03:00
Azamat H. Hackimov 224f126b6b Switch tinyxml2 to use CPM.cmake
Use imported target `tinyxml2::tinyxml2` to simplify including a
library to the project.
2025-07-31 14:46:01 +03:00
Azamat H. Hackimov fbd00b2d1a Add CPM.cmake module for dependency handling
CPM provides easy interface for third_party dependency handling, which
includes downloading, building and exporting targets into the project.
2025-07-31 14:37:15 +03:00
22 changed files with 1445 additions and 42 deletions

3
.gitignore vendored
View File

@ -18,3 +18,6 @@ build
.build
.deps
CMakeSettings.json
# third_party exclusions
third_party/tinyexif
third_party/tinyxml2

6
.gitmodules vendored
View File

@ -75,9 +75,3 @@
[submodule "third_party/qoi"]
path = third_party/qoi
url = https://github.com/aseprite/qoi.git
[submodule "third_party/tinyxml2"]
path = third_party/tinyxml2
url = https://github.com/aseprite/tinyxml2.git
[submodule "third_party/TinyEXIF"]
path = third_party/TinyEXIF
url = https://github.com/aseprite/TinyEXIF.git

View File

@ -54,6 +54,9 @@ if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/laf/CMakeLists.txt" OR
" https://github.com/aseprite/aseprite/blob/main/INSTALL.md#get-the-source-code")
endif()
set(CPM_SOURCE_CACHE third_party)
include(cmake/CPM.cmake)
# This is required for KDE/Qt destop integration, which sets
# BUILD_SHARED_LIBS to TRUE by default
set(BUILD_SHARED_LIBS off)
@ -262,23 +265,25 @@ add_definitions(-DPNG_NO_MMX_CODE) # Do not use MMX optimizations in PNG code
# tinyxml2
if(USE_SHARED_TINYXML)
find_library(TINYXML_LIBRARY NAMES tinyxml2)
find_path(TINYXML_INCLUDE_DIR NAMES tinyxml2.h)
find_package(tinyxml2 REQUIRED)
else()
set(TINYXML_LIBRARY tinyxml2)
set(TINYXML_INCLUDE_DIR ${TINYXML_DIR})
CPMAddPackage(
URI "gh:aseprite/tinyxml2#312a8092245df393db14a0b2427457ed2ba75e1b"
OPTIONS "tinyxml2_BUILD_TESTING OFF"
)
endif()
include_directories(${TINYXML_INCLUDE_DIR})
# TinyEXIF
if(USE_SHARED_TINYEXIF)
find_library(TINYEXIF_LIBRARY NAMES TinyEXIF)
find_path(TINYEXIF_INCLUDE_DIR NAMES TinyEXIF.h)
find_package(TinyEXIF REQUIRED)
set(TINYEXIF_LIBRARY TinyEXIF)
else()
CPMAddPackage(
URI "gh:aseprite/TinyEXIF#21d6cf762724260f8e5bcee4abdee5411ae47813"
OPTIONS "BUILD_SHARED_LIBS OFF" "BUILD_STATIC_LIBS ON" "LINK_CRT_STATIC_LIBS OFF" "BUILD_DEMO OFF"
)
set(TINYEXIF_LIBRARY TinyEXIFstatic)
set(TINYEXIF_INCLUDE_DIR ${TINYEXIF_DIR})
endif()
include_directories(${TINYEXIF_INCLUDE_DIR})
# pixman
if(USE_SHARED_PIXMAN)

1363
cmake/CPM.cmake Normal file

File diff suppressed because it is too large Load Diff

View File

@ -2,6 +2,7 @@ Aseprite uses the following open source projects:
* [Allegro 4](http://liballeg.org/)
* [Bresenham algorithm implementations by Alois Zingl](http://members.chello.at/easyfilter/bresenham.html)
* [CPM.cmake](https://github.com/cpm-cmake/CPM.cmake)
* [cityhash](https://github.com/google/cityhash)
* [cmark](https://github.com/jgm/cmark)
* [curl](http://curl.haxx.se/)
@ -82,6 +83,30 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
# [CPM.cmake](https://github.com/cpm-cmake/CPM.cmake)
```
Copyright (c) 2019-2022 Lars Melchior and contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
# [cityhash](https://github.com/google/cityhash)
```

2
laf

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

View File

@ -768,7 +768,7 @@ target_link_libraries(app-lib
updater-lib
undo
${CMARK_LIBRARIES}
${TINYXML_LIBRARY}
tinyxml2::tinyxml2
${TINYEXIF_LIBRARY}
${GIF_LIBRARIES}
${PNG_LIBRARIES}

View File

@ -325,10 +325,15 @@ void FilterManagerImpl::applyToTarget()
void FilterManagerImpl::initTransaction()
{
ASSERT(!m_tx);
m_writer.reset(new ContextWriter(m_reader));
m_writer = std::make_unique<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,6 +93,7 @@ public:
void applyToTarget();
void initTransaction();
void updateWriterThread();
bool isTransaction() const;
void commitTransaction();

View File

@ -118,7 +118,13 @@ FilterWorker::~FilterWorker()
void FilterWorker::run()
{
// Initialize writting transaction
// 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.
m_filterMgr->initTransaction();
std::thread thread;
@ -182,6 +188,11 @@ 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,6 +124,11 @@ 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,6 +82,7 @@ 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

@ -10,6 +10,6 @@
// Increment this value if the scripting API is modified between two
// released Aseprite versions.
#define API_VERSION 35
#define API_VERSION 36
#endif

View File

@ -2763,7 +2763,7 @@ void Editor::pasteImage(const Image* image, const Mask* mask, const gfx::Point*
ASSERT(image);
std::unique_ptr<Mask> temp_mask;
if (!mask) {
if (!mask || mask->bounds().isEmpty()) {
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 = "Dropped image on timeline";
txmsg = "Drop Image";
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 = "Dropped paths on timeline";
txmsg = "Drop File";
docProvider = std::make_unique<DocProviderFromPaths>(m_document->context(), paths);
}

View File

@ -25,6 +25,7 @@
#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>
@ -120,6 +121,10 @@ 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 Igara Studio S.A.
// Copyright (c) 2024-2025 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 (fd->pixelAlpha == os::PixelAlpha::kPremultiplied) {
if (a > 0 && fd->pixelAlpha == os::PixelAlpha::kPremultiplied) {
r = r * 255 / a;
g = g * 255 / a;
b = b * 255 / a;

View File

@ -18,4 +18,4 @@ endif()
target_link_libraries(gen
laf-base
cfg-lib
${TINYXML_LIBRARY})
tinyxml2::tinyxml2)

View File

@ -11,5 +11,5 @@ target_link_libraries(updater-lib laf-base ver-lib)
# portion of the library.
if(ENABLE_UPDATER)
target_sources(updater-lib PRIVATE check_update.cpp)
target_link_libraries(updater-lib net-lib ${TINYXML_LIBRARY})
target_link_libraries(updater-lib net-lib tinyxml2::tinyxml2)
endif()

View File

@ -51,19 +51,6 @@ if(ENABLE_WEBP AND NOT LAF_BACKEND STREQUAL "skia")
endif()
endif()
if(NOT USE_SHARED_TINYXML)
set(tinyxml2_BUILD_TESTING OFF CACHE BOOL "Build tests for tinyxml2")
add_subdirectory(tinyxml2)
endif()
if(NOT USE_SHARED_TINYEXIF)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "build as shared library")
set(BUILD_STATIC_LIBS ON CACHE BOOL "build as static library")
set(LINK_CRT_STATIC_LIBS OFF CACHE BOOL "link CRT static library")
set(BUILD_DEMO OFF CACHE BOOL "build demo binary")
add_subdirectory(TinyEXIF)
endif()
if(REQUIRE_CURL AND NOT USE_SHARED_CURL)
set(BUILD_RELEASE_DEBUG_DIRS ON BOOL)
set(BUILD_CURL_EXE OFF CACHE BOOL "Set to ON to build curl executable.")

@ -1 +0,0 @@
Subproject commit 21d6cf762724260f8e5bcee4abdee5411ae47813

@ -1 +0,0 @@
Subproject commit 312a8092245df393db14a0b2427457ed2ba75e1b