src/java.desktop/unix/classes/sun/java2d/jules/JulesAATileGenerator.java

Print this page




  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.jules;
  27 
  28 import java.awt.*;
  29 import java.awt.geom.*;
  30 import java.util.concurrent.*;
  31 import sun.java2d.pipe.*;
  32 import sun.java2d.xr.*;
  33 
  34 public class JulesAATileGenerator implements AATileGenerator {
  35     /* Threading stuff */
  36     final static ExecutorService rasterThreadPool =
  37                                           Executors.newCachedThreadPool();
  38     final static int CPU_CNT = Runtime.getRuntime().availableProcessors();
  39 
  40     final static boolean ENABLE_THREADING = false;
  41     final static int THREAD_MIN = 16;
  42     final static int THREAD_BEGIN = 16;
  43 
  44     IdleTileCache tileCache;
  45     TileWorker worker;
  46     boolean threaded = false;
  47     int rasterTileCnt;
  48 
  49     /* Tiling */
  50     final static int TILE_SIZE = 32;
  51     final static int TILE_SIZE_FP = 32 << 16;
  52     int left, right, top, bottom, width, height;
  53     int leftFP, topFP;
  54     int tileCnt, tilesX, tilesY;
  55     int currTilePos = 0;
  56     TrapezoidList traps;
  57     TileTrapContainer[] tiledTrapArray;
  58     JulesTile mainTile;
  59 
  60     public JulesAATileGenerator(Shape s, AffineTransform at, Region clip,
  61                                 BasicStroke bs, boolean thin,
  62                                 boolean normalize, int[] bbox) {
  63         JulesPathBuf buf = new JulesPathBuf();
  64 
  65         if (bs == null) {
  66             traps = buf.tesselateFill(s, at, clip);
  67         } else {
  68             traps = buf.tesselateStroke(s, bs, thin, false, true, at, clip);
  69         }
  70 
  71         calculateArea(bbox);




  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.jules;
  27 
  28 import java.awt.*;
  29 import java.awt.geom.*;
  30 import java.util.concurrent.*;
  31 import sun.java2d.pipe.*;
  32 import sun.java2d.xr.*;
  33 
  34 public class JulesAATileGenerator implements AATileGenerator {
  35     /* Threading stuff */
  36     static final ExecutorService rasterThreadPool =
  37                                           Executors.newCachedThreadPool();
  38     static final int CPU_CNT = Runtime.getRuntime().availableProcessors();
  39 
  40     static final boolean ENABLE_THREADING = false;
  41     static final int THREAD_MIN = 16;
  42     static final int THREAD_BEGIN = 16;
  43 
  44     IdleTileCache tileCache;
  45     TileWorker worker;
  46     boolean threaded = false;
  47     int rasterTileCnt;
  48 
  49     /* Tiling */
  50     static final int TILE_SIZE = 32;
  51     static final int TILE_SIZE_FP = 32 << 16;
  52     int left, right, top, bottom, width, height;
  53     int leftFP, topFP;
  54     int tileCnt, tilesX, tilesY;
  55     int currTilePos = 0;
  56     TrapezoidList traps;
  57     TileTrapContainer[] tiledTrapArray;
  58     JulesTile mainTile;
  59 
  60     public JulesAATileGenerator(Shape s, AffineTransform at, Region clip,
  61                                 BasicStroke bs, boolean thin,
  62                                 boolean normalize, int[] bbox) {
  63         JulesPathBuf buf = new JulesPathBuf();
  64 
  65         if (bs == null) {
  66             traps = buf.tesselateFill(s, at, clip);
  67         } else {
  68             traps = buf.tesselateStroke(s, bs, thin, false, true, at, clip);
  69         }
  70 
  71         calculateArea(bbox);