Mira Grudzinska
96d6b47a64
common: PaintType enum changed to identifier in Paint class
...
The PaintType enum was used to set the paint type in the internal Paint
implementation. This solution is switched to an identifier with id() getter,
so that the information about the type can be reached from outside the Paint.
2021-06-25 22:13:20 +09:00
Hermet Park
bf39e0fea9
Update README.md
...
@mgrudzinska I don't know this makes you understand, you can suggest if you have a better phrase.
2021-06-25 10:49:08 +09:00
K. S. Ernest (iFire) Lee
affa809a2c
Use spellcheck
2021-06-25 10:43:34 +09:00
Hermet Park
a6f9ec3080
svg_loader: fix memory violation issues.
...
copy attribute must copy the url data,
otherwise, url memory can be atempted freeing twice.
also, fix the memory leak in multiple composition case.
2021-06-25 10:28:27 +09:00
Hermet Park
940b8b566f
Update README.md
2021-06-24 23:02:32 +09:00
Mira Grudzinska
286f700305
svg_loader: handling the ColorStop offset values
...
The ColorStop offset < 0 and > 1 should be treated as 0 and 1 respectively.
The offset value < than the previous offset value should be replaced
by the previous value - without this change segfault occurred.
Validating the APIs parameters values is the user responsibility.
2021-06-24 20:54:03 +09:00
Hermet Park
750ad90bf0
sw_engine stroke: set stroke invalid if points are zero.
...
This valid tag is used for further progress.
we don't need it actually since we can count by points number.
2021-06-24 20:50:37 +09:00
Hermet Park
86fd0f67cf
svg_loader: prevent heap memory overflow.
...
if the input points are odd-numberd by invalid svg data, it could access invalid memory.
Prevents it just in case.
2021-06-24 16:54:07 +09:00
JunsuChoi
5da4c81138
svg_loader SvgPath: Added corner case handling for flags of Arc
...
It handles the case what the flag of the arc of the path is defined
without spaces or commas, such as 00, 01, 11 or 10.
2021-06-24 08:52:30 +02:00
JunsuChoi
b17f3cc9a4
svg2png: Clean up code
...
Modify the code to fit coding style
2021-06-24 11:31:15 +09:00
Hermet Park
a459a53bc7
svg2png: revise code to fix memory violation.
...
previous code didn't take care of multi-threading.
This revise code to avoid changing canvas buffer during multi-tasking.
2021-06-24 10:52:44 +09:00
Hermet Park
59f189bcb4
Update tvgSwMath.cpp
...
fix typo.
2021-06-23 22:46:41 +09:00
Hermet Park
80090e1189
tvg_loader: recover wrongly introduced change by my mistake.
2021-06-23 19:48:10 +09:00
Hermet Park
c2b84dc500
+++
2021-06-23 18:59:26 +09:00
Hermet Park
135cba001f
tvg_loader: code refactoring.
...
keep it neat & clean code for better readibility and maintenence.
2021-06-23 18:59:26 +09:00
Hermet Park
bba162b604
sw_engine: fix MSVC compatibility problem.
...
clz (count leading zero) is builtin function
that is not available in MSVC.
This patch replace clz for MSVC env.
Thanks @fire for pointing out this.
Refers: https://stackoverflow.com/questions/355967/how-to-use-msvc-intrinsics-to-get-the-equivalent-of-this-gcc-code
2021-06-23 16:26:31 +09:00
Hermet Park
4f35c478c2
common: fix compatibility issue for MSVC.
...
strcasecmp() is not supported by MSVC
We can replace it with _stricmp()
thanks @fire for pointing out this.
2021-06-23 15:50:02 +09:00
Hermet Park
53576d3939
common: fix compatibility issue for MSVC.
...
__attribute__ syntax is not supported by MSVC.
We can turn it on optionally.
2021-06-23 13:55:10 +09:00
Hermet Park
87b94b7a7f
common: fix compatibility issue for MSVC
...
Math Constants are not defined in Standard C/C++
for this, we can use _USE_MATH_DEFINES before math headers.
2021-06-23 13:38:46 +09:00
Hermet Park
89d35123d8
examples: add commentary for exceptions.
2021-06-23 13:10:02 +09:00
Mira Grudzinska
a0f28d0db4
sw_engine fill: fixing gradient calculations for 'repeat' spread value
...
There was a call to the ctable element from outside its boundaries, because
the check was misplaced.
2021-06-23 13:01:10 +09:00
Hermet Park
5bbe713ca5
infra: add memory sanitize option in meson
...
for optimial library, we removed some peripheral information in default,
this breaks asan environment.
This patch changes it to make it both.
if you want to use asan, please change the meson option.
default is disabled.
example)
$meson . build -Db_sanitize=address
$meson . build -Db_sanitize=address,undefined
2021-06-23 11:55:52 +09:00
Mira Grudzinska
5679d666a6
svg_loader: correct parsing ColorStop offset values
...
Values different from numbers and percentages should be ignored
and the default values should be applied (zeros).
2021-06-23 10:35:58 +09:00
Hermet Park
cadbbb8028
common loadermgr: fix missing break; in switch-case.
2021-06-23 10:18:46 +09:00
JunsuChoi
f20ef0dc15
svg_loader SvgLoader: Copy the missing composite url
...
When copying an attribute, url information of stype's composite is overwritten with memcpy.
This causes double free by deleting the wrong string in freeNodeStyle.
2021-06-22 10:26:05 +02:00
Hermet Park
234c1cefc8
common scene: fix a regression bug.
...
That is wrongly changed by 39bf94e506
renderer must be valid until all operations is done.
2021-06-22 17:22:39 +09:00
Hermet Park
58f251163b
tvg_loader: code refactoring.
...
remove if-def code.
Actually, tvg log is supposed to print some useful info for users,
not debugging info for our engine developers.
2021-06-22 17:07:56 +09:00
JunsuChoi
a2d348242b
svg_loader SvgLoader: Prevent invalid access
...
If there is no path information, it is not copied.
2021-06-22 09:55:13 +02:00
Hermet Park
ea668eae1d
fix a build break in MSVC
...
add missing string header, string is used for a Picture::load() parameter
2021-06-22 14:35:46 +09:00
Hermet Park
39bf94e506
common scene: code refactoring.
...
keep it clean and less LOC.
2021-06-22 13:49:12 +09:00
JunsuChoi
b791924983
svg_loader XmlParser: Fix check the end of string
...
While skipping the string, check the end of the string first.
Prevents an invalid read when parser really get to the end of the string.
2021-06-22 13:47:26 +09:00
Michal Maciola
24cebf5cc5
common: fix a memory leak after scene->clear(true)
...
If renderer was null, paints was cleared (count set to zero), but data
was not deleted regardless free boolean.
2021-06-22 11:30:39 +09:00
Hermet Park
0df8c00519
loaders: revise code from cce4b443b3
...
use copy variable instead of additional buffer pointer.
2021-06-22 10:42:34 +09:00
Michal Maciola
cce4b443b3
loaders: added copy param for Picture::load
...
@API Changed:
Result Picture::load(const char* data, uint32_t size, bool copy /*=false*/) noexcept
TVG_EXPORT Tvg_Result tvg_picture_load_data(Tvg_Paint* paint, const char *data, uint32_t size, bool copy);
2021-06-21 19:52:38 +09:00
JunsuChoi
f4895459fa
test Scene: Separate tests into SECTION()
...
Split some tests into SECTIONs based on their type.
This improves the readability of TC.
And developer can run test in SECTION unit.
ex)
./build/test/tvgUnitTests "Pushing Paints Into Scene" -c "Pushing Null Pointer"
2021-06-21 19:46:19 +09:00
Mira Grudzinska
8bb10fb261
svg_loader: radial gradient transformation support
...
For now the gradient radius is scales like x-axis - it has to be changed
after issue #37 will be resolved.
2021-06-21 10:23:42 +09:00
JunsuChoi
b2020a9387
test Scene: Add tvg::Scene unit tests
...
- Creation
- Push
- Reserve
- Clear
2021-06-18 15:45:36 +09:00
JunsuChoi
d92a2c25f6
infra CI: Upload unit test result to artifact
...
Users can download the unit test result list from PR-> Checks -> Build Test -> Artifacts.
2021-06-17 21:50:13 +09:00
JunsuChoi
0d28bdfc07
infra CI: Fix test flag of test build
...
test -> tests
2021-06-17 21:49:54 +09:00
Hermet Park
20c68e3b37
test capi: code refactoring.
...
keep the coding consistency, no logical changes.
Also, renamed tests to avoid conflicts duplicated names.
2021-06-17 14:57:06 +09:00
Michal Szczecinski
bde0d8e751
utc capi: Added linear gradient tests.
2021-06-17 14:47:35 +09:00
Hermet Park
25b31d9154
test capi: code refactoring.
...
keep the coding consistency, no logical changes.
2021-06-17 14:38:27 +09:00
Michal Szczecinski
2b78d58c23
utc capi: Added radial gradient tests.
2021-06-17 14:07:11 +09:00
JunsuChoi
6d5d0a154b
common Scene: return FailedAllocation if it really failed at memory allocation.
...
Due to change of f0ecc67
, the return type of reserve() is changed to bool,
which can return the result for the fail case.
2021-06-17 13:22:39 +09:00
Mira Grudzinska
2bf21dae3d
svg_loader: key and value in the simpleXmlParseW3CAttribute needed to be cleared out of spaces
2021-06-17 11:17:39 +09:00
Mira Grudzinska
7ffeb2e606
svg_loader: fixing color parsing
...
For colors given in a style attribute in the format "rgb(rrr, ggg, bbb)"
a parsing was incorect. Now fixed.
2021-06-17 11:12:33 +09:00
Mira Grudzinska
20e926c950
svg_loader: after reading an unsupported style attribute no other values were loaded
...
After finding an unsupported style attribute the log is printed (on request)
and processing of other values continues.
2021-06-17 10:46:20 +09:00
Mira Grudzinska
e0a1aa9355
svg_loader: adding check if stroke-dasharray attribute != none
...
The stroke-dasharray value equal to "none" was causing a segfault
during a conversion to float. Fixed now.
2021-06-17 10:16:05 +09:00
Michal Maciola
858de0febb
utc capi: added capiSwCanvas test cases
2021-06-16 20:48:15 +09:00
Hermet Park
c19aa9fed7
tset capi: code refactoring.
...
revise coding style.
2021-06-16 12:53:26 +09:00