[dia] Outline: optimize rendering of filled and stroked object



commit f587106408e2be2b48e49a3ee3e9ea58f6f61126
Author: Hans Breuer <hans breuer org>
Date:   Sat Apr 26 22:16:47 2014 +0200

    Outline: optimize rendering of filled and stroked object
    
    Additional optimization is getting rid of the stroke call altogether, if
    the object is filled, the stroke color is the same and the line width is
    zero.

 objects/standard/outline.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/objects/standard/outline.c b/objects/standard/outline.c
index 9f093dc..147b0e5 100644
--- a/objects/standard/outline.c
+++ b/objects/standard/outline.c
@@ -403,11 +403,13 @@ outline_draw(Outline *outline, DiaRenderer *renderer)
       ++n;
     }
   }
+  if (pts[n-1].type == BEZ_MOVE_TO)
+    --total; /* remove a potential last move which would otherwise be rendered as a dot */
 
   if (DIA_RENDERER_GET_CLASS (renderer)->is_capable_to(renderer, RENDER_HOLES)) {
-    if (outline->show_background)
-      DIA_RENDERER_GET_CLASS (renderer)->draw_beziergon(renderer, pts, total, &outline->fill_color, NULL);
-    DIA_RENDERER_GET_CLASS (renderer)->draw_bezier (renderer, pts, total, &outline->line_color);
+    DIA_RENDERER_GET_CLASS (renderer)->draw_beziergon(renderer, pts, total,
+                           outline->show_background ? &outline->fill_color : NULL,
+                           &outline->line_color);
     return; /* that was easy ;) */
   }
   /* otherwise split the path data into piece which can be handled by Dia's standard bezier rendering */


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