-
-
Notifications
You must be signed in to change notification settings - Fork 139
common: share stroke dasher #3581
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
common: share stroke dasher #3581
Conversation
|
Additionally, perhaps we can also replace the software ver. with this as well. |
thats a good point and good question. |
As I can see dashers for gl and sw is mostly similar. The difference is in output format. |
@SergeyLebedkin Please consider this interface:
|
whats do you mean consider? this dasher uses all settings for dashing |
@SergeyLebedkin I suggest defining a common internal interface ( |
MOve stroke dasher to the common code space to create an abillity to use it on the cross API renderers (wg and gl) stroke dasher is a path-to-path operation, same as path trim, so can be placed to the common space
e73e61c
to
235ed47
Compare
OK. So now RenderShape can generate dashed path by himself. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Moves stroke dasher functionality from renderer-specific code to common space for cross-API renderer compatibility. The stroke dasher performs path-to-path operations similar to path trim, making it suitable for the common code space.
- Relocates the
DashStroke
class from GL renderer to commonRenderDashPath
class in tvgRender.cpp - Adds
strokeDash()
method toRenderShape
for centralized dash stroke handling - Simplifies stroke processing logic in GL renderer by using the common implementation
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/renderer/tvgRender.h | Adds strokeDash method declaration to RenderShape class |
src/renderer/tvgRender.cpp | Implements RenderDashPath class and strokeDash method for common dash stroke functionality |
src/renderer/gl_engine/tvgGlTessellator.h | Removes DashStroke class and doDashStroke method declarations |
src/renderer/gl_engine/tvgGlTessellator.cpp | Removes DashStroke implementation and updates stroke method to use common dash functionality |
src/renderer/gl_engine/tvgGlGeometry.cpp | Simplifies tessellation logic by removing path preprocessing and delegating to stroker |
} | ||
|
||
if (mCurrLen < 0.1f) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Magic number 0.1f should be replaced with a named constant for clarity and maintainability.
if (mCurrLen < 0.1f) { | |
if (mCurrLen < MIN_CURR_LEN_THRESHOLD) { |
Copilot uses AI. Check for mistakes.
} | ||
|
||
if (mCurrLen < 0.1f) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Magic number 0.1f should be replaced with a named constant for clarity and maintainability. This appears to be duplicated from line 753.
if (mCurrLen < 0.1f) { | |
if (mCurrLen < MIN_CURR_LEN_THRESHOLD) { |
Copilot uses AI. Check for mistakes.
duplicated: #3624 |
Move stroke dasher to the common code space to create an abillity to use it on the cross API renderers (wg and gl).
Stroke dasher is a path-to-path operation, same as path trim, so can be placed to the common space.
issue: #3557