[librsvg: 29/31] Comments on next steps, with "TODO" in them




commit aac4d8fb453e4fed98ccd803fa835d687a564a36
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed Jun 2 20:40:11 2021 -0500

    Comments on next steps, with "TODO" in them

 src/drawing_ctx.rs | 10 ++++++++++
 src/shapes.rs      |  2 ++
 2 files changed, 12 insertions(+)
---
diff --git a/src/drawing_ctx.rs b/src/drawing_ctx.rs
index 73906269..e844a7d5 100644
--- a/src/drawing_ctx.rs
+++ b/src/drawing_ctx.rs
@@ -749,6 +749,9 @@ impl DrawingCtx {
 
                     let params = temporary_draw_ctx.get_view_params();
 
+                    // TODO: the stroke/fill paint are already resolved for shapes.  Outside of shapes,
+                    // they are also needed for filters in all elements.  Maybe we should make them part
+                    // of the StackingContext instead of Shape?
                     let stroke_paint_source = Rc::new(
                         values
                             .stroke()
@@ -1294,6 +1297,8 @@ impl DrawingCtx {
         cr.paint();
     }
 
+    // TODO: just like we have Shape with all its parameters, do the
+    // same for a layout::Image.
     pub fn draw_image(
         &mut self,
         surface: &SharedImageSurface,
@@ -1352,6 +1357,7 @@ impl DrawingCtx {
         )
     }
 
+    // TODO: just like we have Shape with all its parameters, do the same for a layout::Text.
     pub fn draw_text(
         &mut self,
         layout: &pango::Layout,
@@ -1473,6 +1479,10 @@ impl DrawingCtx {
         let mut surface = ExclusiveImageSurface::new(width, height, SurfaceType::SRgb)?;
 
         surface.draw(&mut |cr| {
+            // TODO: apparently DrawingCtx.cr_stack is just a way to store pairs of
+            // (surface, transform).  Can we turn it into a DrawingCtx.surface_stack
+            // instead?  See what CSS isolation would like to call that; are the pairs just
+            // stacking contexts instead, or the result of rendering stacking contexts?
             for (depth, draw) in self.cr_stack.borrow().iter().enumerate() {
                 let affines = CompositingAffines::new(
                     Transform::from(draw.get_matrix()),
diff --git a/src/shapes.rs b/src/shapes.rs
index d794c846..aa67c200 100644
--- a/src/shapes.rs
+++ b/src/shapes.rs
@@ -32,6 +32,7 @@ struct ShapeDef {
     markers: Markers,
 }
 
+// TODO: move Shape to layout.rs?
 pub struct Shape {
     pub path: Rc<SvgPath>,
     pub markers: Markers,
@@ -43,6 +44,7 @@ pub struct Shape {
     pub fill_rule: FillRule,
     pub clip_rule: ClipRule,
     pub shape_rendering: ShapeRendering,
+    // TODO: resolve the markers here, to avoid passing ComputedValues to render_markers_for_path()
 }
 
 impl ShapeDef {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]