Commit graph

504 commits

Author SHA1 Message Date
Simon Hausmann
b0851301d0 Fix rendering of border rects with border-width = 0
Don't stroke such rectangles.
2022-08-02 12:00:56 +02:00
Simon Hausmann
f47a1221fb Implement rendering of the native style with Skia 2022-08-02 12:00:56 +02:00
Simon Hausmann
33d080924c Implement ImageRendering option for Skia 2022-08-02 12:00:56 +02:00
Simon Hausmann
e8c7cf32db Implement release_graphics_resources() for Skia 2022-08-02 12:00:56 +02:00
Simon Hausmann
dacf083162 Silence unused paramter warnings 2022-08-02 12:00:56 +02:00
Simon Hausmann
4d73d50664 Don't use deprecated Skia functions 2022-08-02 12:00:56 +02:00
Simon Hausmann
4da67036ac Add support for custom fonts 2022-08-02 12:00:56 +02:00
Simon Hausmann
59cab28d0d Add support for layer caching 2022-08-02 12:00:56 +02:00
Simon Hausmann
5e670dd511 Add support for caching the box shadow 2022-08-02 12:00:56 +02:00
Olivier Goffart
77db0ea8b7 Skia: fix the text_size() to avoid one letter being chopped off 2022-08-02 12:00:56 +02:00
Olivier Goffart
44f905fc5f skia: implement Path 2022-08-02 12:00:56 +02:00
Olivier Goffart
4ff8daa2ac skia: implement text vertical alignment 2022-08-02 12:00:56 +02:00
Olivier Goffart
881fbcb86d skia: Implement colorized image 2022-08-02 12:00:56 +02:00
Olivier Goffart
159e72f702 skia: Implement drop shadow 2022-08-02 12:00:56 +02:00
Simon Hausmann
01f09599dc Add support for rendering SVGs 2022-08-02 12:00:56 +02:00
Olivier Goffart
183d58b876 Skia: attempt to get text eliding and alignment 2022-08-02 12:00:56 +02:00
Simon Hausmann
793327f5c1 Initial support for image rendering
This lacks support for colorization, image rendering quality and SVG.
2022-08-02 12:00:56 +02:00
Simon Hausmann
eb5edf0ea4 Fix incorrectly reported text metrics
Return the intrinsic maximum width of the text, not the theoretical max :)
2022-08-02 12:00:56 +02:00
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
Tobias Hunger
174920a518 Factor out code to create the QSytleOptionGroupBox 2022-07-27 10:14:05 +02:00
Tobias Hunger
3ae9d2576e Fix formatting (no code change!) 2022-07-27 10:14:05 +02:00
Tobias Hunger
1544158344 Consider label when calculating layout info for native groupboxes 2022-07-27 10:14:05 +02:00
Tobias Hunger
5199556e9d Watch groupbox.rs for changes (due to use of cpp! macros)
Also make sure all files containing the cpp! macro are actually listed
and the list is sorted for easier comparison.
2022-07-27 10:14:05 +02:00
Simon Hausmann
b47eb8507a Remove the rtti-winit and rtti-qt features
These are not needed anymore, as the selector can enable the respective rtti features
in the winit and gl crate when its own rtti features is enabled.
2022-07-26 17:43:51 +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
Olivier Goffart
8c70cd7f57
Move the fonts out of the Backend trait (#1438)
and remove the `'static`
2022-07-26 16:45:54 +02:00
Olivier Goffart
793974ce9f Make just one function to fire both timers and animations
Also simplify the Qt backend since only the paint event will
query the animated properties that should then cause a refresh
one frame later
2022-07-26 15:13:07 +02:00
Olivier Goffart
dab2668598 Fix build of MCU simulator 2022-07-26 11:27:44 +02:00
Simon Hausmann
2501858f6c janitor: fix linux build 2022-07-26 10:35:43 +02:00
Simon Hausmann
639c70dfc5 Remove winit dependency from femtovg renderer 2022-07-26 10:25:35 +02:00
Olivier Goffart
20d5cb72ed Move the init_dirty_region dirrectly into the Renderer
This means we will query the size of the popup also for the GL backend
even if the backend don't need to be marked dirty, but that should be
alright.
2022-07-25 17:53:15 +02:00
Simon Hausmann
369f347b29 Move the clipboard back from the Window to the Backend trait
Found a way to connect the clipboard to the wayland display through the winit event loop target.
2022-07-25 15:41:51 +02:00
Olivier Goffart
8287ed4b9e Some more simplifications of the PlatformWindow and Backend trait 2022-07-25 14:51:03 +02:00
Olivier Goffart
a4b859f12c Fix clearing up of caches with the simulator 2022-07-25 12:04:34 +02:00
Olivier Goffart
f7637b521f More PlatformWindow trait simplification: Component registation optional
Forward the free graphics resource to the renderer by default
2022-07-25 12:04:34 +02:00