Commit Graph

140 Commits

Author SHA1 Message Date
akallabeth a1a1fc8658
[warnings] fix mismatches between declaration and implementation 2024-09-12 13:32:44 +02:00
akallabeth 15456e1ee1
[warnings] fix implicit widening conversion 2024-08-29 10:47:20 +02:00
akallabeth ba7fd06ec4
[coverity] fix some warnings
* mostly dead store and identical code branches.
* some possible integer overflows
2024-08-23 12:38:41 +02:00
akallabeth 311068e605
[primitives] add image copy primitive
* move freerdp_image_copy_no_overlap implementation to primitives
* add SSE4.1 and AVX2 optimizations
2024-06-11 13:26:06 +02:00
akallabeth 96f68dca74
[codec,color] optimize image copy
provide optimized functions for alpha blending in different color formats
2024-06-04 09:27:20 +02:00
akallabeth a9e3fb1b33
[codec,color] restrict keyword 2024-06-03 17:55:19 +02:00
akallabeth fd592b9cf1
[codec,nsc] add INLINE and restrict keywords 2024-06-03 17:55:16 +02:00
akallabeth e9b5555652
[codec,color] inline functions used internally
for freerdp_image_copy inline all functions that are used to speed up
copying.
2024-05-27 09:52:09 +02:00
akallabeth 5fe0c5f9fc
[codec,color] check for image_copy widht or height 0 2024-05-25 09:17:13 +02:00
akallabeth 1b3f3a0408
[codec,color] expose freerdp_image_copy (no)overlap
expose functions for overlapping and non overlapping images to use
directly
2024-05-23 14:48:36 +02:00
akallabeth 1a58e74c17
[codec,color] freerdp_image_copy_no_overlap
use single memcopy if possible to speed up copy
2024-05-23 14:48:33 +02:00
akallabeth 6430945ce0 [codec,color] fix out of bound read 2024-04-21 11:00:47 +02:00
akallabeth b88c767603 [codec,color] use ssize_t/SSIZE_T for indices 2024-04-20 21:20:44 +02:00
akallabeth 43eae6029f [clang-tidy] fix various review warnings 2024-02-22 12:31:50 +01:00
akallabeth d7ebec5a65 [tidy] move loop variable declaration to loop 2024-02-22 12:31:50 +01:00
akallabeth 0ba995655d [clang-tidy] cppcoreguidelines-init-variables 2024-02-15 11:49:16 +01:00
akallabeth 207def5c56 [clang-tidy] readability-isolate-declaration 2024-02-15 11:49:16 +01:00
Armin Novak 3043fca91d [warnings] fixed -Wdiscarded-qualifiers 2023-12-13 13:24:22 +01:00
akallabeth b608be19e4 [codec,color] WINPR_RESTRICT for copy operations 2023-08-25 14:13:30 +02:00
akallabeth 7a71441476 [warnings] fix integer multiplications
Ensure the integer width for size arguments is 64bit in a
multiplication. Leading 64bit constant 1ull expands width, a trailing
one is ignored.
2023-08-22 11:55:00 +02:00
Armin Novak 9f967b4942 [codec,color] fix freerdp_image_fill
in case width or height == 0 out of bounds write might happen.
reported by @pwn2carr
2023-08-21 11:43:50 +02:00
Martin Fleisz 622a2a8df0 misc: More int to BOOL conversion fixes
This is a follow up to #9129.

