glamor: Changes to 'master'

Zhigang Gong gongzg at kemper.freedesktop.org
Thu Jan 23 05:08:19 PST 2014


 src/glamor_polylines.c |  166 +++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 146 insertions(+), 20 deletions(-)

New commits:
commit 2b4a324b03c3ee34de1c122a6db4e6ce7146a3e0
Author: Aaron Watry <awatry at gmail.com>
Date:   Thu Jan 9 19:16:31 2014 -0600

    polylines: Handle diagonal lines
    
    Split a diagonal line into 2 or more horizontal/vertical lines.
    
    We want to split the line into as small a number of segments as possible.
    
    E.g. line from (x,y) of (1,1)->(5,2) with a slope of .25 would be split into:
    (1,1)->(2,1), (3,2)->(5,2)
    
    This is basically an implementation of Bresenham's line algorithm but with
    FP instead of integers.
    
    If the line's horizontal-ish, then iterate over the x values, and
    every time the rounded y value changes, start a new rectangle.
    If abs(slope) is > 1, then iterate over the y values instead.
    If the slope is == 1, then we're basically stuck drawing a bunch of points.
    
    Partially Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=68524
    
    Signed-off-by: Aaron Watry <awatry at gmail.com>
    Reviewed-by: Zhigang Gong <zhigang.gong at linux.intel.com>



More information about the xorg-commit mailing list