jdk/src/java.desktop/share/classes/sun/java2d/marlin/MarlinConst.java
changeset 47126 188ef162f019
parent 40421 d5ee65e2b0fb
equal deleted inserted replaced
45093:c42dc7b58b4d 47126:188ef162f019
     1 /*
     1 /*
     2  * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
     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.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    93     static final int INITIAL_AA_ARRAY     = INITIAL_PIXEL_DIM;
    93     static final int INITIAL_AA_ARRAY     = INITIAL_PIXEL_DIM;
    94 
    94 
    95     // 4096 edges for initial capacity
    95     // 4096 edges for initial capacity
    96     static final int INITIAL_EDGES_COUNT = MarlinProperties.getInitialEdges();
    96     static final int INITIAL_EDGES_COUNT = MarlinProperties.getInitialEdges();
    97 
    97 
    98     // initial edges = 3/4 * edges count (4096)
    98     // initial edges = edges count (4096)
    99     // 6 ints per edges = 24 bytes
    99     // 6 ints per edges = 24 bytes
   100     // edges capacity = 24 x initial edges = 18 * edges count (4096) = 72K
   100     // edges capacity = 24 x initial edges = 24 * edges count (4096) = 96K
   101     static final int INITIAL_EDGES_CAPACITY = INITIAL_EDGES_COUNT * 18;
   101     static final int INITIAL_EDGES_CAPACITY = INITIAL_EDGES_COUNT * 24;
   102 
   102 
   103     // zero value as byte
   103     // zero value as byte
   104     static final byte BYTE_0 = (byte) 0;
   104     static final byte BYTE_0 = (byte) 0;
   105 
   105 
   106     // subpixels expressed as log2
   106     // subpixels expressed as log2
   112     // number of subpixels
   112     // number of subpixels
   113     public static final int SUBPIXEL_POSITIONS_X = 1 << (SUBPIXEL_LG_POSITIONS_X);
   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);
   114     public static final int SUBPIXEL_POSITIONS_Y = 1 << (SUBPIXEL_LG_POSITIONS_Y);
   115 
   115 
   116     public static final float NORM_SUBPIXELS
   116     public static final float NORM_SUBPIXELS
   117         = (float)Math.sqrt(( SUBPIXEL_POSITIONS_X * SUBPIXEL_POSITIONS_X
   117         = (float) Math.sqrt(( SUBPIXEL_POSITIONS_X * SUBPIXEL_POSITIONS_X
   118                            + SUBPIXEL_POSITIONS_Y * SUBPIXEL_POSITIONS_Y)/2.0);
   118                             + SUBPIXEL_POSITIONS_Y * SUBPIXEL_POSITIONS_Y) / 2.0d);
   119 
   119 
   120     public static final int MAX_AA_ALPHA
   120     public static final int MAX_AA_ALPHA
   121         = SUBPIXEL_POSITIONS_X * SUBPIXEL_POSITIONS_Y;
   121         = SUBPIXEL_POSITIONS_X * SUBPIXEL_POSITIONS_Y;
   122 
   122 
   123     public static final int TILE_SIZE_LG = MarlinProperties.getTileSize_Log2();
   123     public static final int TILE_H_LG = MarlinProperties.getTileSize_Log2();
   124     public static final int TILE_SIZE = 1 << TILE_SIZE_LG; // 32 by default
   124     public static final int TILE_H = 1 << TILE_H_LG; // 32 by default
       
   125 
       
   126     public static final int TILE_W_LG = MarlinProperties.getTileWidth_Log2();
       
   127     public static final int TILE_W = 1 << TILE_W_LG; // 32 by default
   125 
   128 
   126     public static final int BLOCK_SIZE_LG = MarlinProperties.getBlockSize_Log2();
   129     public static final int BLOCK_SIZE_LG = MarlinProperties.getBlockSize_Log2();
   127     public static final int BLOCK_SIZE    = 1 << BLOCK_SIZE_LG;
   130     public static final int BLOCK_SIZE    = 1 << BLOCK_SIZE_LG;
   128 }
   131 }