< prev index next >

modules/javafx.graphics/src/main/java/com/sun/marlin/MarlinConst.java

Print this page


   1 /*
   2  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  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


  57 
  58     // enable logs
  59     static final boolean DO_LOG_WIDEN_ARRAY = ENABLE_LOGS && false;
  60     // enable oversize logs
  61     static final boolean DO_LOG_OVERSIZE = ENABLE_LOGS && false;
  62     // enable traces
  63     static final boolean DO_TRACE = ENABLE_LOGS && false;
  64 
  65     // do flush stats
  66     static final boolean DO_FLUSH_STATS = true;
  67     // do flush monitors
  68     static final boolean DO_FLUSH_MONITORS = true;
  69     // use one polling thread to dump statistics/monitors
  70     static final boolean USE_DUMP_THREAD = false;
  71     // thread dump interval (ms)
  72     static final long DUMP_INTERVAL = 5000L;
  73 
  74     // do clean dirty array
  75     static final boolean DO_CLEAN_DIRTY = false;
  76 
  77     // flag to use line simplifier
  78     static final boolean USE_SIMPLIFIER = MarlinProperties.isUseSimplifier();
  79 





  80     // flag to enable logs related bounds checks
  81     static final boolean DO_LOG_BOUNDS = ENABLE_LOGS && false;
  82 
  83     // Initial Array sizing (initial context capacity) ~ 450K
  84 
  85     // 2048 pixel (width x height) for initial capacity
  86     static final int INITIAL_PIXEL_DIM
  87         = MarlinProperties.getInitialImageSize();



  88 
  89     // typical array sizes: only odd numbers allowed below
  90     static final int INITIAL_ARRAY        = 256;
  91 
  92     // alpha row dimension
  93     static final int INITIAL_AA_ARRAY     = INITIAL_PIXEL_DIM;
  94 
  95     // 4096 edges for initial capacity
  96     static final int INITIAL_EDGES_COUNT = MarlinProperties.getInitialEdges();
  97 
  98     // initial edges = edges count (4096)
  99     // 6 ints per edges = 24 bytes
 100     // edges capacity = 24 x initial edges = 24 * edges count (4096) = 96K
 101     static final int INITIAL_EDGES_CAPACITY = INITIAL_EDGES_COUNT * 24;
 102 
 103     // crossing capacity = edges count / 4 ~ 1024
 104     static final int INITIAL_CROSSING_COUNT = INITIAL_EDGES_COUNT >> 2;
 105 
 106     // zero value as byte
 107     static final byte BYTE_0 = (byte) 0;
 108 
 109     // subpixels expressed as log2
 110     public static final int SUBPIXEL_LG_POSITIONS_X
 111         = MarlinProperties.getSubPixel_Log2_X();
 112     public static final int SUBPIXEL_LG_POSITIONS_Y
 113         = MarlinProperties.getSubPixel_Log2_Y();
 114 



 115     // number of subpixels
 116     public static final int SUBPIXEL_POSITIONS_X = 1 << (SUBPIXEL_LG_POSITIONS_X);
 117     public static final int SUBPIXEL_POSITIONS_Y = 1 << (SUBPIXEL_LG_POSITIONS_Y);
 118 
 119     // 2048 (pixelSize) pixels (height) x 8 subpixels = 64K
 120     static final int INITIAL_BUCKET_ARRAY
 121         = INITIAL_PIXEL_DIM * SUBPIXEL_POSITIONS_Y;
 122 
 123     public static final float NORM_SUBPIXELS
 124         = (float) Math.sqrt(( SUBPIXEL_POSITIONS_X * SUBPIXEL_POSITIONS_X
 125                             + SUBPIXEL_POSITIONS_Y * SUBPIXEL_POSITIONS_Y) / 2.0d);
 126 
 127     public static final int MAX_AA_ALPHA
 128         = SUBPIXEL_POSITIONS_X * SUBPIXEL_POSITIONS_Y;
 129 
 130     public static final int BLOCK_SIZE_LG = MarlinProperties.getBlockSize_Log2();
 131     public static final int BLOCK_SIZE    = 1 << BLOCK_SIZE_LG;
 132 
 133     static final boolean ENABLE_BLOCK_FLAGS = MarlinProperties.isUseTileFlags();
 134     static final boolean ENABLE_BLOCK_FLAGS_HEURISTICS = MarlinProperties.isUseTileFlagsWithHeuristics();
 135 
 136     static final boolean FORCE_RLE = MarlinProperties.isForceRLE();
 137     static final boolean FORCE_NO_RLE = MarlinProperties.isForceNoRLE();
 138     // minimum width to try using RLE encoding:
 139     static final int RLE_MIN_WIDTH
 140         = Math.max(BLOCK_SIZE, MarlinProperties.getRLEMinWidth());
 141 
 142     // Constants
 143     public static final int WIND_EVEN_ODD = 0;
 144     public static final int WIND_NON_ZERO = 1;
 145 
 146     /**
 147      * Constant value for join style.
 148      */


   1 /*
   2  * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  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


  57 
  58     // enable logs
  59     static final boolean DO_LOG_WIDEN_ARRAY = ENABLE_LOGS && false;
  60     // enable oversize logs
  61     static final boolean DO_LOG_OVERSIZE = ENABLE_LOGS && false;
  62     // enable traces
  63     static final boolean DO_TRACE = ENABLE_LOGS && false;
  64 
  65     // do flush stats
  66     static final boolean DO_FLUSH_STATS = true;
  67     // do flush monitors
  68     static final boolean DO_FLUSH_MONITORS = true;
  69     // use one polling thread to dump statistics/monitors
  70     static final boolean USE_DUMP_THREAD = false;
  71     // thread dump interval (ms)
  72     static final long DUMP_INTERVAL = 5000L;
  73 
  74     // do clean dirty array
  75     static final boolean DO_CLEAN_DIRTY = false;
  76 
  77     // flag to use collinear simplifier
  78     static final boolean USE_SIMPLIFIER = MarlinProperties.isUseSimplifier();
  79 
  80     // flag to use path simplifier
  81     static final boolean USE_PATH_SIMPLIFIER = MarlinProperties.isUsePathSimplifier();
  82 
  83     static final boolean DO_CLIP_SUBDIVIDER = MarlinProperties.isDoClipSubdivider();
  84 
  85     // flag to enable logs related bounds checks
  86     static final boolean DO_LOG_BOUNDS = ENABLE_LOGS && false;
  87 
  88     // Initial Array sizing (initial context capacity) ~ 450K
  89 
  90     // 4096 pixels (width) for initial capacity
  91     static final int INITIAL_PIXEL_WIDTH
  92         = MarlinProperties.getInitialPixelWidth();
  93     // 2176 pixels (height) for initial capacity
  94     static final int INITIAL_PIXEL_HEIGHT
  95         = MarlinProperties.getInitialPixelHeight();
  96 
  97     // typical array sizes: only odd numbers allowed below
  98     static final int INITIAL_ARRAY        = 256;
  99 
 100     // alpha row dimension
 101     static final int INITIAL_AA_ARRAY     = INITIAL_PIXEL_WIDTH;
 102 
 103     // 4096 edges for initial capacity
 104     static final int INITIAL_EDGES_COUNT = MarlinProperties.getInitialEdges();
 105 
 106     // initial edges = edges count (4096)
 107     // 6 ints per edges = 24 bytes
 108     // edges capacity = 24 x initial edges = 24 * edges count (4096) = 96K
 109     static final int INITIAL_EDGES_CAPACITY = INITIAL_EDGES_COUNT * 24;
 110 
 111     // crossing capacity = edges count / 4 ~ 1024
 112     static final int INITIAL_CROSSING_COUNT = INITIAL_EDGES_COUNT >> 2;
 113 
 114     // zero value as byte
 115     static final byte BYTE_0 = (byte) 0;
 116 
 117     // subpixels expressed as log2
 118     public static final int SUBPIXEL_LG_POSITIONS_X
 119         = MarlinProperties.getSubPixel_Log2_X();
 120     public static final int SUBPIXEL_LG_POSITIONS_Y
 121         = MarlinProperties.getSubPixel_Log2_Y();
 122 
 123     public static final int MIN_SUBPIXEL_LG_POSITIONS
 124         = Math.min(SUBPIXEL_LG_POSITIONS_X, SUBPIXEL_LG_POSITIONS_Y);
 125 
 126     // number of subpixels
 127     public static final int SUBPIXEL_POSITIONS_X = 1 << (SUBPIXEL_LG_POSITIONS_X);
 128     public static final int SUBPIXEL_POSITIONS_Y = 1 << (SUBPIXEL_LG_POSITIONS_Y);
 129 
 130     public static final float MIN_SUBPIXELS = 1 << MIN_SUBPIXEL_LG_POSITIONS;


 131 
 132     // 2176 pixels (height) x 8 subpixels = 68K
 133     static final int INITIAL_BUCKET_ARRAY
 134         = INITIAL_PIXEL_HEIGHT * SUBPIXEL_POSITIONS_Y;
 135 
 136     public static final int MAX_AA_ALPHA
 137         = (SUBPIXEL_POSITIONS_X * SUBPIXEL_POSITIONS_Y);
 138 
 139     public static final int BLOCK_SIZE_LG = MarlinProperties.getBlockSize_Log2();
 140     public static final int BLOCK_SIZE    = 1 << BLOCK_SIZE_LG;
 141 
 142     static final boolean ENABLE_BLOCK_FLAGS = MarlinProperties.isUseTileFlags();
 143     static final boolean ENABLE_BLOCK_FLAGS_HEURISTICS = MarlinProperties.isUseTileFlagsWithHeuristics();
 144 
 145     static final boolean FORCE_RLE = MarlinProperties.isForceRLE();
 146     static final boolean FORCE_NO_RLE = MarlinProperties.isForceNoRLE();
 147     // minimum width to try using RLE encoding:
 148     static final int RLE_MIN_WIDTH
 149         = Math.max(BLOCK_SIZE, MarlinProperties.getRLEMinWidth());
 150 
 151     // Constants
 152     public static final int WIND_EVEN_ODD = 0;
 153     public static final int WIND_NON_ZERO = 1;
 154 
 155     /**
 156      * Constant value for join style.
 157      */


< prev index next >