Fix ARGB images save when using WebP.

Upload artifacts.
This commit is contained in:
Martín Lucas Golini
2025-10-25 02:52:21 -03:00
parent 4f42b4ad14
commit 521631decf
12 changed files with 90 additions and 35 deletions
+6
View File
@@ -538,6 +538,12 @@
"command": "${project_root}/bin/ecode",
"name": "ecode-release",
"working_dir": "${project_root}/bin/"
},
{
"args": "",
"command": "${project_root}/bin/unit_tests/eepp-unit_tests-debug",
"name": "eepp-unit_test-debug",
"working_dir": "${project_root}/bin/"
}
],
"var": {
@@ -39,3 +39,20 @@ jobs:
run: |
cd bin/unit_tests
xvfb-run ./eepp-unit_tests
- name: Upload test artifacts if folder exists
if: always()
run: |
if [ -d bin/unit_tests/output ]; then
echo "Artifact folder exists (bin/unit_tests/output), uploading..."
exit 0
else
echo "No artifact folder (bin/unit_tests/output), tests passed, skipping upload."
exit 0
fi
id: upload-check
- name: Upload artifacts
if: always() && steps.upload-check.outputs.result == '0' && exists('bin/unit_tests/output')
uses: actions/upload-artifact@v4
with:
name: linux-test-output
path: bin/unit_tests/output/*
@@ -25,3 +25,20 @@ jobs:
run: |
cd bin/unit_tests
./eepp-unit_tests
- name: Upload test artifacts if folder exists
if: always()
run: |
if [ -d bin/unit_tests/output ]; then
echo "Artifact folder exists, uploading..."
exit 0
else
echo "No artifact folder (bin/unit_tests/output), tests passed, skipping upload."
exit 0
fi
id: upload-check
- name: Upload artifacts
if: always() && steps.upload-check.outputs.result == '0' && exists('bin/unit_tests/output')
uses: actions/upload-artifact@v4
with:
name: macos-test-output
path: bin/unit_tests/output/*
@@ -51,3 +51,21 @@ jobs:
set LIBGL_ALWAYS_SOFTWARE=1
set GALLIUM_DRIVER=llvmpipe
bin\unit_tests\eepp-unit_tests.exe
- name: Upload test artifacts if folder exists
if: always()
shell: cmd
run: |
if exist bin\unit_tests\output (
echo Artifact folder exists, uploading...
exit 0
) else (
echo No artifact folder (bin\unit_tests\output), tests passed, skipping upload.
exit 0
)
id: upload-check
- name: Upload artifacts
if: always() && steps.upload-check.outputs.result == '0' && exists('bin/unit_tests/output')
uses: actions/upload-artifact@v4
with:
name: windows-test-output
path: bin\unit_tests\output\*
+1
View File
@@ -69,6 +69,7 @@ ecode.dmg
/compile_commands.json
/bin/unit_tests/eepp*
/bin/unit_tests/lib*
/bin/unit_tests/output/*
/projects/linux/ecode/polyfill-glibc
/bin/crashes/*
/bin/config/*
+14 -10
View File
@@ -49,7 +49,8 @@ class WindowSettings {
Uint32 style = WindowStyle::Default,
WindowBackend backend = WindowBackend::Default, Uint32 bpp = 32,
const std::string& icon = std::string(), const Float& pixelDensity = 1,
const bool& useScreenKeyboard = EE_SCREEN_KEYBOARD_ENABLED ) :
const bool& useScreenKeyboard = EE_SCREEN_KEYBOARD_ENABLED,
bool disableHiDPI = false ) :
Style( style ),
Width( width ),
Height( height ),
@@ -58,7 +59,8 @@ class WindowSettings {
Title( title ),
Backend( backend ),
PixelDensity( pixelDensity ),
UseScreenKeyboard( useScreenKeyboard ) {}
UseScreenKeyboard( useScreenKeyboard ),
DisableHiDPI( disableHiDPI ) {}
inline WindowSettings() :
Style( WindowStyle::Default ),
@@ -67,17 +69,19 @@ class WindowSettings {
BitsPerPixel( 32 ),
Backend( WindowBackend::Default ),
PixelDensity( 1 ),
UseScreenKeyboard( EE_SCREEN_KEYBOARD_ENABLED ) {}
UseScreenKeyboard( EE_SCREEN_KEYBOARD_ENABLED ),
DisableHiDPI( false ) {}
Uint32 Style;
Uint32 Width; //! In screen coordinates (pixels * scale)
Uint32 Height; //! In screen coordinates (pixels * scale)
Uint32 BitsPerPixel;
Uint32 Style{ WindowStyle::Default };
Uint32 Width{ 800 }; //! In screen coordinates (pixels * scale)
Uint32 Height{ 600 }; //! In screen coordinates (pixels * scale)
Uint32 BitsPerPixel{ 32 };
std::string Icon;
std::string Title;
WindowBackend Backend;
Float PixelDensity;
bool UseScreenKeyboard;
WindowBackend Backend{ WindowBackend::Default };
Float PixelDensity{ 1 };
bool UseScreenKeyboard{ EE_SCREEN_KEYBOARD_ENABLED };
bool DisableHiDPI{ false };
};
/** @brief ContextSettings Small class that contains the renderer context information */
+1 -1
View File
@@ -1471,7 +1471,7 @@ solution "eepp"
set_targetdir("libs/" .. os.get_real() .. "/")
build_eepp( "eepp" )
postsymlinklib("../libs/" .. os.get_real() .. "/", "../../bin/", "eepp" )
postsymlinklib("../libs/" .. os.get_real() .. "/", "../../bin/unit_tests/", "eepp" )
postsymlinklib("../../libs/" .. os.get_real() .. "/", "../../bin/unit_tests/", "eepp" )
-- Examples
project "eepp-external-shader"
-7
View File
@@ -17,10 +17,3 @@ fi
cd ../../make/macosx/
make -j$(sysctl -n hw.ncpu) $@
cd ../../bin/
ln -sf ../libs/macosx/"$USE_ARCH"libeepp.dylib .
ln -sf ../libs/macosx/"$USE_ARCH"libeepp-debug.dylib .
if [ -f ../libs/macosx/"$USE_ARCH"libeepp-maps-debug.dylib ]; then
ln -sf ../libs/macosx/"$USE_ARCH"libeepp-maps-debug.dylib .
fi
-7
View File
@@ -17,10 +17,3 @@ fi
cd ../../make/macosx/
make -j$(sysctl -n hw.ncpu) $@
cd ../../bin/
ln -sf ../libs/macosx/"$USE_ARCH"libeepp.dylib .
ln -sf ../libs/macosx/"$USE_ARCH"libeepp-debug.dylib .
if [ -f ../libs/macosx/"$USE_ARCH"libeepp-maps-debug.dylib ]; then
ln -sf ../libs/macosx/"$USE_ARCH"libeepp-maps-debug.dylib .
fi
+1 -1
View File
@@ -982,7 +982,7 @@ std::vector<Uint8> webpPacker( const Image& img, Uint32 quality, Uint32 compress
if ( img.getChannels() == 3 ) {
successImport = WebPPictureImportRGB( &pic, r, 3 * s.getWidth() );
} else {
successImport = WebPPictureImportRGBA( &pic, r, 4 * s.getHeight() );
successImport = WebPPictureImportRGBA( &pic, r, 4 * s.getWidth() );
}
bool successEncode = false;
+2 -1
View File
@@ -289,7 +289,8 @@ bool WindowSDL::create( WindowSettings Settings, ContextSettings Context ) {
mWindow.WindowConfig.Height = mWindow.DesktopResolution.getHeight();
}
mWindow.Flags = SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_ALLOW_HIGHDPI;
mWindow.Flags = SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN |
( ( !mWindow.WindowConfig.DisableHiDPI ? SDL_WINDOW_ALLOW_HIGHDPI : 0 ) );
if ( mWindow.WindowConfig.Style & WindowStyle::Resize ) {
mWindow.Flags |= SDL_WINDOW_RESIZABLE;
+13 -8
View File
@@ -7,7 +7,9 @@ using namespace EE::System;
UTEST( FontRendering, fontsTest ) {
FileSystem::changeWorkingDirectory( Sys::getProcessPath() );
auto win = Engine::instance()->createWindow( WindowSettings( 1220, 850, "eepp - Fonts" ) );
auto win = Engine::instance()->createWindow(
WindowSettings( 1220, 850, "eepp - Fonts", WindowStyle::Default, WindowBackend::Default, 32,
{}, 1, false, true ) );
if ( !win->isOpen() ) {
std::cout << "OpenGL context not available, skipping" << std::endl;
@@ -104,7 +106,7 @@ UTEST( FontRendering, fontsTest ) {
text3.draw( std::floor( ( win->getWidth() - text3.getTextWidth() ) * 0.5f ), 560 );
text4.draw( std::floor( ( win->getWidth() - text4.getTextWidth() ) * 0.5f ), 590 );
text5.draw( std::floor( ( win->getWidth() - text5.getTextWidth() ) * 0.5f ), 640 );
text6.draw( std::floor( ( win->getWidth() - text6.getTextWidth() ) * 0.5f ), 690 );
text6.draw( 19 + std::floor( ( win->getWidth() - text6.getTextWidth() ) * 0.5f ), 690 );
{
Image::FormatConfiguration fconf;
@@ -124,6 +126,9 @@ UTEST( FontRendering, fontsTest ) {
Image::DiffResult result = actualImage.diff( expectedImage );
EXPECT_EQ_MSG( expectedImage.getWidth(), actualImage.getWidth(), "Images width not equal" );
EXPECT_EQ_MSG( expectedImage.getHeight(), actualImage.getHeight(),
"Images height not equal" );
EXPECT_TRUE( result.areSame() );
if ( !result.areSame() ) {
@@ -131,16 +136,16 @@ UTEST( FontRendering, fontsTest ) {
<< std::endl;
std::cerr << "Maximum perceptual difference (Delta E): " << result.maxDeltaE
<< std::endl;
if ( !FileSystem::fileExists( "output" ) )
FileSystem::makeDir( "output" );
std::string actualImagePath = "output/eepp-fonts_actual_output." + saveExt;
actualImage.saveToFile( actualImagePath, saveType );
std::cerr << "Actual image saved to: " << actualImagePath << std::endl;
if ( result.diffImage ) {
std::string actualImagePath =
Sys::getTempPath() + "eepp-fonts_actual_output." + saveExt;
std::string diffImagePath =
Sys::getTempPath() + "eepp-fonts_diff_output." + saveExt;
std::string diffImagePath = "output/eepp-fonts_diff_output." + saveExt;
result.diffImage->setImageFormatConfiguration( fconf );
result.diffImage->saveToFile( diffImagePath, saveType );
actualImage.saveToFile( actualImagePath, saveType );
std::cerr << "Visual diff saved to: " << diffImagePath << std::endl;
std::cerr << "Actual image saved to: " << actualImagePath << std::endl;
}
}
}