Commit graph

1785 commits

Author SHA1 Message Date
Hermet Park
01b26c43a6 engine: add Renderer::colorSpace() interface
This is necessary for acquiring current format size.

@Issue: https://github.com/thorvg/thorvg/issues/976
2023-05-08 10:55:03 +09:00
Hermet Park
1302c18f28 common sw_engine: polished code
--OOM handling
++exception handling
++log info
2023-05-08 10:55:03 +09:00
Rafał Mikrut
56d18f37c3 infra: Improve regression finder 2023-05-08 10:38:27 +09:00
Hermet Park
3c8a4afaa7 sw_engine: fix the broken scene clipping.
The implementation has been reverted by https://github.com/thorvg/thorvg/issues/1409

Since the sanitizer is not matured fully and it's false positive as far as I figured,
We revert the scene clipping part.

@Issue: https://github.com/thorvg/thorvg/issues/524
2023-05-06 19:22:21 +09:00
Hermet Park
d7eb913741 sw_engine: fix a logical wrong.
the value should be updated properly.
2023-05-06 15:14:11 +09:00
Hermet Park
cc1f86e719 canvas: ++ log msg for dev 2023-05-05 15:52:41 +09:00
Mira Grudzinska
2a0a3950e6 svg2png: rounding up svg width and height
The svg width/height values were cast to int,
which could result in cutting off a small part
of the image. Now, in the case of a non-integer
size, it will be rounded up.

@Issue: https://github.com/thorvg/thorvg/issues/1414
2023-05-05 10:58:54 +09:00
Hermet Park
e8eef1af1d common taskscheduler: revert 4db25db962
There is a report of the thread sanitizer.
It could be a false-positive as far as I reviewed,
but we hate to be bothered by it. So let's revert it.

@Issue: https://github.com/thorvg/thorvg/issues/1409
2023-05-04 13:42:50 +09:00
Mira Grudzinska
51a31e226d tests: capi identifier tests added 2023-05-04 09:58:09 +09:00
Mira Grudzinska
11b36aa4c9 svg2png: changing image size
For resolution > 8k image's width and height are changed,
but the change was not applied to the image itself. Now fixed.
2023-05-04 09:54:43 +09:00
Mira Grudzinska
4599067bee svg_loader: fixing percent. calculations of width/height
The conversion to percentages was applied twice.
Additionally, when a viewbox value was provided before the width/height,
incorrect scaling occurred.

@Issue: https://github.com/thorvg/thorvg/issues/1414
2023-05-04 09:52:55 +09:00
Mira Grudzinska
21ac44d120 common: fixing log std stream
By mistake, stdout was switched to stderr
for logs. Fixed.
2023-05-04 09:50:33 +09:00
Hermet Park
f8c45cb175 examples image: ++sample svg 2023-05-03 22:08:16 +09:00
Hermet Park
9a9c0e7907 svg_loader: code refactoring.
simplify the logic and remove unnecessary member data.
2023-05-03 22:08:16 +09:00
Hermet Park
f82c274444 svg_loader: fix memory violation.
LoadModule data is designed to be returned to the user's call.
and should not be writable in Task::run()

@Issue: https://github.com/thorvg/thorvg/issues/1409
2023-05-03 22:08:16 +09:00
Mira Grudzinska
92346c4119 svg_loader: handling svg width/height in percentages
The percentages should refer to the size of the viewbox.
This was not the case for not knowing the viewbox before
reading the width/height.

@Issue: https://github.com/thorvg/thorvg/issues/1409
2023-05-03 20:35:08 +09:00
Hermet Park
cf41e1edf7 updated AUTHORS 2023-05-01 13:41:25 +09:00
Hermet Park
bc7b448c01 sw_engine: ++thread-safety
One more regression bug by afea40a947

As tasks will now be triggered by other tasks on the worker threads,
the designated memory pool data (outline) for each thread should be
reset before moving on to other tasks.

@Issue: https://github.com/thorvg/thorvg/issues/1409
2023-04-30 20:28:12 +09:00
Hermet Park
e9b12aa9f7 engine/loaders: Migrate alpha premultiplying to the engine side.
It's not efficient to handle alpha premultiplying in every loader.
The backend engine should be responsible for it.
Now, we can remove duplicate code.
2023-04-29 12:37:09 +09:00
Hermet Park
9fb66973f0 common picture: tiny optimization.
Currently Picture doesn't allow to change the image source.
Thus reloading is not non-sense.
2023-04-28 15:27:53 +09:00
Hermet Park
c710af2560 loaders: Remove the color space conversion on the loader side.
Now, the job is completely delegated to the backend engine.
2023-04-28 15:27:53 +09:00
Hermet Park
b733030357 sw_engine: supports the color space conversion.
Currently implements only the necessary functions for converting
between ARGB and ABGR.

Now conversion can be accelerated by the backend engines.
2023-04-28 15:27:53 +09:00
Hermet Park
a4b2699f86 updated gitignore 2023-04-28 15:27:53 +09:00
Hermet Park
cf4484c1ad engine/loaders: develop the ColorSpace feature infrastructure
Replace the existing fragile usage of the colorspace data type
with a new and robust concrete ColorSpace type.
2023-04-28 15:27:53 +09:00
Mira Grudzinska
bce5aef068 tvg_saver: fixing file opening mode
Opening files in text mode on windows can
cause issues. Fixed by changeing the mode
to binary.

