linebender / parley

Rich text layout library
Apache License 2.0
228 stars 28 forks source link

vello_editor: Always paint on RedrawRequested. #145

Closed xorgy closed 1 month ago

xorgy commented 1 month ago

In non-composited environments, damage accumulates if we don't present.

xorgy commented 1 month ago

This is, in part, a fix for a regression caused by #143 on non-composited environments (e.g. uncomposited X11, sometimes Windows).

xorgy commented 1 month ago

The efficient way to handle this is probably to do a pass with LoadOp::Load or some such, since we know the configuration hasn't changed, or somehow to present the old texture again (idk if this is a thing).

waywardmonkeys commented 1 month ago

This would be better with a better Vello rendering API separating rendering to a texture and the blit to the surface.

xorgy commented 1 month ago

I gave a first try at writing a render pass that would load the old image and do nothing, but the old image is black on my platform, I suspect this is not a real way to do this. Preventing redraw might involve at least copying the surface texture, or always rendering to texture.