Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add ThorVG build option (IEC-155) #364

Merged
merged 7 commits into from
Sep 19, 2024

Conversation

espressif2022
Copy link
Contributor

Checklist

  • Component contains License
  • Component contains README.md
  • Component contains idf_component.yml file with url field defined
  • Component was added to upload job
  • Component was added to build job
  • Optional: Component contains unit tests
  • CI passing

Change description

1: Add Loaders Support option:['tvg', 'svg', 'png', 'jpg', 'lottie']
2: Add log_enable/thread_enable flag

@github-actions github-actions bot changed the title feat: Add ThorVG build option feat: Add ThorVG build option (IEC-155) Aug 19, 2024
thorvg/CMakeLists.txt Outdated Show resolved Hide resolved
thorvg/Kconfig Outdated

config THORVG_THREAD_SUPPORT
bool "Enable ThorVG thread support"
default n
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previously, we've enabled this feature by default

Copy link
Contributor Author

@espressif2022 espressif2022 Aug 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah,lottie, svg, tvg is enabled by default. I'll enable it.
And if we enable the thread flag, some lottie file will crash, I can't find the reason now, so I set it disable by default.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If enabling thread flag doesn't work (i.e. it results in a crash), why do we want to keep this as an option? Wouldn't it be better to disable this option, and re-enable it when the bug is fixed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@espressif2022 Now that you don't get a crash when using threads, can we change this to default y?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@espressif2022 Now that you don't get a crash when using threads, can we change this to default y?

Done.

@igrr
Copy link
Member

igrr commented Sep 18, 2024

@espressif2022 I have had to change thorvg CMakeLists a lot in this commit: 83ac6d6, it has resolved the PIC issue, details are in the description.

Could you please rebase your changes upon the new version? Sorry for the trouble.

For pthread support, could you please try it again? Since PIC is now properly disabled, I guess it shouldn't crash anymore.

@espressif2022
Copy link
Contributor Author

@espressif2022 I have had to change thorvg CMakeLists a lot in this commit: 83ac6d6, it has resolved the PIC issue, details are in the description.

Could you please rebase your changes upon the new version? Sorry for the trouble.

For pthread support, could you please try it again? Since PIC is now properly disabled, I guess it shouldn't crash anymore.

Thank you very much, I will deal with it ASAP.

@espressif2022
Copy link
Contributor Author

espressif2022 commented Sep 18, 2024

@espressif2022 I have had to change thorvg CMakeLists a lot in this commit: 83ac6d6, it has resolved the PIC issue, details are in the description.

Could you please rebase your changes upon the new version? Sorry for the trouble.

For pthread support, could you please try it again? Since PIC is now properly disabled, I guess it shouldn't crash anymore.

I've test it. the flags of thread and PIC are ok on v0.13.8.

thorvg/CMakeLists.txt Outdated Show resolved Hide resolved
thorvg/Kconfig Outdated Show resolved Hide resolved
thorvg/Kconfig Outdated Show resolved Hide resolved
thorvg/Kconfig Outdated
bool "Enable webp loader support"
default n
help
Enable WEBP loader support.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally if you don't have more to say in the help text than in the option name, you don't need to add help text... Repeating the same thing twice doesn't really explain anything better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion, thanks.

@igrr
Copy link
Member

igrr commented Sep 19, 2024

We also get a build failure now:

../../../../../thorvg/thorvg/src/renderer/sw_engine/tvgSwRasterTexmap.h: In function 'void _rasterBlendingPolygonImageSegment(SwSurface*, const SwImage*, const SwBBox*, int, int, AASpans*, uint8_t)':
../../../../../thorvg/thorvg/src/renderer/sw_engine/tvgSwRasterTexmap.h:433:1: error: insn does not satisfy its constraints:
  433 | }
      | ^
(insn 1155 1121 949 56 (set (reg:SF 21 f2 [612])
        (mem/u/c:SF (symbol_ref/u:SI ("*.LC14") [flags 0x2]) [0  S4 A32])) 49 {movsf_internal}
     (nil))
during RTL pass: postreload
../../../../../thorvg/thorvg/src/renderer/sw_engine/tvgSwRasterTexmap.h:433:1: internal compiler error: in extract_constrain_insn, at recog.c:2671
0x13cebd6 internal_error(char const*, ...)
	???:0
0x5ef48f fancy_abort(char const*, int, char const*)
	???:0
0x5c52dd _fatal_insn(char const*, rtx_def const*, char const*, int, char const*)
	???:0
0x5c5303 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
	???:0
0xbecba7 extract_constrain_insn(rtx_insn*)
	???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

I guess it's the same as jcmvbkbc/gcc-xtensa#14. Please try adding -fno-if-conversion to ThorVG compilation flags (jcmvbkbc/gcc-xtensa#14 (comment)).

espressif2022 and others added 5 commits September 19, 2024 16:56
string replace to list

Co-authored-by: Ivan Grokhotkov <[email protected]>
thread->threading support

Co-authored-by: Ivan Grokhotkov <[email protected]>
update description.

Co-authored-by: Ivan Grokhotkov <[email protected]>
@igrr igrr merged commit a0d3bea into espressif:master Sep 19, 2024
72 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants