1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-03-19 17:23:33 +01:00
Commit Graph

5 Commits

Author SHA1 Message Date
David Maciejak
ef1a504898 wrlib: alpha combine speed improvement
This patch is improving the alpha combine function by using int
instead of float. That function is used for example in the
switch panel to merge the transparency mask.
The change is practically indistinguishable to the human eye
for a single-pass blend but the performance gained is huge.

I've been doing some benchmark of wrlib and even implemented AVX2 support.
But the gain compared to the complexity of AVX2 is not worth,
while having int usage in that specific function is a really good trade-off.

Here the result:

Alpha Blending Performance Test
Image size: 1024x768 (786432 pixels)
Iterations: 100

AVX2 support: YES

=== RGBA Source Test ===
Original (float):     2.540 ms/frame  (393.8 FPS)
Optimized (int):      1.983 ms/frame  (504.2 FPS)  [1.3x speedup]
AVX2 optimized:       1.843 ms/frame  (542.6 FPS)  [1.4x speedup]

By using int, the alpha blending in that use case is 28% faster.
2026-01-27 10:56:30 +00:00
Christophe CURIS
19202fd2db WRaster: Create header for i18n helper functions
This patch is just adding a single header, but because it also modifies
all the C files to add the #include, it was made as a patch on its own to
ease review.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS
79a95d7173 Fixed floating point constants defined as double but expected as float
To preserve the accuracy of the operation, the C standard request that the
mathematical operation is performed using double precision, but in many
case this is not necessary so this patch fixes a few constants to avoid
that conversion.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-24 23:25:57 +01:00
Andreas Bierfert
085224973a Fix incorrect FSF address 2013-01-07 21:19:40 +00:00
Christophe CURIS
3ed409cbd0 wrlib: Improvement in the alpha channel support.
There are some problems in the alpha channel support, as is
reported at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=72917

This patch add a new RCombineAlpha function, based on Gimp. This
function is called when needed in the raster.c functions.

This patch is based on the Brad Jorsch <anomie@users.sourceforge.net>
patch for the 0.62.1-0.1 version.

[crmafra: v1 was sent by Rodolfo kix Garcia <kix@kix.es>]
2012-01-18 12:04:57 +00:00