freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype][master] [raster] Clean up vertical sweep.


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype][master] [raster] Clean up vertical sweep.
Date: Mon, 28 Jun 2021 14:22:47 +0000

Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType

Commits:

2 changed files:

Changes:

  • ChangeLog
    1
    +2021-06-28  Alexei Podtelezhnikov  <apodtele@gmail.com>
    
    2
    +
    
    3
    +	[raster] Clean up vertical sweep.
    
    4
    +
    
    5
    +	* src/raster/ftraster.c (black_TWorker): Replace the current line
    
    6
    +	offset with the pointer and drop the increment.
    
    7
    +	(Function_Sweep_Init): Take values as arguments instead of pointers.
    
    8
    +	(Vertical_Sweep_*, Horizontal_Sweep_Init, Draw_Sweep): Updated.
    
    9
    +
    
    1 10
     2021-06-25  Alexei Podtelezhnikov  <apodtele@gmail.com>
    
    2 11
     
    
    3 12
     	[raster] Make `band_top' local variable.
    

  • src/raster/ftraster.c
    ... ... @@ -417,8 +417,8 @@
    417 417
     
    
    418 418
       /* prototypes used for sweep function dispatch */
    
    419 419
       typedef void
    
    420
    -  Function_Sweep_Init( RAS_ARGS Short*  min,
    
    421
    -                                Short*  max );
    
    420
    +  Function_Sweep_Init( RAS_ARGS Short  min,
    
    421
    +                                Short  max );
    
    422 422
     
    
    423 423
       typedef void
    
    424 424
       Function_Sweep_Span( RAS_ARGS Short       y,
    
    ... ... @@ -487,6 +487,7 @@
    487 487
     
    
    488 488
         UShort      bWidth;             /* target bitmap width                 */
    
    489 489
         PByte       bOrigin;            /* target bitmap bottom-left origin    */
    
    490
    +    PByte       bLine;              /* target bitmap current line          */
    
    490 491
     
    
    491 492
         Long        lastX, lastY;
    
    492 493
         Long        minY, maxY;
    
    ... ... @@ -508,9 +509,6 @@
    508 509
         FT_Bitmap   target;             /* description of target bit/pixmap    */
    
    509 510
         FT_Outline  outline;
    
    510 511
     
    
    511
    -    Long        traceOfs;           /* current offset in target bitmap     */
    
    512
    -    Short       traceIncr;          /* sweep's increment in target bitmap  */
    
    513
    -
    
    514 512
         /* dispatch variables */
    
    515 513
     
    
    516 514
         Function_Sweep_Init*  Proc_Sweep_Init;
    
    ... ... @@ -2205,16 +2203,13 @@
    2205 2203
        */
    
    2206 2204
     
    
    2207 2205
       static void
    
    2208
    -  Vertical_Sweep_Init( RAS_ARGS Short*  min,
    
    2209
    -                                Short*  max )
    
    2206
    +  Vertical_Sweep_Init( RAS_ARGS Short  min,
    
    2207
    +                                Short  max )
    
    2210 2208
       {
    
    2211
    -    Long  pitch = ras.target.pitch;
    
    2212
    -
    
    2213 2209
         FT_UNUSED( max );
    
    2214 2210
     
    
    2215 2211
     
    
    2216
    -    ras.traceIncr = (Short)-pitch;
    
    2217
    -    ras.traceOfs  = -*min * pitch;
    
    2212
    +    ras.bLine = ras.bOrigin - min * ras.target.pitch;
    
    2218 2213
       }
    
    2219 2214
     
    
    2220 2215
     
    
    ... ... @@ -2276,7 +2271,7 @@
    2276 2271
           f1 = (Byte)  ( 0xFF >> ( e1 & 7 ) );
    
    2277 2272
           f2 = (Byte) ~( 0x7F >> ( e2 & 7 ) );
    
    2278 2273
     
    
    2279
    -      target = ras.bOrigin + ras.traceOfs + c1;
    
    2274
    +      target = ras.bLine + c1;
    
    2280 2275
           c2 -= c1;
    
    2281 2276
     
    
    2282 2277
           if ( c2 > 0 )
    
    ... ... @@ -2428,8 +2423,8 @@
    2428 2423
             c1 = (Short)( e1 >> 3 );
    
    2429 2424
             f1 = (Short)( e1 &  7 );
    
    2430 2425
     
    
    2431
    -        if ( e1 >= 0 && e1 < ras.bWidth                      &&
    
    2432
    -             ras.bOrigin[ras.traceOfs + c1] & ( 0x80 >> f1 ) )
    
    2426
    +        if ( e1 >= 0 && e1 < ras.bWidth     &&
    
    2427
    +             ras.bLine[c1] & ( 0x80 >> f1 ) )
    
    2433 2428
               goto Exit;
    
    2434 2429
           }
    
    2435 2430
           else
    
    ... ... @@ -2445,7 +2440,7 @@
    2445 2440
           c1 = (Short)( e1 >> 3 );
    
    2446 2441
           f1 = (Short)( e1 & 7 );
    
    2447 2442
     
    
    2448
    -      ras.bOrigin[ras.traceOfs + c1] |= (char)( 0x80 >> f1 );
    
    2443
    +      ras.bLine[c1] |= (char)( 0x80 >> f1 );
    
    2449 2444
         }
    
    2450 2445
     
    
    2451 2446
       Exit:
    
    ... ... @@ -2456,7 +2451,7 @@
    2456 2451
       static void
    
    2457 2452
       Vertical_Sweep_Step( RAS_ARG )
    
    2458 2453
       {
    
    2459
    -    ras.traceOfs += ras.traceIncr;
    
    2454
    +    ras.bLine -= ras.target.pitch;
    
    2460 2455
       }
    
    2461 2456
     
    
    2462 2457
     
    
    ... ... @@ -2470,8 +2465,8 @@
    2470 2465
        */
    
    2471 2466
     
    
    2472 2467
       static void
    
    2473
    -  Horizontal_Sweep_Init( RAS_ARGS Short*  min,
    
    2474
    -                                  Short*  max )
    
    2468
    +  Horizontal_Sweep_Init( RAS_ARGS Short  min,
    
    2469
    +                                  Short  max )
    
    2475 2470
       {
    
    2476 2471
         /* nothing, really */
    
    2477 2472
         FT_UNUSED_RASTER;
    
    ... ... @@ -2741,7 +2736,7 @@
    2741 2736
     
    
    2742 2737
         /* now initialize the sweep */
    
    2743 2738
     
    
    2744
    -    ras.Proc_Sweep_Init( RAS_VARS &min_Y, &max_Y );
    
    2739
    +    ras.Proc_Sweep_Init( RAS_VARS min_Y, max_Y );
    
    2745 2740
     
    
    2746 2741
         /* then compute the distance of each profile from min_Y */
    
    2747 2742
     
    


  • reply via email to

    [Prev in Thread] Current Thread [Next in Thread]