Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/sun/java2d/marlin/MarlinConst.java
38918 views
/*1* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package sun.java2d.marlin;2627/**28* Marlin constant holder using System properties29*/30interface MarlinConst {31// enable Logs (logger or stdout)32static final boolean enableLogs = MarlinProperties.isLoggingEnabled();33// use Logger instead of stdout34static final boolean useLogger = enableLogs && MarlinProperties.isUseLogger();3536// log new RendererContext37static final boolean logCreateContext = enableLogs38&& MarlinProperties.isLogCreateContext();39// log misc.Unsafe alloc/realloc/free40static final boolean logUnsafeMalloc = enableLogs41&& MarlinProperties.isLogUnsafeMalloc();42// do check unsafe alignment:43static final boolean doCheckUnsafe = false;4445// do statistics46static final boolean doStats = enableLogs && MarlinProperties.isDoStats();47// do monitors48// disabled to reduce byte-code size a bit...49static final boolean doMonitors = false;50// static final boolean doMonitors = enableLogs && MarlinProperties.isDoMonitors();51// do checks52static final boolean doChecks = enableLogs && MarlinProperties.isDoChecks();5354// do AA range checks: disable when algorithm / code is stable55static final boolean DO_AA_RANGE_CHECK = false;5657// enable logs58static final boolean doLogWidenArray = enableLogs && false;59// enable oversize logs60static final boolean doLogOverSize = enableLogs && false;61// enable traces62static final boolean doTrace = enableLogs && false;63// do flush monitors64static final boolean doFlushMonitors = true;65// use one polling thread to dump statistics/monitors66static final boolean useDumpThread = false;67// thread dump interval (ms)68static final long statDump = 5000L;6970// do clean dirty array71static final boolean doCleanDirty = false;7273// flag to use line simplifier74static final boolean useSimplifier = MarlinProperties.isUseSimplifier();7576// flag to enable logs related bounds checks77static final boolean doLogBounds = enableLogs && false;7879// Initial Array sizing (initial context capacity) ~ 512K8081// 2048 pixel (width x height) for initial capacity82static final int INITIAL_PIXEL_DIM83= MarlinProperties.getInitialImageSize();8485// typical array sizes: only odd numbers allowed below86static final int INITIAL_ARRAY = 256;87static final int INITIAL_SMALL_ARRAY = 1024;88static final int INITIAL_MEDIUM_ARRAY = 4096;89static final int INITIAL_LARGE_ARRAY = 8192;90static final int INITIAL_ARRAY_16K = 16384;91static final int INITIAL_ARRAY_32K = 32768;92// alpha row dimension93static final int INITIAL_AA_ARRAY = INITIAL_PIXEL_DIM;9495// initial edges (24 bytes) = 24K [ints] = 96K96static final int INITIAL_EDGES_CAPACITY = 4096 * 24; // 6 ints per edges9798// zero value as byte99static final byte BYTE_0 = (byte) 0;100101// subpixels expressed as log2102public static final int SUBPIXEL_LG_POSITIONS_X103= MarlinProperties.getSubPixel_Log2_X();104public static final int SUBPIXEL_LG_POSITIONS_Y105= MarlinProperties.getSubPixel_Log2_Y();106107// number of subpixels108public static final int SUBPIXEL_POSITIONS_X = 1 << (SUBPIXEL_LG_POSITIONS_X);109public static final int SUBPIXEL_POSITIONS_Y = 1 << (SUBPIXEL_LG_POSITIONS_Y);110111public static final float NORM_SUBPIXELS112= (float)Math.sqrt(( SUBPIXEL_POSITIONS_X * SUBPIXEL_POSITIONS_X113+ SUBPIXEL_POSITIONS_Y * SUBPIXEL_POSITIONS_Y)/2.0);114115public static final int MAX_AA_ALPHA116= SUBPIXEL_POSITIONS_X * SUBPIXEL_POSITIONS_Y;117118public static final int TILE_SIZE_LG = MarlinProperties.getTileSize_Log2();119public static final int TILE_SIZE = 1 << TILE_SIZE_LG; // 32 by default120121public static final int BLOCK_SIZE_LG = MarlinProperties.getBlockSize_Log2();122public static final int BLOCK_SIZE = 1 << BLOCK_SIZE_LG;123}124125126