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

Partial renderer: Initial work #1008

Merged
merged 2 commits into from Mar 3, 2022
Merged

Conversation

ogoffart
Copy link
Member

@ogoffart ogoffart commented Mar 3, 2022

No description provided.

@ogoffart ogoffart requested a review from tronical March 3, 2022 12:51
@ogoffart ogoffart force-pushed the olivier/wip/mcu-partial-rendering branch from 3a1a124 to 190f255 Compare March 3, 2022 13:00
@ogoffart ogoffart force-pushed the olivier/wip/mcu-partial-rendering branch from 190f255 to 998b2f7 Compare March 3, 2022 13:06
internal/core/item_rendering.rs Outdated Show resolved Hide resolved

//let clip = self.get_current_clip().intersection(&self.dirty_region.to_rect());
//let draw = clip.map_or(false, |r| r.intersects(&item_geometry));
//FIXME: the dirty_region is in global coordinate but item_geometry and current_clip is not
Copy link
Member Author

Choose a reason for hiding this comment

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

Either i should keep a local cache of the current translation, or somehow a getter for the current translation to the ItemRenderer.
With rotate this could be an arbitrary transform tough

internal/backends/mcu/renderer.rs Outdated Show resolved Hide resolved
@ogoffart ogoffart force-pushed the olivier/wip/mcu-partial-rendering branch from 998b2f7 to cf3cb7c Compare March 3, 2022 13:12
let prepare_scene = PrepareScene::new(size, factor, runtime_window.default_font_properties());
let mut renderer = i_slint_core::item_rendering::PartialRenderer::new(cache, prepare_scene);

let mut dirty_region = i_slint_core::item_rendering::DirtyRegion::default();
Copy link
Member

Choose a reason for hiding this comment

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

Is this variable needed? It seems to me that renderer.dirty_region is the true source that's updated in the compute_dirty_regions() calls below and the union calls appear to make this variable just "tail" it.

Perhaps into_inner can "spit" out the "old" renderer and the final computed dirty region?

Copy link
Member Author

Choose a reason for hiding this comment

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

but in case there are popups we need to make the union of all dirty regions.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, that's true. But isn't that already the case? I don't see the renderer's dirty_region being reset between the components (main and possible popup) in the callback passed to draw_contents?

@ogoffart ogoffart merged commit b2caa75 into master Mar 3, 2022
@ogoffart ogoffart deleted the olivier/wip/mcu-partial-rendering branch March 7, 2022 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants