< prev index next >
src/java.desktop/share/classes/sun/java2d/pipe/Region.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -265,11 +265,11 @@
((RectangularShape)s).isEmpty())
{
return EMPTY_REGION;
}
- int box[] = new int[4];
+ int[] box = new int[4];
ShapeSpanIterator sr = new ShapeSpanIterator(normalize);
try {
sr.setOutputArea(devBounds);
sr.appendPath(s.getPathIterator(at));
sr.getPathBox(box);
@@ -344,11 +344,11 @@
* by the indicated span array.
* <p>
* This method can also be used to create a simple rectangular
* region.
*/
- public static Region getInstance(int box[]) {
+ public static Region getInstance(int[] box) {
return new Region(box[0], box[1], box[2], box[3]);
}
/**
* Returns a Region object with a rectangle of interest specified
@@ -368,11 +368,11 @@
* Appends the list of spans returned from the indicated SpanIterator. Each
* span must be at a higher starting Y coordinate than the previous data or
* it must have a Y range equal to the highest Y band in the region and a
* higher X coordinate than any of the spans in that band.
*/
- public static Region getInstance(int box[], SpanIterator si) {
+ public static Region getInstance(int[] box, SpanIterator si) {
Region ret = new Region(box[0], box[1], box[2], box[3]);
ret.appendSpans(si);
return ret;
}
@@ -409,14 +409,14 @@
int tlox = clipScale(lox, sx);
int tloy = clipScale(loy, sy);
int thix = clipScale(hix, sx);
int thiy = clipScale(hiy, sy);
Region ret = new Region(tlox, tloy, thix, thiy);
- int bands[] = this.bands;
+ int[] bands = this.bands;
if (bands != null) {
int end = endIndex;
- int newbands[] = new int[end];
+ int[] newbands = new int[end];
int i = 0; // index for source bands
int j = 0; // index for translated newbands
int ncol;
while (i < end) {
int y1, y2;
@@ -486,15 +486,15 @@
(thiy > hiy) != (dy > 0))
{
return getSafeTranslatedRegion(dx, dy);
}
Region ret = new Region(tlox, tloy, thix, thiy);
- int bands[] = this.bands;
+ int[] bands = this.bands;
if (bands != null) {
int end = endIndex;
ret.endIndex = end;
- int newbands[] = new int[end];
+ int[] newbands = new int[end];
ret.bands = newbands;
int i = 0;
int ncol;
while (i < end) {
newbands[i] = bands[i] + dy; i++;
@@ -513,14 +513,14 @@
int tlox = clipAdd(lox, dx);
int tloy = clipAdd(loy, dy);
int thix = clipAdd(hix, dx);
int thiy = clipAdd(hiy, dy);
Region ret = new Region(tlox, tloy, thix, thiy);
- int bands[] = this.bands;
+ int[] bands = this.bands;
if (bands != null) {
int end = endIndex;
- int newbands[] = new int[end];
+ int[] newbands = new int[end];
int i = 0; // index for source bands
int j = 0; // index for translated newbands
int ncol;
while (i < end) {
int y1, y2;
@@ -744,19 +744,19 @@
private static final int INCLUDE_A = 1;
private static final int INCLUDE_B = 2;
private static final int INCLUDE_COMMON = 4;
private void filterSpans(Region ra, Region rb, int flags) {
- int abands[] = ra.bands;
- int bbands[] = rb.bands;
+ int[] abands = ra.bands;
+ int[] bbands = rb.bands;
if (abands == null) {
abands = new int[] {ra.loy, ra.hiy, 1, ra.lox, ra.hix};
}
if (bbands == null) {
bbands = new int[] {rb.loy, rb.hiy, 1, rb.lox, rb.hix};
}
- int box[] = new int[6];
+ int[] box = new int[6];
int acolstart = 0;
int ay1 = abands[acolstart++];
int ay2 = abands[acolstart++];
int acolend = abands[acolstart++];
acolend = acolstart + 2 * acolend;
@@ -963,11 +963,11 @@
* This span must be at a higher starting Y coordinate than
* the previous data or it must have a Y range equal to the
* highest Y band in the region and a higher X coordinate
* than any of the spans in that band.
*/
- private void appendSpan(int box[]) {
+ private void appendSpan(int[] box) {
int spanlox, spanloy, spanhix, spanhiy;
if ((spanlox = box[0]) < lox) spanlox = lox;
if ((spanloy = box[1]) < loy) spanloy = loy;
if ((spanhix = box[2]) > hix) spanhix = hix;
if ((spanhiy = box[3]) > hiy) spanhiy = hiy;
@@ -1009,11 +1009,11 @@
System.arraycopy(bands, 0, newbands, 0, endIndex);
bands = newbands;
}
}
- private void endRow(int box[]) {
+ private void endRow(int[] box) {
int cur = box[4];
int prev = box[5];
if (cur > prev) {
int[] bands = this.bands;
if (bands[prev + 1] == bands[cur] &&
@@ -1271,21 +1271,21 @@
}
/**
* Gets the bbox of the available spans, clipped to the OutputArea.
*/
- public void getBounds(int pathbox[]) {
+ public void getBounds(int[] pathbox) {
pathbox[0] = lox;
pathbox[1] = loy;
pathbox[2] = hix;
pathbox[3] = hiy;
}
/**
* Clips the indicated bbox array to the bounds of this Region.
*/
- public void clipBoxToBounds(int bbox[]) {
+ public void clipBoxToBounds(int[] bbox) {
if (bbox[0] < lox) bbox[0] = lox;
if (bbox[1] < loy) bbox[1] = loy;
if (bbox[2] > hix) bbox[2] = hix;
if (bbox[3] > hiy) bbox[3] = hiy;
}
@@ -1306,11 +1306,11 @@
/**
* Gets a span iterator object that iterates over the spans in this region
* but clipped to the bounds given in the argument (xlo, ylo, xhi, yhi).
*/
- public SpanIterator getSpanIterator(int bbox[]) {
+ public SpanIterator getSpanIterator(int[] bbox) {
SpanIterator result = getSpanIterator();
result.intersectClipBox(bbox[0], bbox[1], bbox[2], bbox[3]);
return result;
}
@@ -1393,12 +1393,12 @@
return false;
}
if (this.endIndex != r.endIndex) {
return false;
}
- int abands[] = this.bands;
- int bbands[] = r.bands;
+ int[] abands = this.bands;
+ int[] bbands = r.bands;
for (int i = 0; i < endIndex; i++) {
if (abands[i] != bbands[i]) {
return false;
}
}
< prev index next >