Commit graph

40 commits

Author SHA1 Message Date
Mira Grudzinska
25a1321243 common: stroke dash offset support with new apis.
This change just allows users to use the offset of the stroke dash.
Actually feature enhacement has been introduced by
478e45f9f3.

@APIs:
uint32_t Shape::strokeDash(const float** dashPattern) ->
uint32_t Shape::strokeDash(const float** dashPattern, float* offset = nullptr)

Result Shape::strokeDash(const float* dashPattern, uint32_t cnt) ->
Result Shape::strokeDash(const float* dashPattern, uint32_t cnt, float offset = 0.0f)

Tvg_Result tvg_shape_set_stroke_dash(Tvg_Paint* paint, const float* dashPattern, uint32_t cnt) ->
Tvg_Result tvg_shape_set_stroke_dash(Tvg_Paint* paint, const float* dashPattern, uint32_t cnt, float offset)

Tvg_Result tvg_shape_get_stroke_dash(const Tvg_Paint* paint, const float** dashPattern, uint32_t* cnt) ->
Tvg_Result tvg_shape_get_stroke_dash(const Tvg_Paint* paint, const float** dashPattern, uint32_t* cnt, float* offset)

@Issue: https://github.com/thorvg/thorvg/issues/1372
2023-10-30 11:47:51 +09:00
Hermet Park
db55481e97 renamed stroke apis family.
float Shape::stroke(float width) -> float Shape::strokeWidth(float width)
Result Shape::stroke(uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255) -> Result Shape::strokeFill(uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255)
Result Shape::stroke(std::unique_ptr<Fill> f) -> Result Shape::strokeFill(std::unique_ptr<Fill> f)
Result Shape::stroke(const float* dashPattern, uint32_t cnt, float offset = 0.0f) ->  Result Shape::strokeDash(const float* dashPattern, uint32_t cnt, float offset = 0.0f)
Result Shape::stroke(StrokeCap cap) -> Result Shape::strokeCap(StrokeCap cap)
Result Shape::stroke(StrokeJoin join) -> Result Shape::strokeJoin(StrokeJoin join)
Result Shape::strokeColor(uint8_t* r, uint8_t* g, uint8_t* b, uint8_t* a = nullptr) const -> Result Shape::strokeFill(uint8_t* r, uint8_t* g, uint8_t* b, uint8_t* a = nullptr) const

@Issue: https://github.com/thorvg/thorvg/issues/1372
2023-10-27 11:46:51 +09:00
Hermet Park
7d797ee548 Yet we don't break apis, this patch reverts the next:
cb36c25aff
8c0fc2b25a
c1e4e0808a

Those reverted changes sholud be in the bucket, the next issue item:

@Issue: https://github.com/thorvg/thorvg/issues/1372
2023-08-24 01:00:57 +09:00
Mira Grudzinska
cb36c25aff test: dashed stroke with offset added 2023-08-23 12:40:27 +09:00
Martin Capitanio
44a750ee5d API, CAPI, sw_engine: add suport for stroke-miterlimit. 2023-06-13 10:42:20 +09:00
Hermet Park
f633717e9f test shape: add stroke order test 2023-05-20 13:22:52 +09:00
Hermet Park
f0ae3e9cee test: fix broken plugin support.
The thorvg test should not attempt to perform features
that were not enabled, as this will cause them to fail.

@Issues: https://github.com/thorvg/thorvg/issues/1251
2023-04-06 19:47:10 +09:00
Hermet Park
9b3c34c3b1 updated copyright. 2023-01-14 13:48:11 +09:00
Rémi Verschelde
46c3fc1f94 Format code files with dos2unix, ensure newline at EOF 2022-07-10 23:21:05 +09:00
Hermet Park
f0141e63de updated copyright date. 2022-01-12 14:08:48 +09:00
Hermet Park
8cc7f50235 test: API coverage up
Added identifier() test cases.
2021-10-22 18:47:05 +09:00
projectitis
dad6c71b6c
all: fix warnings on MSVC
* Explicit casts to suppress warnings
* Fixed compiler warnings
2021-10-09 11:33:45 +09:00
Hermet Park
27cac72d7d
test Shape: add Shape unit tests 2021-07-02 10:38:28 +09:00
Hermet Park
729fee5a23 examples: move tests to src/examples
tests is now officially placed in src/examples,
default is turned off, only necessaries turn it on.

