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

Support viewport feature for the scene. #2172

Open
hermet opened this issue Apr 13, 2024 · 0 comments
Open

Support viewport feature for the scene. #2172

hermet opened this issue Apr 13, 2024 · 0 comments
Assignees
Labels
enhancement Improve features renderer Core rendering
Milestone

Comments

@hermet
Copy link
Member

hermet commented Apr 13, 2024

Since setting up a viewport region is a common method, we can officially support it as a replacement concept:

As is:

//use a shape for clipping
auto shape = Shape::gen();
shape->appendRect(x, y, w, h);
...
//setup its viewport
scene->composite(tvg::CompositeMethod::Clip, move(shape));

To be:

//No need to create additional data.
scene->viewport(x, y, w, h);

This is a more optimal approach for our rendering pipeline.

  • A viewport requires only four coordinates, whereas a shape has numerous properties allocated.
  • When the scene includes a composition, a viewport cannot be applied with a clipper; an additional scene layer is needed.
@hermet hermet added enhancement Improve features renderer Core rendering labels Apr 13, 2024
@hermet hermet added this to the 0.14 milestone Apr 13, 2024
@hermet hermet assigned mgrudzinska and unassigned mgrudzinska Apr 14, 2024
@mgrudzinska mgrudzinska self-assigned this Apr 17, 2024
@hermet hermet pinned this issue Apr 19, 2024
@hermet hermet unpinned this issue Apr 25, 2024
mgrudzinska added a commit to mgrudzinska/thorvg that referenced this issue Apr 29, 2024
New api can be used to replace clipping with a rectangle.
Scenes with viewport set can be still clipped/masked.

@issue: thorvg#2172
mgrudzinska added a commit to mgrudzinska/thorvg that referenced this issue Apr 29, 2024
New api can be used to replace clipping with a rectangle.
Scenes with viewport set can be still clipped/masked.

@issue: thorvg#2172
mgrudzinska added a commit to mgrudzinska/thorvg that referenced this issue May 1, 2024
New api can be used to replace clipping with a rectangle.
Scenes with viewport set can be still clipped/masked.

@issue: thorvg#2172
mgrudzinska added a commit to mgrudzinska/thorvg that referenced this issue May 1, 2024
New api can be used to replace clipping with a rectangle.
Scenes with viewport set can be still clipped/masked.

@issue: thorvg#2172
mgrudzinska added a commit to mgrudzinska/thorvg that referenced this issue May 3, 2024
New api can be used to replace clipping with a rectangle.
Scenes with viewport set can be still clipped/masked.

@issue: thorvg#2172
mgrudzinska added a commit to mgrudzinska/thorvg that referenced this issue May 3, 2024
New api can be used to replace clipping with a rectangle.
Scenes with viewport set can be still clipped/masked.

@issue: thorvg#2172
mgrudzinska added a commit to mgrudzinska/thorvg that referenced this issue May 8, 2024
New api can be used to replace clipping with a rectangle.
Scenes with viewport set can be still clipped/masked.

@issue: thorvg#2172
mgrudzinska added a commit to mgrudzinska/thorvg that referenced this issue May 9, 2024
New api can be used to replace clipping with a rectangle.
Scenes with viewport set can be still clipped/masked.

@issue: thorvg#2172
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improve features renderer Core rendering
Projects
Status: In Progress
Development

No branches or pull requests

2 participants