[PATCH 14/20] glamor: stub out lines

Alex Deucher alexdeucher at gmail.com
Wed Mar 19 08:15:34 PDT 2014


On Wed, Mar 19, 2014 at 10:53 AM, Markus Wick <markus at selfnet.de> wrote:
> I think this functions are worth to reimplement. eg horizontal lines are
> used a lot and very slow on mi.
> How are the interpolation requirement for a line? Is it possible to achive
> them with an opengl quad?

Standalone glamor has a hw accelerated version:
http://cgit.freedesktop.org/xorg/driver/glamor/commit/?id=2b4a324b03c3ee34de1c122a6db4e6ce7146a3e0
It's not optimal, but it is faster than sw.

Alex

>
> Am 2014-03-19 06:09, schrieb Keith Packard:
>>
>> Use mi line code for now
>>
>> Signed-off-by: Keith Packard <keithp at keithp.com>
>> ---
>>  glamor/glamor_core.c | 23 +++++++++++++++++++++--
>>  1 file changed, 21 insertions(+), 2 deletions(-)
>>
>> diff --git a/glamor/glamor_core.c b/glamor/glamor_core.c
>> index f350746..1536c54 100644
>> --- a/glamor/glamor_core.c
>> +++ b/glamor/glamor_core.c
>> @@ -412,6 +412,25 @@ glamor_stipple(PixmapPtr pixmap, PixmapPtr stipple,
>>      return FALSE;
>>  }
>>
>> +static void
>> +glamor_fallback_poly_line(DrawablePtr pDrawable, GCPtr pGC, int mode,
>> int npt, DDXPointPtr ppt)
>> +{
>> +    void (*line) (DrawablePtr, GCPtr, int mode, int npt, DDXPointPtr
>> ppt);
>> +
>> +    if (pGC->lineWidth == 0) {
>> +        if (pGC->lineStyle != LineSolid)
>> +            line = miZeroDashLine;
>> +        else
>> +            line = miZeroLine;
>> +    } else {
>> +        if (pGC->lineStyle != LineSolid)
>> +            line = miWideDash;
>> +        else
>> +            line = miWideLine;
>> +    }
>> +    (*line) (pDrawable, pGC, mode, npt, ppt);
>> +}
>> +
>>  GCOps glamor_gc_ops = {
>>      .FillSpans = glamor_fillspans,
>>      .SetSpans = glamor_setspans,
>> @@ -419,8 +438,8 @@ GCOps glamor_gc_ops = {
>>      .CopyArea = glamor_copyarea,
>>      .CopyPlane = glamor_copyplane,
>>      .PolyPoint = glamor_poly_point,
>> -    .Polylines = glamor_poly_lines,
>> -    .PolySegment = glamor_poly_segment,
>> +    .Polylines = glamor_fallback_poly_line,
>> +    .PolySegment = miPolySegment,
>>      .PolyRectangle = miPolyRectangle,
>>      .PolyArc = miPolyArc,
>>      .FillPolygon = miFillPolygon,
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel


More information about the xorg-devel mailing list