ex) meson . build -Dexamples=true

+ this examples are required efl 'elementary' package.
2020-09-19 00:39:25 +09:00
Hermet Park
657e6daddb common taskscheduler: revise functionalities.
initialization interfaces has been changed for threads count.

if you want to set concrete threads count by system, please specify thread count with it.

std threads:
tvg::Initializer::init(tvg::CanvasEngine::Sw, std:🧵:hardware_concurrency());

if your system provides designed threads info, you can use it.

efl:
tvg_engine_init(TVG_ENGINE_SW, eina_cpu_count());

I recommend to avoid max threads usage for better performance.

Change-Id: I22cfa315768f73fa941be136956cdbb2cf837c20
2020-08-21 12:26:57 +09:00
Hermet Park
f4d1065d52 sw_engine: convert colorspace ARGB -> RGBA in default.
We can use RGBA colorspace rather ARGB for pixel data.
This would be better for many rendering system,
since it's more widely preferred than ARGB including opengl.

Change-Id: Ibbfe6a511d77bf0ef30ce261995467c11164d306
2020-08-15 18:22:43 +09:00
Hermet Park
a5d1542e44 test: ++code safety
added null check for exceptional case.

Change-Id: I12a5e9724149f607188b67a84e46a033a16270f7
2020-07-17 17:15:16 +09:00
Hermet Park
56c0235dc5 test: changed file permission.
Change-Id: I8172152f700d10fa1d8c84473d45ff484c0b36d8
2020-07-17 16:57:02 +09:00
Pranay Kumar Samanta
3b385d1d54 gl_engine: Fix crash in animation callback. Refactor test samples draw function. Fix open shape drawing.
Change-Id: I9ca2cb3951f2229f36292b69221451e0eaf5b6a1
2020-07-17 07:54:58 +00:00
Hermet Park
99428ee80a build: support features toggling in meson option.
Change-Id: Id1ebda70fe8380aaa913f79af26e5c39893a6df5
2020-07-08 15:30:12 +09:00
Hermet Park
ef4d7a3956 common shape: expand rectangle arguement to support both corner radius x, y
this is useful for svg loader

Change-Id: Ia11c2d1c6ea88f3fd65c7f75cef8b59bef426bcb
2020-07-07 13:09:46 +09:00
Hermet Park
2929fa5c57 sw_engine: optimize rle rendering.
we don't need to apply anti-aliasing if stroke is there.
here turns off anti-alias if stroke width is more than 2.
magic number 2 is experimentally confirmed.

Change-Id: I09031dc2a0a84f31c5904651ed1e62004645ba9a
2020-07-03 18:32:50 +09:00
Hermet Park
0d5adb2f03 test: enable gl window only on gl backend.
Change-Id: Iafd790b7fc1df8a58bdce2f18c39029cc0d74945
2020-07-01 14:25:53 +09:00
Hermet Park
61cb144122 test: revise sample.
this patch adds the showcase how to handle exceptional cases.

Change-Id: Ic8e3c740bbf613f4dccace511b6c8d93b987a10c
2020-06-30 13:31:28 +09:00
Hermet Park
918b6c69d8 test: unify test code for supporting gl engine from all test cases.
now you can launch tests with gl engine by "gl" option

ex)
$ testTransform gl
$ testScene gl

