+
Skip to content

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SergeyLebedkin
Copy link
Member

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

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
@SergeyLebedkin SergeyLebedkin self-assigned this Jun 28, 2025
@SergeyLebedkin SergeyLebedkin added refactoring Code refactoring / Exceptional handles gl OpenGL/WebGL render backend labels Jun 28, 2025
@github-actions github-actions bot added the renderer Core rendering label Jun 28, 2025
@hermet
Copy link
Member

hermet commented Jun 28, 2025

tvgRender has been introduced as an interface similar to HAL or RHI, but This one is more of a helper function. In fact, a single function like bool genDashPath(const RenderPath& in, RenderPath& out); might be sufficient for this purpose. The question is: where would be the most appropriate place to include it...

@hermet
Copy link
Member

hermet commented Jun 28, 2025

Additionally, perhaps we can also replace the software ver. with this as well.

@SergeyLebedkin
Copy link
Member Author

tvgRender has been introduced as an interface similar to HAL or RHI, but This one is more of a helper function. In fact, a single function like bool genDashPath(const RenderPath& in, RenderPath& out); might be sufficient for this purpose. The question is: where would be the most appropriate place to include it...

thats a good point and good question.
we can hide inplementation in render.cpp file and make a function as a public interface like bool genDashPath(const RenderPath& in, RenderPath& out, ...);

@SergeyLebedkin
Copy link
Member Author

SergeyLebedkin commented Jun 28, 2025

Additionally, perhaps we can also replace the software ver. with this as well.

As I can see dashers for gl and sw is mostly similar. The difference is in output format.
gl version: path-to-path conversion (RenderPath to RenderPath)
sw version: path-to-outline conversion (RenderPath to SwOutline)wg
wg version (current): outline-to-outline conversion (WgVertexBuffer to WgVertexBuffer, will be get rided)

@hermet
Copy link
Member

hermet commented Jun 30, 2025

@SergeyLebedkin Please consider this interface:

bool RenderShape::strokeDash(RenderPath& out) const

@SergeyLebedkin
Copy link
Member Author

@SergeyLebedkin Please consider this interface:

bool RenderShape::strokeDash(RenderPath& out) const

whats do you mean consider? this dasher uses all settings for dashing

@hermet
Copy link
Member

hermet commented Jul 14, 2025

@SergeyLebedkin I suggest defining a common internal interface (strokeDash()) for the Dash Stroker. The RenderPath& out parameter could be used to return the dash path data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gl OpenGL/WebGL render backend refactoring Code refactoring / Exceptional handles renderer Core rendering
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载