src/share/classes/sun/java2d/pisces/Renderer.java

Print this page




 758         this.crossingMaxY = maxY;
 759         this.crossingMaxXEntries = maxXEntries;
 760         resetCrossings();
 761     }
 762 
 763     private void resetCrossings() {
 764         int yextent = crossingMaxY - crossingMinY + 1;
 765         int start = 0;
 766         for (int i = 0; i < yextent; i++) {
 767             crossingIndices[i] = start;
 768             start += crossingMaxXEntries;
 769         }
 770         crossingMinX = Integer.MAX_VALUE;
 771         crossingMaxX = Integer.MIN_VALUE;
 772         numCrossings = 0;
 773         crossingsSorted = false;
 774     }
 775 
 776     // Free sorting arrays if larger than maximum size
 777     private void crossingListFinished() {
 778         if (crossings.length > DEFAULT_CROSSINGS_SIZE) {
 779             crossings = new int[DEFAULT_CROSSINGS_SIZE];
 780         }
 781         if (crossingIndices.length > DEFAULT_INDICES_SIZE) {


 782             crossingIndices = new int[DEFAULT_INDICES_SIZE];
 783         }
 784     }
 785 
 786     private void sortCrossings(int[] x, int off, int len) {
 787         for (int i = off + 1; i < off + len; i++) {
 788             int j = i;
 789             int xj = x[j];
 790             int xjm1;
 791 
 792             while (j > off && (xjm1 = x[j - 1]) > xj) {
 793                 x[j] = xjm1;
 794                 x[j - 1] = xj;
 795                 j--;
 796             }
 797         }
 798     }
 799 
 800     private void sortCrossings() {
 801         int start = 0;




 758         this.crossingMaxY = maxY;
 759         this.crossingMaxXEntries = maxXEntries;
 760         resetCrossings();
 761     }
 762 
 763     private void resetCrossings() {
 764         int yextent = crossingMaxY - crossingMinY + 1;
 765         int start = 0;
 766         for (int i = 0; i < yextent; i++) {
 767             crossingIndices[i] = start;
 768             start += crossingMaxXEntries;
 769         }
 770         crossingMinX = Integer.MAX_VALUE;
 771         crossingMaxX = Integer.MIN_VALUE;
 772         numCrossings = 0;
 773         crossingsSorted = false;
 774     }
 775 
 776     // Free sorting arrays if larger than maximum size
 777     private void crossingListFinished() {
 778         if (crossings == null || crossings.length > DEFAULT_CROSSINGS_SIZE) {
 779             crossings = new int[DEFAULT_CROSSINGS_SIZE];
 780         }
 781         if (crossingIndices == null
 782                 ||crossingIndices.length > DEFAULT_INDICES_SIZE)
 783         {
 784             crossingIndices = new int[DEFAULT_INDICES_SIZE];
 785         }
 786     }
 787 
 788     private void sortCrossings(int[] x, int off, int len) {
 789         for (int i = off + 1; i < off + len; i++) {
 790             int j = i;
 791             int xj = x[j];
 792             int xjm1;
 793 
 794             while (j > off && (xjm1 = x[j - 1]) > xj) {
 795                 x[j] = xjm1;
 796                 x[j - 1] = xj;
 797                 j--;
 798             }
 799         }
 800     }
 801 
 802     private void sortCrossings() {
 803         int start = 0;