< prev index next >

src/java.desktop/share/native/libawt/java2d/loops/ProcessPath.c

Print this page




 767     coords1[3] = coords[1] + t*(coords[3] - coords[1]);
 768     coords[2] = coords[2] + t*(coords[4] - coords[2]);
 769     coords[3] = coords[3] + t*(coords[5] - coords[3]);
 770     coords[0] = coords1[4] = coords1[2] + t*(coords[2] - coords1[2]);
 771     coords[1] = coords1[5] = coords1[3] + t*(coords[3] - coords1[3]);
 772 
 773     ProcessMonotonicQuad(hnd, coords1, pixelInfo);
 774 }
 775 
 776 /*
 777  * Split quadratic curve into monotonic in X and Y parts. Calling
 778  * ProcessMonotonicQuad for each monotonic piece of the curve.
 779  * Note: coords array could be changed
 780  */
 781 static void ProcessQuad(ProcessHandler* hnd, jfloat* coords, jint* pixelInfo) {
 782 
 783     /* Temporary array for holding parameters corresponding to the extreme in X
 784      * and Y points. The values are inside the (0,1) range (0 and 1 excluded)
 785      * and in ascending order.
 786      */
 787     double params[2];
 788 
 789     jint cnt = 0;
 790     double param;
 791 
 792     /* Simple check for monotonicity in X before searching for the extreme
 793      * points of the X(t) function. We first check if the curve is monotonic
 794      * in X by seeing if all of the X coordinates are strongly ordered.
 795      */
 796     if ((coords[0] > coords[2] || coords[2] > coords[4]) &&
 797         (coords[0] < coords[2] || coords[2] < coords[4]))
 798     {
 799         /* Searching for extreme points of the X(t) function  by solving
 800          * dX(t)
 801          * ----  = 0 equation
 802          *  dt
 803          */
 804         double ax = coords[0] - 2*coords[2] + coords[4];
 805         if (ax != 0) {
 806             /* Calculating root of the following equation
 807              * ax*t + bx = 0
 808              */
 809             double bx = coords[0] - coords[2];
 810 




 767     coords1[3] = coords[1] + t*(coords[3] - coords[1]);
 768     coords[2] = coords[2] + t*(coords[4] - coords[2]);
 769     coords[3] = coords[3] + t*(coords[5] - coords[3]);
 770     coords[0] = coords1[4] = coords1[2] + t*(coords[2] - coords1[2]);
 771     coords[1] = coords1[5] = coords1[3] + t*(coords[3] - coords1[3]);
 772 
 773     ProcessMonotonicQuad(hnd, coords1, pixelInfo);
 774 }
 775 
 776 /*
 777  * Split quadratic curve into monotonic in X and Y parts. Calling
 778  * ProcessMonotonicQuad for each monotonic piece of the curve.
 779  * Note: coords array could be changed
 780  */
 781 static void ProcessQuad(ProcessHandler* hnd, jfloat* coords, jint* pixelInfo) {
 782 
 783     /* Temporary array for holding parameters corresponding to the extreme in X
 784      * and Y points. The values are inside the (0,1) range (0 and 1 excluded)
 785      * and in ascending order.
 786      */
 787     double params[2] = {0.0, 0.0};
 788 
 789     jint cnt = 0;
 790     double param = 0.0;
 791 
 792     /* Simple check for monotonicity in X before searching for the extreme
 793      * points of the X(t) function. We first check if the curve is monotonic
 794      * in X by seeing if all of the X coordinates are strongly ordered.
 795      */
 796     if ((coords[0] > coords[2] || coords[2] > coords[4]) &&
 797         (coords[0] < coords[2] || coords[2] < coords[4]))
 798     {
 799         /* Searching for extreme points of the X(t) function  by solving
 800          * dX(t)
 801          * ----  = 0 equation
 802          *  dt
 803          */
 804         double ax = coords[0] - 2*coords[2] + coords[4];
 805         if (ax != 0) {
 806             /* Calculating root of the following equation
 807              * ax*t + bx = 0
 808              */
 809             double bx = coords[0] - coords[2];
 810 


< prev index next >