@Issue: https://github.com/thorvg/thorvg/issues/957
@Issue: https://github.com/thorvg/thorvg/issues/1380
2023-04-27 23:35:32 +09:00
Hermet Park
84012651cc common engine: code refactoring
Introduce the RenderMesh structure to reduce the number of required parameters.
2023-04-27 10:16:12 +09:00
Hermet Park
6d08586883 common engine: code refactoring
Unify renderImage and renderImageMesh and hide their routines in backends.
2023-04-27 10:16:12 +09:00
Hermet Park
65116b87ad
Update AUTHORS 2023-04-26 11:21:13 +09:00
Rafał Mikrut
e8b1c654d4 Regression finder 2023-04-26 11:19:12 +09:00
Hermet Park
1e370712e0 loader svg: ++code readability
Use own bit operation helpers.
2023-04-26 11:15:48 +09:00
Hermet Park
8a67bff7c9 common: code refactoring
Use own bit operation helper.
2023-04-26 11:15:48 +09:00
Hermet Park
ac8d0018b5 common taskscheduler: fix a potential crash issue.
Guarantee the tasks are not deleted until the taskscheduler finished them.

@Issue: https://github.com/thorvg/thorvg/issues/1370
2023-04-26 00:23:03 +09:00
Hermet Park
20466ea78f sw_engine rle: The out-of-range memory access has been fixed.
@Issue: https://github.com/thorvg/thorvg/issues/1370
2023-04-26 00:23:03 +09:00
Hermet Park
7e3380db8b sw_engine mempool: fixed to address a potential memory corruption issue.
The previous memory pool was being shared by both the main and first threads,
which could lead to corruption if any threading changes occurred.

@Issue: https://github.com/thorvg/thorvg/issues/1370
2023-04-26 00:23:03 +09:00
Mira Grudzinska
bf2b348343 svg_loader: removed unused code
While css styling applied one of conditions was
always false. It is now removed and the function
that was called is refactored
2023-04-25 14:30:40 +09:00
Mira Grudzinska
83ffe9f612 svg_loader: fixing grad overwritting
Gradient was mistakenly overwritten in
files in which the <def> section existed,
but grad was defined outside it.
2023-04-25 14:30:23 +09:00
Hermet Park
92dbc8507e common: polished the log message.
Removed 'l.'. It just bothers in reading numbers.
2023-04-25 14:23:23 +09:00
Mira Grudzinska
ef93a45d56 svg_loader: removing setting the locale
The locale was set while reading the path attr,
which could have caused race conditions between
threads and potentially led to crashes.
Now removed as unnecessary.

@Issue: https://github.com/thorvg/thorvg/issues/1389
2023-04-25 09:17:00 +09:00
Mira Grudzinska
cc75928c23 capi: type identifier apis added
The tvg_gradient_get_identifier and tvg_paint_get_identifier
apis have been introduced. They set the newly introduced
Tvg_Identifier enum, which indicates the paint and gradient
types, respectively.
2023-04-25 09:15:28 +09:00
Mira Grudzinska
74c9a5f795 svg_loader: changed update order
The gradient was updated before the style,
which resulted in only the URL tag being
inherited, but the gradient itself was not
applied to the node.
2023-04-25 09:01:19 +09:00
Mira Grudzinska
5f5b4fdb80 tests: ++coverage of the svg_loader 2023-04-24 10:54:11 +09:00
Mira Grudzinska
b0991b6ce7 svg_loader: fixing 'infinity' handling in svgUtilStrtof
The word 'infinity' was not read to the end due to
the pointer shifting.
2023-04-24 10:47:17 +09:00
Mira Grudzinska
dbca656ff5 tests capi: missing header added
Because of this tests for SwCanvas were
not performed.
2023-04-23 10:25:55 +09:00
Mira Grudzinska
f82b16285a tests: fixing error on windows (mingw-64)
Error while comparing a pointer and an integer.
Solved by using a null pointer const instead of
the NULL macro.

@Issue: https://github.com/thorvg/thorvg/issues/1382
2023-04-22 21:24:41 +09:00
Hermet Park
ffbdc6990c
Update README.md 2023-04-22 18:39:28 +09:00
Hermet Park
5d930e51e4 test/examples: -- deprecated apis call warnings.
Result load(const char* data, uint32_t size, bool copy = false)
-> Result load(const char* data, uint32_t size, const std::string& mimeType, bool copy = false)

Result bounds(float* x, float* y, float* w, float* h)
-> Result bounds(float* x, float* y, float* w, float* h, bool transformed)
2023-04-22 18:32:22 +09:00
Hermet Park
69063d2405 infra: specify TVG_API for both static/dynamic linking.
The previous meson script was incomplete,
therefore this change requires it to be revised.

To enable static linking use the next meson option.
"-Ddefault_library=static"

Issue: https://github.com/thorvg/thorvg/issues/1234
2023-04-22 18:32:22 +09:00
Hermet Park
02bc89fc93 infra github: adds static loader test 2023-04-21 08:29:19 +09:00
Hermet Park
a5e84ce791 infra github: compact actions & added tools build.
Still windows action needs unit_test & examples.

@https://github.com/thorvg/thorvg/issues/1378
2023-04-21 08:29:19 +09:00
Hermet Park
a2d93b7d37 infra github: compact actions & supplement verfication. 2023-04-21 08:29:19 +09:00