freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype][master] 2 commits: * src/raster/ftraster.c: Tra


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype][master] 2 commits: * src/raster/ftraster.c: Tracing updates.
Date: Tue, 10 Oct 2023 02:27:19 +0000

Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType

Commits:

  • 84cd2e98
    by Alexei Podtelezhnikov (Алексей Подтележников) at 2023-10-09T22:11:41-04:00
    * src/raster/ftraster.c: Tracing updates.
    
  • 322e580b
    by Alexei Podtelezhnikov (Алексей Подтележников) at 2023-10-09T22:22:24-04:00
    * src/smooth/ftgrays.c: Move the sweep functions...
    
    ... out of the setjmp/longjmp scope for readability.
    

2 changed files:

Changes:

  • src/raster/ftraster.c
    ... ... @@ -645,13 +645,13 @@
    645 645
           if ( overshoot )
    
    646 646
             ras.cProfile->flags |= Overshoot_Bottom;
    
    647 647
     
    
    648
    -      FT_TRACE6(( "  new ascending profile = "">\n", (void *)ras.cProfile ));
    
    648
    +      FT_TRACE7(( "  new ascending profile = "">\n", (void *)ras.cProfile ));
    
    649 649
           break;
    
    650 650
     
    
    651 651
         case Descending_State:
    
    652 652
           if ( overshoot )
    
    653 653
             ras.cProfile->flags |= Overshoot_Top;
    
    654
    -      FT_TRACE6(( "  new descending profile = "">\n", (void *)ras.cProfile ));
    
    654
    +      FT_TRACE7(( "  new descending profile = "">\n", (void *)ras.cProfile ));
    
    655 655
           break;
    
    656 656
     
    
    657 657
         default:
    
    ... ... @@ -707,7 +707,7 @@
    707 707
           PProfile  oldProfile;
    
    708 708
     
    
    709 709
     
    
    710
    -      FT_TRACE6(( "  ending profile %p, start = %ld, height = %ld\n",
    
    710
    +      FT_TRACE7(( "  ending profile %p, start = %ld, height = %ld\n",
    
    711 711
                       (void *)ras.cProfile, ras.cProfile->start, h ));
    
    712 712
     
    
    713 713
           ras.cProfile->height = h;
    
    ... ... @@ -3038,6 +3038,9 @@
    3038 3038
             if ( y_min == y_max )
    
    3039 3039
               return ras.error;  /* still Raster_Overflow */
    
    3040 3040
     
    
    3041
    +        FT_TRACE6(( "band [%d..%d]: to be bisected\n",
    
    3042
    +                    y_min, y_max ));
    
    3043
    +
    
    3041 3044
             y_mid = ( y_min + y_max ) >> 1;
    
    3042 3045
     
    
    3043 3046
             band_stack[band_top++] = y_min;
    
    ... ... @@ -3045,6 +3048,9 @@
    3045 3048
           }
    
    3046 3049
           else
    
    3047 3050
           {
    
    3051
    +        FT_TRACE6(( "band [%d..%d]: %td bytes remaining\n",
    
    3052
    +                    y_min, y_max, (char*)ras.maxBuff - (char*)ras.top ));
    
    3053
    +
    
    3048 3054
             if ( ras.fProfile )
    
    3049 3055
               if ( Draw_Sweep( RAS_VAR ) )
    
    3050 3056
                  return ras.error;
    
    ... ... @@ -3095,7 +3101,7 @@
    3095 3101
         }
    
    3096 3102
     
    
    3097 3103
         /* Vertical Sweep */
    
    3098
    -    FT_TRACE7(( "Vertical pass (ftraster)\n" ));
    
    3104
    +    FT_TRACE6(( "Vertical pass (ftraster)\n" ));
    
    3099 3105
     
    
    3100 3106
         ras.Proc_Sweep_Init = Vertical_Sweep_Init;
    
    3101 3107
         ras.Proc_Sweep_Span = Vertical_Sweep_Span;
    
    ... ... @@ -3115,7 +3121,7 @@
    3115 3121
         /* Horizontal Sweep */
    
    3116 3122
         if ( !( ras.outline.flags & FT_OUTLINE_SINGLE_PASS ) )
    
    3117 3123
         {
    
    3118
    -      FT_TRACE7(( "Horizontal pass (ftraster)\n" ));
    
    3124
    +      FT_TRACE6(( "Horizontal pass (ftraster)\n" ));
    
    3119 3125
     
    
    3120 3126
           ras.Proc_Sweep_Init = Horizontal_Sweep_Init;
    
    3121 3127
           ras.Proc_Sweep_Span = Horizontal_Sweep_Span;
    

  • src/smooth/ftgrays.c
    ... ... @@ -1486,139 +1486,6 @@ typedef ptrdiff_t FT_PtrDist;
    1486 1486
       }
    
    1487 1487
     
    
    1488 1488
     
    
    1489
    -  static void
    
    1490
    -  gray_sweep( RAS_ARG )
    
    1491
    -  {
    
    1492
    -    int  fill = ( ras.outline.flags & FT_OUTLINE_EVEN_ODD_FILL ) ? 0x100
    
    1493
    -                                                                 : INT_MIN;
    
    1494
    -    int  coverage;
    
    1495
    -    int  y;
    
    1496
    -
    
    1497
    -
    
    1498
    -    for ( y = ras.min_ey; y < ras.max_ey; y++ )
    
    1499
    -    {
    
    1500
    -      PCell   cell  = ras.ycells[y - ras.min_ey];
    
    1501
    -      TCoord  x     = ras.min_ex;
    
    1502
    -      TArea   cover = 0;
    
    1503
    -
    
    1504
    -      unsigned char*  line = ras.target.origin - ras.target.pitch * y;
    
    1505
    -
    
    1506
    -
    
    1507
    -      for ( ; cell != ras.cell_null; cell = cell->next )
    
    1508
    -      {
    
    1509
    -        TArea  area;
    
    1510
    -
    
    1511
    -
    
    1512
    -        if ( cover != 0 && cell->x > x )
    
    1513
    -        {
    
    1514
    -          FT_FILL_RULE( coverage, cover, fill );
    
    1515
    -          FT_GRAY_SET( line + x, coverage, cell->x - x );
    
    1516
    -        }
    
    1517
    -
    
    1518
    -        cover += (TArea)cell->cover * ( ONE_PIXEL * 2 );
    
    1519
    -        area   = cover - cell->area;
    
    1520
    -
    
    1521
    -        if ( area != 0 && cell->x >= ras.min_ex )
    
    1522
    -        {
    
    1523
    -          FT_FILL_RULE( coverage, area, fill );
    
    1524
    -          line[cell->x] = (unsigned char)coverage;
    
    1525
    -        }
    
    1526
    -
    
    1527
    -        x = cell->x + 1;
    
    1528
    -      }
    
    1529
    -
    
    1530
    -      if ( cover != 0 )  /* only if cropped */
    
    1531
    -      {
    
    1532
    -        FT_FILL_RULE( coverage, cover, fill );
    
    1533
    -        FT_GRAY_SET( line + x, coverage, ras.max_ex - x );
    
    1534
    -      }
    
    1535
    -    }
    
    1536
    -  }
    
    1537
    -
    
    1538
    -
    
    1539
    -  static void
    
    1540
    -  gray_sweep_direct( RAS_ARG )
    
    1541
    -  {
    
    1542
    -    int  fill = ( ras.outline.flags & FT_OUTLINE_EVEN_ODD_FILL ) ? 0x100
    
    1543
    -                                                                 : INT_MIN;
    
    1544
    -    int  coverage;
    
    1545
    -    int  y;
    
    1546
    -
    
    1547
    -    FT_Span  span[FT_MAX_GRAY_SPANS];
    
    1548
    -    int      n = 0;
    
    1549
    -
    
    1550
    -
    
    1551
    -    for ( y = ras.min_ey; y < ras.max_ey; y++ )
    
    1552
    -    {
    
    1553
    -      PCell   cell  = ras.ycells[y - ras.min_ey];
    
    1554
    -      TCoord  x     = ras.min_ex;
    
    1555
    -      TArea   cover = 0;
    
    1556
    -
    
    1557
    -
    
    1558
    -      for ( ; cell != ras.cell_null; cell = cell->next )
    
    1559
    -      {
    
    1560
    -        TArea  area;
    
    1561
    -
    
    1562
    -
    
    1563
    -        if ( cover != 0 && cell->x > x )
    
    1564
    -        {
    
    1565
    -          FT_FILL_RULE( coverage, cover, fill );
    
    1566
    -
    
    1567
    -          span[n].coverage = (unsigned char)coverage;
    
    1568
    -          span[n].x        = (short)x;
    
    1569
    -          span[n].len      = (unsigned short)( cell->x - x );
    
    1570
    -
    
    1571
    -          if ( ++n == FT_MAX_GRAY_SPANS )
    
    1572
    -          {
    
    1573
    -            /* flush the span buffer and reset the count */
    
    1574
    -            ras.render_span( y, n, span, ras.render_span_data );
    
    1575
    -            n = 0;
    
    1576
    -          }
    
    1577
    -        }
    
    1578
    -
    
    1579
    -        cover += (TArea)cell->cover * ( ONE_PIXEL * 2 );
    
    1580
    -        area   = cover - cell->area;
    
    1581
    -
    
    1582
    -        if ( area != 0 && cell->x >= ras.min_ex )
    
    1583
    -        {
    
    1584
    -          FT_FILL_RULE( coverage, area, fill );
    
    1585
    -
    
    1586
    -          span[n].coverage = (unsigned char)coverage;
    
    1587
    -          span[n].x        = (short)cell->x;
    
    1588
    -          span[n].len      = 1;
    
    1589
    -
    
    1590
    -          if ( ++n == FT_MAX_GRAY_SPANS )
    
    1591
    -          {
    
    1592
    -            /* flush the span buffer and reset the count */
    
    1593
    -            ras.render_span( y, n, span, ras.render_span_data );
    
    1594
    -            n = 0;
    
    1595
    -          }
    
    1596
    -        }
    
    1597
    -
    
    1598
    -        x = cell->x + 1;
    
    1599
    -      }
    
    1600
    -
    
    1601
    -      if ( cover != 0 )  /* only if cropped */
    
    1602
    -      {
    
    1603
    -        FT_FILL_RULE( coverage, cover, fill );
    
    1604
    -
    
    1605
    -        span[n].coverage = (unsigned char)coverage;
    
    1606
    -        span[n].x        = (short)x;
    
    1607
    -        span[n].len      = (unsigned short)( ras.max_ex - x );
    
    1608
    -
    
    1609
    -        ++n;
    
    1610
    -      }
    
    1611
    -
    
    1612
    -      if ( n )
    
    1613
    -      {
    
    1614
    -        /* flush the span buffer and reset the count */
    
    1615
    -        ras.render_span( y, n, span, ras.render_span_data );
    
    1616
    -        n = 0;
    
    1617
    -      }
    
    1618
    -    }
    
    1619
    -  }
    
    1620
    -
    
    1621
    -
    
    1622 1489
     #ifdef STANDALONE_
    
    1623 1490
     
    
    1624 1491
       /**************************************************************************
    
    ... ... @@ -1934,7 +1801,7 @@ typedef ptrdiff_t FT_PtrDist;
    1934 1801
           if ( continued )
    
    1935 1802
             FT_Trace_Enable();
    
    1936 1803
     
    
    1937
    -      FT_TRACE7(( "band [%d..%d]: %td cell%s remaining/\n",
    
    1804
    +      FT_TRACE7(( "band [%d..%d]: %td cell%s remaining\n",
    
    1938 1805
                       ras.min_ey,
    
    1939 1806
                       ras.max_ey,
    
    1940 1807
                       ras.cell_null - ras.cell_free,
    
    ... ... @@ -1952,6 +1819,139 @@ typedef ptrdiff_t FT_PtrDist;
    1952 1819
       }
    
    1953 1820
     
    
    1954 1821
     
    
    1822
    +  static void
    
    1823
    +  gray_sweep( RAS_ARG )
    
    1824
    +  {
    
    1825
    +    int  fill = ( ras.outline.flags & FT_OUTLINE_EVEN_ODD_FILL ) ? 0x100
    
    1826
    +                                                                 : INT_MIN;
    
    1827
    +    int  coverage;
    
    1828
    +    int  y;
    
    1829
    +
    
    1830
    +
    
    1831
    +    for ( y = ras.min_ey; y < ras.max_ey; y++ )
    
    1832
    +    {
    
    1833
    +      PCell   cell  = ras.ycells[y - ras.min_ey];
    
    1834
    +      TCoord  x     = ras.min_ex;
    
    1835
    +      TArea   cover = 0;
    
    1836
    +
    
    1837
    +      unsigned char*  line = ras.target.origin - ras.target.pitch * y;
    
    1838
    +
    
    1839
    +
    
    1840
    +      for ( ; cell != ras.cell_null; cell = cell->next )
    
    1841
    +      {
    
    1842
    +        TArea  area;
    
    1843
    +
    
    1844
    +
    
    1845
    +        if ( cover != 0 && cell->x > x )
    
    1846
    +        {
    
    1847
    +          FT_FILL_RULE( coverage, cover, fill );
    
    1848
    +          FT_GRAY_SET( line + x, coverage, cell->x - x );
    
    1849
    +        }
    
    1850
    +
    
    1851
    +        cover += (TArea)cell->cover * ( ONE_PIXEL * 2 );
    
    1852
    +        area   = cover - cell->area;
    
    1853
    +
    
    1854
    +        if ( area != 0 && cell->x >= ras.min_ex )
    
    1855
    +        {
    
    1856
    +          FT_FILL_RULE( coverage, area, fill );
    
    1857
    +          line[cell->x] = (unsigned char)coverage;
    
    1858
    +        }
    
    1859
    +
    
    1860
    +        x = cell->x + 1;
    
    1861
    +      }
    
    1862
    +
    
    1863
    +      if ( cover != 0 )  /* only if cropped */
    
    1864
    +      {
    
    1865
    +        FT_FILL_RULE( coverage, cover, fill );
    
    1866
    +        FT_GRAY_SET( line + x, coverage, ras.max_ex - x );
    
    1867
    +      }
    
    1868
    +    }
    
    1869
    +  }
    
    1870
    +
    
    1871
    +
    
    1872
    +  static void
    
    1873
    +  gray_sweep_direct( RAS_ARG )
    
    1874
    +  {
    
    1875
    +    int  fill = ( ras.outline.flags & FT_OUTLINE_EVEN_ODD_FILL ) ? 0x100
    
    1876
    +                                                                 : INT_MIN;
    
    1877
    +    int  coverage;
    
    1878
    +    int  y;
    
    1879
    +
    
    1880
    +    FT_Span  span[FT_MAX_GRAY_SPANS];
    
    1881
    +    int      n = 0;
    
    1882
    +
    
    1883
    +
    
    1884
    +    for ( y = ras.min_ey; y < ras.max_ey; y++ )
    
    1885
    +    {
    
    1886
    +      PCell   cell  = ras.ycells[y - ras.min_ey];
    
    1887
    +      TCoord  x     = ras.min_ex;
    
    1888
    +      TArea   cover = 0;
    
    1889
    +
    
    1890
    +
    
    1891
    +      for ( ; cell != ras.cell_null; cell = cell->next )
    
    1892
    +      {
    
    1893
    +        TArea  area;
    
    1894
    +
    
    1895
    +
    
    1896
    +        if ( cover != 0 && cell->x > x )
    
    1897
    +        {
    
    1898
    +          FT_FILL_RULE( coverage, cover, fill );
    
    1899
    +
    
    1900
    +          span[n].coverage = (unsigned char)coverage;
    
    1901
    +          span[n].x        = (short)x;
    
    1902
    +          span[n].len      = (unsigned short)( cell->x - x );
    
    1903
    +
    
    1904
    +          if ( ++n == FT_MAX_GRAY_SPANS )
    
    1905
    +          {
    
    1906
    +            /* flush the span buffer and reset the count */
    
    1907
    +            ras.render_span( y, n, span, ras.render_span_data );
    
    1908
    +            n = 0;
    
    1909
    +          }
    
    1910
    +        }
    
    1911
    +
    
    1912
    +        cover += (TArea)cell->cover * ( ONE_PIXEL * 2 );
    
    1913
    +        area   = cover - cell->area;
    
    1914
    +
    
    1915
    +        if ( area != 0 && cell->x >= ras.min_ex )
    
    1916
    +        {
    
    1917
    +          FT_FILL_RULE( coverage, area, fill );
    
    1918
    +
    
    1919
    +          span[n].coverage = (unsigned char)coverage;
    
    1920
    +          span[n].x        = (short)cell->x;
    
    1921
    +          span[n].len      = 1;
    
    1922
    +
    
    1923
    +          if ( ++n == FT_MAX_GRAY_SPANS )
    
    1924
    +          {
    
    1925
    +            /* flush the span buffer and reset the count */
    
    1926
    +            ras.render_span( y, n, span, ras.render_span_data );
    
    1927
    +            n = 0;
    
    1928
    +          }
    
    1929
    +        }
    
    1930
    +
    
    1931
    +        x = cell->x + 1;
    
    1932
    +      }
    
    1933
    +
    
    1934
    +      if ( cover != 0 )  /* only if cropped */
    
    1935
    +      {
    
    1936
    +        FT_FILL_RULE( coverage, cover, fill );
    
    1937
    +
    
    1938
    +        span[n].coverage = (unsigned char)coverage;
    
    1939
    +        span[n].x        = (short)x;
    
    1940
    +        span[n].len      = (unsigned short)( ras.max_ex - x );
    
    1941
    +
    
    1942
    +        ++n;
    
    1943
    +      }
    
    1944
    +
    
    1945
    +      if ( n )
    
    1946
    +      {
    
    1947
    +        /* flush the span buffer and reset the count */
    
    1948
    +        ras.render_span( y, n, span, ras.render_span_data );
    
    1949
    +        n = 0;
    
    1950
    +      }
    
    1951
    +    }
    
    1952
    +  }
    
    1953
    +
    
    1954
    +
    
    1955 1955
       static int
    
    1956 1956
       gray_convert_glyph( RAS_ARG )
    
    1957 1957
       {
    


  • reply via email to

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