Change-Id: Idb720ed369a2fbfb908c977fdaebd7289986fb6f
2020-06-29 21:00:26 +09:00
Hermet Park
0a562a4ae2 test: print current backend engine name
Change-Id: Iaafa521556a614b47994914c09228b8e8ae9c9e9
2020-06-29 16:26:02 +09:00
Hermet Park
4d6dee91e4 test shape: unify sw/gl test code.
default is sw engine, please run sample app with "gl" argument

$./testShape gl

Change-Id: Iff7da624ff17827df957919341737b9f129f502e
2020-06-29 14:59:01 +09:00
Hermet Park
56e866dd36 renamed project name tizenvg => thorvg
we're going to open this project as the independent one,

thus removed tizen naming here.

Change-Id: Ib3c898067dd9186e893f7cb0903fd70d2ce7b31f
2020-06-25 13:57:41 +09:00
Hermet Park
36c76ca73c sw_engine: threading optimization
make it prepare step asynchronously.

Change-Id: Ifb85f01d579cf1c111558842496b93fcaef74cd9
2020-06-24 14:35:23 +09:00
Hermet Park
f627679882 common initializer: replace engine class with intializer
This initializer will take over the global environments of tvg engines.

Change-Id: I7b99973dafaea57ddd3134800bd442ef4dc319ae
2020-06-16 12:54:53 +09:00
Hermet Park
f4de03b01a test: updated test samples.
1. added testTransform
2. replaced testShape with testMergeShapes

Change-Id: I1f7b25a1d2f62ac682f7a19e75fc3a44db7c52f0
2020-05-03 15:14:01 +09:00
Hermet Park
42c56757df common: redesigned interfaces
PaintNode -> Paint
ShapeNode -> Shape
SceneNode -> Scene

We can keep clean and neat shorter names.

Change-Id: Ic8521d456d947985e5fbe1ba2bde06faa1f52469
2020-05-02 18:20:50 +09:00
Hermet Park
74d2f275e7 sw_engine: support color blending
this contains testBlending as well

Change-Id: Ia0aadea804a973cfe8ec981ed1b21c1b44512ef2
2020-05-01 14:45:16 +09:00
Hermet Park
809dfd8644 canvas: add reserve() method.
This allocates nodes slots in advance to avoid memory grow & copy.

it will be benefit if you know how many shapes will be used in your canvas.

Change-Id: I7d93d166c9c054078bd86593d3471a2ade3671ee
2020-04-27 01:52:44 +09:00
Hermet Park
6be53b0779 test: close the window at exit button
Change-Id: Idf46d7132ae97356637816e54dc6c267be7122e6
2020-04-26 18:47:34 +09:00
Hermet Park
e655471e09 common shape: support rounded rectangle.
Also remove arcTo implementation since curveTo could covers it.

Change-Id: Icc63eca55e51622fc80b57672f308f25f2301f85
2020-04-26 16:18:25 +09:00
Hermet Park
37d34eeb19 sw_engine: concrete shape rendering sequence.
Succeed first sw backend screen up!

Change-Id: I882fb1726ed1f45e92e73fbc36170e93645dfbd2
2020-04-19 18:28:01 +09:00
Hermet Park
69f2fb4965 test: update test code for the first showcase.
To show the result, we use efl library.

Most linux distribution supports efl library from their package repo,
you can easily install efl from its package repo:

Ubuntu:
$ apt-get install libelementary-dev

Or, please visit efl site to install EFL libarary manually:
https://www.enlightenment.org/download

Change-Id: I696ac72e4ec7ea3258161a15b58171d74c16830d
2020-04-19 12:17:48 +09:00
Hermet Park
2a39617527 implement rle path parts.
Change-Id: I7200d80320404d6e7fb722042b8f330961bee76d
2020-04-15 21:55:53 +09:00
Hermet Park
02b2d812e4 implement basic interfaces
major functions are added for Path specification.
added backend engine infra skeleton.

Change-Id: Ia923b02649cff545fa768ab8538ad7187195826f
2020-04-02 17:24:38 +09:00
Renamed from test/tvgDrawShape.cpp (Browse further)