12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package sun.java2d.pisces; 27 28 import java.util.Arrays; 29 30 /** 31 * An object used to cache pre-rendered complex paths. 32 * 33 * @see PiscesRenderer#render 34 */ 35 final class PiscesCache { 36 37 final int bboxX0, bboxY0, bboxX1, bboxY1; 38 39 // rowAARLE[i] holds the encoding of the pixel row with y = bboxY0+i. 40 // The format of each of the inner arrays is: rowAARLE[i][0,1] = (x0, n) 41 // where x0 is the first x in row i with nonzero alpha, and n is the 42 // number of RLE entries in this row. rowAARLE[i][j,j+1] for j>1 is 43 // (val,runlen) 44 final int[][] rowAARLE; 45 46 // RLE encodings are added in increasing y rows and then in increasing 47 // x inside those rows. Therefore, at any one time there is a well 48 // defined position (x,y) where a run length is about to be added (or 49 // the row terminated). x0,y0 is this (x,y)-(bboxX0,bboxY0). They 50 // are used to get indices into the current tile. 51 private int x0 = Integer.MIN_VALUE, y0 = Integer.MIN_VALUE; 52 53 // touchedTile[i][j] is the sum of all the alphas in the tile with | 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package sun.java2d.pisces; 27 28 import java.util.Arrays; 29 30 /** 31 * An object used to cache pre-rendered complex paths. 32 */ 33 final class PiscesCache { 34 35 final int bboxX0, bboxY0, bboxX1, bboxY1; 36 37 // rowAARLE[i] holds the encoding of the pixel row with y = bboxY0+i. 38 // The format of each of the inner arrays is: rowAARLE[i][0,1] = (x0, n) 39 // where x0 is the first x in row i with nonzero alpha, and n is the 40 // number of RLE entries in this row. rowAARLE[i][j,j+1] for j>1 is 41 // (val,runlen) 42 final int[][] rowAARLE; 43 44 // RLE encodings are added in increasing y rows and then in increasing 45 // x inside those rows. Therefore, at any one time there is a well 46 // defined position (x,y) where a run length is about to be added (or 47 // the row terminated). x0,y0 is this (x,y)-(bboxX0,bboxY0). They 48 // are used to get indices into the current tile. 49 private int x0 = Integer.MIN_VALUE, y0 = Integer.MIN_VALUE; 50 51 // touchedTile[i][j] is the sum of all the alphas in the tile with |