refactor: no need to pass Fonts structure to tessellator
This makes the tesselator take only data as argument, which is a lot nicer.
This commit is contained in:
+6
-2
@@ -602,10 +602,14 @@ impl Context {
|
||||
/// Tessellate the given shapes into triangle meshes.
|
||||
pub fn tessellate(&self, shapes: Vec<ClippedShape>) -> Vec<ClippedMesh> {
|
||||
let mut tessellation_options = self.memory().options.tessellation_options;
|
||||
tessellation_options.pixels_per_point = self.pixels_per_point();
|
||||
tessellation_options.aa_size = 1.0 / self.pixels_per_point();
|
||||
let paint_stats = PaintStats::from_shapes(&shapes); // TODO: internal allocations
|
||||
let clipped_meshes =
|
||||
tessellator::tessellate_shapes(shapes, tessellation_options, self.fonts());
|
||||
let clipped_meshes = tessellator::tessellate_shapes(
|
||||
shapes,
|
||||
tessellation_options,
|
||||
self.fonts().texture().size(),
|
||||
);
|
||||
*self.paint_stats.lock() = paint_stats.with_clipped_meshes(&clipped_meshes);
|
||||
clipped_meshes
|
||||
}
|
||||
|
||||
@@ -124,6 +124,7 @@ impl Widget for &mut epaint::TessellationOptions {
|
||||
fn ui(self, ui: &mut Ui) -> Response {
|
||||
ui.vertical(|ui| {
|
||||
let epaint::TessellationOptions {
|
||||
pixels_per_point: _,
|
||||
aa_size: _,
|
||||
anti_alias,
|
||||
coarse_tessellation_culling,
|
||||
|
||||
Reference in New Issue
Block a user