< prev index next >

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

Print this page




   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
  23  * questions.
  24  */
  25 
  26 package sun.java2d.marlin;
  27 
  28 /**
  29  * Marlin constant holder using System properties
  30  */
  31 interface MarlinConst {
  32     // enable Logs (logger or stdout)
  33     static final boolean ENABLE_LOGS = MarlinProperties.isLoggingEnabled();
  34     // use Logger instead of stdout
  35     static final boolean USE_LOGGER = ENABLE_LOGS && MarlinProperties.isUseLogger();
  36 
  37     // log new RendererContext
  38     static final boolean LOG_CREATE_CONTEXT = ENABLE_LOGS
  39         && MarlinProperties.isLogCreateContext();
  40     // log misc.Unsafe alloc/realloc/free
  41     static final boolean LOG_UNSAFE_MALLOC = ENABLE_LOGS
  42         && MarlinProperties.isLogUnsafeMalloc();
  43     // do check unsafe alignment:
  44     static final boolean DO_CHECK_UNSAFE = false;
  45 
  46     // do statistics
  47     static final boolean DO_STATS = ENABLE_LOGS && MarlinProperties.isDoStats();
  48     // do monitors
  49     // disabled to reduce byte-code size a bit...
  50     static final boolean DO_MONITORS = false;
  51 //    static final boolean DO_MONITORS = ENABLE_LOGS && MarlinProperties.isDoMonitors();


  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 = 3/4 * edges count (4096)
  99     // 6 ints per edges = 24 bytes
 100     // edges capacity = 24 x initial edges = 18 * edges count (4096) = 72K
 101     static final int INITIAL_EDGES_CAPACITY = INITIAL_EDGES_COUNT * 18;
 102 
 103     // zero value as byte
 104     static final byte BYTE_0 = (byte) 0;
 105 
 106     // subpixels expressed as log2
 107     public static final int SUBPIXEL_LG_POSITIONS_X
 108         = MarlinProperties.getSubPixel_Log2_X();
 109     public static final int SUBPIXEL_LG_POSITIONS_Y
 110         = MarlinProperties.getSubPixel_Log2_Y();
 111 
 112     // number of subpixels
 113     public static final int SUBPIXEL_POSITIONS_X = 1 << (SUBPIXEL_LG_POSITIONS_X);
 114     public static final int SUBPIXEL_POSITIONS_Y = 1 << (SUBPIXEL_LG_POSITIONS_Y);
 115 
 116     public static final float NORM_SUBPIXELS
 117         = (float)Math.sqrt(( SUBPIXEL_POSITIONS_X * SUBPIXEL_POSITIONS_X
 118                            + SUBPIXEL_POSITIONS_Y * SUBPIXEL_POSITIONS_Y)/2.0);
 119 
 120     public static final int MAX_AA_ALPHA
 121         = SUBPIXEL_POSITIONS_X * SUBPIXEL_POSITIONS_Y;
 122 
 123     public static final int TILE_SIZE_LG = MarlinProperties.getTileSize_Log2();
 124     public static final int TILE_SIZE = 1 << TILE_SIZE_LG; // 32 by default
 125 
 126     public static final int BLOCK_SIZE_LG = MarlinProperties.getBlockSize_Log2();
 127     public static final int BLOCK_SIZE    = 1 << BLOCK_SIZE_LG;









 128 }


   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
  23  * questions.
  24  */
  25 
  26 package com.sun.marlin;
  27 
  28 /**
  29  * Marlin constant holder using System properties
  30  */
  31 public interface MarlinConst {
  32     // enable Logs (logger or stdout)
  33     static final boolean ENABLE_LOGS = MarlinProperties.isLoggingEnabled();
  34     // use Logger instead of stdout
  35     static final boolean USE_LOGGER = ENABLE_LOGS && MarlinProperties.isUseLogger();
  36 
  37     // log new RendererContext
  38     static final boolean LOG_CREATE_CONTEXT = ENABLE_LOGS
  39         && MarlinProperties.isLogCreateContext();
  40     // log misc.Unsafe alloc/realloc/free
  41     static final boolean LOG_UNSAFE_MALLOC = ENABLE_LOGS
  42         && MarlinProperties.isLogUnsafeMalloc();
  43     // do check unsafe alignment:
  44     static final boolean DO_CHECK_UNSAFE = false;
  45 
  46     // do statistics
  47     static final boolean DO_STATS = ENABLE_LOGS && MarlinProperties.isDoStats();
  48     // do monitors
  49     // disabled to reduce byte-code size a bit...
  50     static final boolean DO_MONITORS = false;
  51 //    static final boolean DO_MONITORS = ENABLE_LOGS && MarlinProperties.isDoMonitors();


  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     // zero value as byte
 104     static final byte BYTE_0 = (byte) 0;
 105 
 106     // subpixels expressed as log2
 107     public static final int SUBPIXEL_LG_POSITIONS_X
 108         = MarlinProperties.getSubPixel_Log2_X();
 109     public static final int SUBPIXEL_LG_POSITIONS_Y
 110         = MarlinProperties.getSubPixel_Log2_Y();
 111 
 112     // number of subpixels
 113     public static final int SUBPIXEL_POSITIONS_X = 1 << (SUBPIXEL_LG_POSITIONS_X);
 114     public static final int SUBPIXEL_POSITIONS_Y = 1 << (SUBPIXEL_LG_POSITIONS_Y);
 115 
 116     public static final float NORM_SUBPIXELS
 117         = (float)Math.sqrt(( SUBPIXEL_POSITIONS_X * SUBPIXEL_POSITIONS_X
 118                            + SUBPIXEL_POSITIONS_Y * SUBPIXEL_POSITIONS_Y)/2.0);
 119 
 120     public static final int MAX_AA_ALPHA
 121         = SUBPIXEL_POSITIONS_X * SUBPIXEL_POSITIONS_Y;
 122 



 123     public static final int BLOCK_SIZE_LG = MarlinProperties.getBlockSize_Log2();
 124     public static final int BLOCK_SIZE    = 1 << BLOCK_SIZE_LG;
 125 
 126     static final boolean ENABLE_BLOCK_FLAGS = MarlinProperties.isUseTileFlags();
 127     static final boolean ENABLE_BLOCK_FLAGS_HEURISTICS = MarlinProperties.isUseTileFlagsWithHeuristics();
 128 
 129     static final boolean FORCE_RLE = MarlinProperties.isForceRLE();
 130     static final boolean FORCE_NO_RLE = MarlinProperties.isForceNoRLE();
 131     // minimum width to try using RLE encoding:
 132     static final int RLE_MIN_WIDTH
 133         = Math.max(BLOCK_SIZE, MarlinProperties.getRLEMinWidth());
 134 }
< prev index next >