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

Don't repaint window every frame #646

Closed
grokys opened this issue Aug 2, 2016 · 2 comments · Fixed by #827
Closed

Don't repaint window every frame #646

grokys opened this issue Aug 2, 2016 · 2 comments · Fixed by #827

Comments

@grokys
Copy link
Member

grokys commented Aug 2, 2016

We currently repaint the whole window on every frame. This is obviously not ideal - we should just repaint the dirty regions.

@grokys grokys added this to the Beta 1 milestone Aug 2, 2016
@ncarrillo
Copy link
Contributor

I took a stab at this, by having the RenderNeeded stream in the RenderQueueManager pass the transformed bounds of the visual, which then got passed to the Invalidate method of ITopLevelImpl.

I did this and some things seem to work, anything involving dirtying layout is broken, so I need to look into that.

This seems like only half the battle though, as the entire Visual Tree still gets walked and rasterized. It seems like the Paint callback in ITopLevelRenderer passes the top level visual to IRenderTarget.Render. So we need a way to go from the bounds that get passed to the callback to the Visual.

@ncarrillo
Copy link
Contributor

I've done some work on my dirty-region branch here

I mark nodes as dirty on InvalidateVisual and in IRenderTarget.Render I draw only the ones that have been dirtied since the last frame. In ITopLevelRenderer the Paint callback handles clearing the dirty bits from the visuals once done.

There are some rendering artifacts, here and there, and I'm certain the dirty rect getting sent for invalidation is off, but maybe it is a start?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants