Commit graph

267 commits

Author SHA1 Message Date
Simon Hausmann
38e1a4f9c8 Set font weight and letter spacing 2022-08-02 12:00:56 +02:00
Simon Hausmann
ca30af383b Don't panic when the clip region is empty
It may happen that the clip region becomes empty (for literally invisible items).
For example this happens in the printer demo.
In that case we want to return an empty rect.
2022-08-02 12:00:56 +02:00
Simon Hausmann
60d5ea8929 Fix height for width for text
Scale the max_width to physical pixels
2022-08-02 12:00:56 +02:00
Simon Hausmann
480da2506c Remove unused import (oops) 2022-08-02 12:00:56 +02:00
Simon Hausmann
c587c3a270 Avoid re-creating the font collection every time we lay out text 2022-08-02 12:00:56 +02:00
Olivier Goffart
2e1044afd7 skia backend: gradients 2022-08-02 12:00:56 +02:00
Simon Hausmann
89a7a4fb30 Render the output of the performance counter 2022-08-02 12:00:56 +02:00
Simon Hausmann
780775a303 Begin work on text rendering 2022-08-02 12:00:56 +02:00
Simon Hausmann
9bfd8c8477 Implement clipping 2022-08-02 12:00:56 +02:00
Simon Hausmann
69fa40ebbf Implement drawing of rounded rects with border 2022-08-02 12:00:56 +02:00
Simon Hausmann
aac89c458a Implement translate, opacity layers and global opacity
The latter requires manually applying the alpha to colors. But on the upside, opacity
layers are a built-in feature.
2022-08-02 12:00:56 +02:00
Simon Hausmann
771b122198 Add skia renderer skeleton
This one can render basically just plain rectangles.
2022-08-02 12:00:56 +02:00
Simon Hausmann
086880f605 Speed up rendering of clipped children
When the renderer does not re-implement visit_clip, we call combine_clip.
Then we're missing out on an optimization the GL renderer does: When the resulting clip region
is empty, we do not need to recurse into children for rendering.

That itself reduces the property dependency chain and avoids unnecessary
updates when invisible (clipped) children change properties.
2022-08-02 11:07:46 +02:00
Simon Hausmann
70781534f5 Delegate the renderer decision into the winit backend 2022-07-28 19:03:01 +02:00
Simon Hausmann
b782e43226 Make it possible to have multiple renderers in the winit crate
Make GLWindow generic over the renderer and canvas
2022-07-28 19:03:01 +02:00
Simon Hausmann
3619989fcc Rename backend feature flags to accomodate more renderers
Split backend-gl-* into eventloop-winit-* and renderer-femtovg.

The old feature names are still available.

For consistency eventloop-qt and renderer-qt are aliases for backend-qt.
2022-07-26 17:43:51 +02:00
Simon Hausmann
27bf9348e6 Rename the backend-gl crate into backend-winit 2022-07-26 17:43:51 +02:00