jdk/src/java.desktop/share/classes/sun/java2d/marlin/MarlinConst.java
changeset 39519 21bfc4452441
parent 34816 5ff696b1bbac
child 40421 d5ee65e2b0fb
equal deleted inserted replaced
39518:cf5567d544b4 39519:21bfc4452441
     1 /*
     1 /*
     2  * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2015, 2016, 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
    28 /**
    28 /**
    29  * Marlin constant holder using System properties
    29  * Marlin constant holder using System properties
    30  */
    30  */
    31 interface MarlinConst {
    31 interface MarlinConst {
    32     // enable Logs (logger or stdout)
    32     // enable Logs (logger or stdout)
    33     static final boolean enableLogs = MarlinProperties.isLoggingEnabled();
    33     static final boolean ENABLE_LOGS = MarlinProperties.isLoggingEnabled();
    34     // use Logger instead of stdout
    34     // use Logger instead of stdout
    35     static final boolean useLogger = enableLogs && MarlinProperties.isUseLogger();
    35     static final boolean USE_LOGGER = ENABLE_LOGS && MarlinProperties.isUseLogger();
    36 
    36 
    37     // log new RendererContext
    37     // log new RendererContext
    38     static final boolean logCreateContext = enableLogs
    38     static final boolean LOG_CREATE_CONTEXT = ENABLE_LOGS
    39         && MarlinProperties.isLogCreateContext();
    39         && MarlinProperties.isLogCreateContext();
    40     // log misc.Unsafe alloc/realloc/free
    40     // log misc.Unsafe alloc/realloc/free
    41     static final boolean logUnsafeMalloc = enableLogs
    41     static final boolean LOG_UNSAFE_MALLOC = ENABLE_LOGS
    42         && MarlinProperties.isLogUnsafeMalloc();
    42         && MarlinProperties.isLogUnsafeMalloc();
    43     // do check unsafe alignment:
    43     // do check unsafe alignment:
    44     static final boolean doCheckUnsafe = false;
    44     static final boolean DO_CHECK_UNSAFE = false;
    45 
    45 
    46     // do statistics
    46     // do statistics
    47     static final boolean doStats = enableLogs && MarlinProperties.isDoStats();
    47     static final boolean DO_STATS = ENABLE_LOGS && MarlinProperties.isDoStats();
    48     // do monitors
    48     // do monitors
    49     // disabled to reduce byte-code size a bit...
    49     // disabled to reduce byte-code size a bit...
    50     static final boolean doMonitors = false;
    50     static final boolean DO_MONITORS = false;
    51 //    static final boolean doMonitors = enableLogs && MarlinProperties.isDoMonitors();
    51 //    static final boolean DO_MONITORS = ENABLE_LOGS && MarlinProperties.isDoMonitors();
    52     // do checks
    52     // do checks
    53     static final boolean doChecks = enableLogs && MarlinProperties.isDoChecks();
    53     static final boolean DO_CHECKS = ENABLE_LOGS && MarlinProperties.isDoChecks();
    54 
    54 
    55     // do AA range checks: disable when algorithm / code is stable
    55     // do AA range checks: disable when algorithm / code is stable
    56     static final boolean DO_AA_RANGE_CHECK = false;
    56     static final boolean DO_AA_RANGE_CHECK = false;
    57 
    57 
    58     // enable logs
    58     // enable logs
    59     static final boolean doLogWidenArray = enableLogs && false;
    59     static final boolean DO_LOG_WIDEN_ARRAY = ENABLE_LOGS && false;
    60     // enable oversize logs
    60     // enable oversize logs
    61     static final boolean doLogOverSize = enableLogs && false;
    61     static final boolean DO_LOG_OVERSIZE = ENABLE_LOGS && false;
    62     // enable traces
    62     // enable traces
    63     static final boolean doTrace = enableLogs && false;
    63     static final boolean DO_TRACE = ENABLE_LOGS && false;
       
    64 
    64     // do flush monitors
    65     // do flush monitors
    65     static final boolean doFlushMonitors = true;
    66     static final boolean DO_FLUSH_MONITORS = true;
    66     // use one polling thread to dump statistics/monitors
    67     // use one polling thread to dump statistics/monitors
    67     static final boolean useDumpThread = false;
    68     static final boolean USE_DUMP_THREAD = false;
    68     // thread dump interval (ms)
    69     // thread dump interval (ms)
    69     static final long statDump = 5000L;
    70     static final long DUMP_INTERVAL = 5000L;
    70 
    71 
    71     // do clean dirty array
    72     // do clean dirty array
    72     static final boolean doCleanDirty = false;
    73     static final boolean DO_CLEAN_DIRTY = false;
    73 
    74 
    74     // flag to use line simplifier
    75     // flag to use line simplifier
    75     static final boolean useSimplifier = MarlinProperties.isUseSimplifier();
    76     static final boolean USE_SIMPLIFIER = MarlinProperties.isUseSimplifier();
    76 
    77 
    77     // flag to enable logs related bounds checks
    78     // flag to enable logs related bounds checks
    78     static final boolean doLogBounds = enableLogs && false;
    79     static final boolean DO_LOG_BOUNDS = ENABLE_LOGS && false;
    79 
    80 
    80     // Initial Array sizing (initial context capacity) ~ 512K
    81     // Initial Array sizing (initial context capacity) ~ 350K
    81 
    82 
    82     // 2048 pixel (width x height) for initial capacity
    83     // 2048 pixel (width x height) for initial capacity
    83     static final int INITIAL_PIXEL_DIM
    84     static final int INITIAL_PIXEL_DIM
    84         = MarlinProperties.getInitialImageSize();
    85         = MarlinProperties.getInitialImageSize();
    85 
    86 
    86     // typical array sizes: only odd numbers allowed below
    87     // typical array sizes: only odd numbers allowed below
    87     static final int INITIAL_ARRAY        = 256;
    88     static final int INITIAL_ARRAY        = 256;
    88     static final int INITIAL_SMALL_ARRAY  = 1024;
    89     static final int INITIAL_SMALL_ARRAY  = 1024;
    89     static final int INITIAL_MEDIUM_ARRAY = 4096;
    90     static final int INITIAL_MEDIUM_ARRAY = 4096;
    90     static final int INITIAL_LARGE_ARRAY  = 8192;
    91     static final int INITIAL_LARGE_ARRAY  = 8192;
    91     static final int INITIAL_ARRAY_16K    = 16384;
       
    92     static final int INITIAL_ARRAY_32K    = 32768;
       
    93     // alpha row dimension
    92     // alpha row dimension
    94     static final int INITIAL_AA_ARRAY     = INITIAL_PIXEL_DIM;
    93     static final int INITIAL_AA_ARRAY     = INITIAL_PIXEL_DIM;
    95 
    94 
    96     // initial edges (24 bytes) = 24K [ints] = 96K
    95     // initial edges (24 bytes) = 24K [ints] = 96K
    97     static final int INITIAL_EDGES_CAPACITY = 4096 * 24; // 6 ints per edges
    96     static final int INITIAL_EDGES_CAPACITY = 4096 * 24; // 6 ints per edges