This PR fixes some problematic `int` to `BOOL` conversions that might
cause overflows when checking for bit flags.
2023-07-04 09:45:20 +02:00
Armin Novak a4c6b36a19 [build] fix memory sanitizer stack frame warnings 2023-06-07 09:14:45 +02:00
Armin Novak 78eb6ce3a8 [codec] add flag for freerdp_image_copy
Add FREERDP_KEEP_DST_ALPHA to copy and keep the destination alpha value
2023-01-10 11:49:02 +01:00
akallabeth 43c5289928 Replaced memset/ZeroMemory with initializer
* Addes WINPR_ASSERT on many occations
* Replaced memset with array initializer
* Replaced ZeroMemory with array initializer
2022-10-14 12:11:01 +02:00
akallabeth 1849632c43
Fixed format strings to match arguments (#8254)
* Fixed format strings to match arguments

Reviewed and replaced all %d specifiers to match proper type

* Added proxy dynamic channel command type to log messages.
2022-09-29 14:55:27 +02:00
Armin Novak 3bedc1f92e Fixed swscale and cairo checks 2022-07-06 13:09:46 +00:00
akallabeth bc8b4ade1c reformatted 2022-06-23 08:48:39 +02:00
Armin Novak 66e73f8b08 Fixed missing static for functions, fixed declaration of FreeRDPAreColorFormatsEqualNoAlpha 2022-06-21 10:28:34 +02:00
David Fort 77413f49b2 winpr: rework alignment functions
_align_XXX functions aren't widely available depending on the C runtime. That causes
problems with mingw where we can easily have some runtime mixes (which lead to mysterious
segfaults most of the time). This patch introduce winpr_aligned_XXX functions that will
either use the function available, or use an emulation layer.
2022-05-12 11:36:01 +02:00
akallabeth fb90ac280a Refactored color.h
* Remove implementations from header
* Rename functions to be FreeRDP specific
* Add deprecation define for old names
* Fixed missing includes
2022-04-28 08:40:47 +02:00
Armin Novak 4d03d7c0bf Freerdp remove #ifdef HAVE_CONFIG_H 2022-03-03 11:26:48 +01:00
Armin Novak b2ad47a809 Reorganized FreeRDP headers 2022-03-03 11:26:48 +01:00
Armin Novak ca30e749e9 Fixed unused-but-set-variable and reserved identifier warnings 2022-02-01 08:48:21 +01:00
Armin Novak a1a7724b88 Fixed freerdp_image_fill scanline detection 2021-10-18 10:53:05 +02:00
akallabeth 43311130a2 Fixed CodeQL warnings 2021-02-19 11:19:49 +01:00
Nathan Loewen a5ba0bbdf0 let freerdp_image_scale() determine step size 2020-09-14 09:21:33 +02:00
Armin Novak 47d02a76ce Fixed missing input length check for color pointer. 2020-08-10 12:26:33 +02:00
akallabeth c81feb36b0 Refactored freerdp_image_copy_from_pointer_data
Split monochrome and color pointer handling to separate functions.
2020-04-22 14:21:47 +02:00
Raul Fernandes 971be4fe9b Cache the calculated color
In desktop area, the next color has high odds to be the same of previous color.
If we cache the value, it can be reused by the next pixel avoiding recalculation.
This optimization can halve the function's processing.
2020-04-15 13:25:52 +02:00
Armin Novak 72ca88f49c Reformatted to new style 2019-11-07 10:53:54 +01:00
Raphaël ZHOU 31962b2fa6 Fix padding of encoded scan-line for XOR mask of pointer. 2019-11-07 10:12:22 +01:00
akallabeth 9011ef1b75
Merge pull request #5387 from mfleisz/image_from_icon
core: Move image conversion of icon data into the library
2019-05-08 17:19:27 +02:00
Martin Fleisz 30c3b86655 core: Move image conversion for icon data into the library 2019-05-08 17:06:17 +02:00
Armin Novak 8fdf8eaeb7 Optimized image scaling, copy if factor is 1.0 2019-05-07 12:10:23 +02:00
Armin Novak 6a8755a763 Added image scaling api for software drawing.
For future GFX channel functions an image scaling function is required.
This moves the implementation from wayland client to core library
and adds support for the much faster SWScale library.
2019-05-07 08:56:29 +02:00
Armin Novak 8d6a12f312 Fixed unnecessary casts in freerdp_image_copy. 2019-04-05 09:14:35 +02:00
Armin Novak 9610faddaa Fixed sign-compare warnings 2019-04-05 09:13:24 +02:00
Armin Novak 0d8a1e1083 Fix #5061: Initialize output buffer transparent. 2018-11-23 10:57:17 +01:00
Armin Novak d2e08c0aa8 Fixed missing argument check. 2018-10-16 17:14:56 +02:00