< prev index next >

src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java

Print this page




1888             return false;
1889         }
1890         // REMIND: We could go one step further here and examine the
1891         // non-rectangular clip shape more closely if there is one.
1892         // Since the clip has already been rasterized, the performance
1893         // penalty of doing the scan is probably still within the bounds
1894         // of a good tradeoff between speed and quality of the answer.
1895         return true;
1896     }
1897 
1898     protected void validateCompClip() {
1899         int origClipState = clipState;
1900         if (usrClip == null) {
1901             clipState = CLIP_DEVICE;
1902             clipRegion = devClip;
1903         } else if (usrClip instanceof Rectangle2D) {
1904             clipState = CLIP_RECTANGULAR;
1905             if (usrClip instanceof Rectangle) {
1906                 clipRegion = devClip.getIntersection((Rectangle)usrClip);
1907             } else {
1908                 clipRegion = devClip.getIntersection(usrClip.getBounds());
1909             }
1910         } else {
1911             PathIterator cpi = usrClip.getPathIterator(null);
1912             int box[] = new int[4];
1913             ShapeSpanIterator sr = LoopPipe.getFillSSI(this);
1914             try {
1915                 sr.setOutputArea(devClip);
1916                 sr.appendPath(cpi);
1917                 sr.getPathBox(box);
1918                 Region r = Region.getInstance(box, sr);
1919                 clipRegion = r;
1920                 clipState =
1921                     r.isRectangular() ? CLIP_RECTANGULAR : CLIP_SHAPE;
1922             } finally {
1923                 sr.dispose();
1924             }
1925         }
1926         if (origClipState != clipState &&
1927             (clipState == CLIP_SHAPE || origClipState == CLIP_SHAPE))
1928         {




1888             return false;
1889         }
1890         // REMIND: We could go one step further here and examine the
1891         // non-rectangular clip shape more closely if there is one.
1892         // Since the clip has already been rasterized, the performance
1893         // penalty of doing the scan is probably still within the bounds
1894         // of a good tradeoff between speed and quality of the answer.
1895         return true;
1896     }
1897 
1898     protected void validateCompClip() {
1899         int origClipState = clipState;
1900         if (usrClip == null) {
1901             clipState = CLIP_DEVICE;
1902             clipRegion = devClip;
1903         } else if (usrClip instanceof Rectangle2D) {
1904             clipState = CLIP_RECTANGULAR;
1905             if (usrClip instanceof Rectangle) {
1906                 clipRegion = devClip.getIntersection((Rectangle)usrClip);
1907             } else {
1908                 clipRegion = devClip.getIntersection((Rectangle2D) usrClip);
1909             }
1910         } else {
1911             PathIterator cpi = usrClip.getPathIterator(null);
1912             int box[] = new int[4];
1913             ShapeSpanIterator sr = LoopPipe.getFillSSI(this);
1914             try {
1915                 sr.setOutputArea(devClip);
1916                 sr.appendPath(cpi);
1917                 sr.getPathBox(box);
1918                 Region r = Region.getInstance(box, sr);
1919                 clipRegion = r;
1920                 clipState =
1921                     r.isRectangular() ? CLIP_RECTANGULAR : CLIP_SHAPE;
1922             } finally {
1923                 sr.dispose();
1924             }
1925         }
1926         if (origClipState != clipState &&
1927             (clipState == CLIP_SHAPE || origClipState == CLIP_SHAPE))
1928         {


< prev index next >