jdk/src/share/native/sun/java2d/Trace.h
author tdv
Tue, 22 Jul 2008 11:24:32 -0700
changeset 888 c7009cf0001f
parent 887 0aab8d3fa11a
child 5506 202f599c92aa
permissions -rw-r--r--
6728492: typo in copyrights in some files touched by the d3d pipeline port Reviewed-by: prr
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
888
c7009cf0001f 6728492: typo in copyrights in some files touched by the d3d pipeline port
tdv
parents: 887
diff changeset
     2
 * Copyright 2003-2008 Sun Microsystems, Inc.  All Rights Reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
#ifndef _Included_Trace
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
#define _Included_Trace
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
#include <jni.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
#include "debug_trace.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
#ifdef __cplusplus
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
extern "C" {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
#endif /* __cplusplus */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * J2dTrace
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * Trace utility used throughout Java 2D code.  Uses a "level"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * parameter that allows user to specify how much detail
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * they want traced at runtime.  Tracing is only enabled
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * in debug mode, to avoid overhead running release build.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
#define J2D_TRACE_INVALID       -1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
#define J2D_TRACE_OFF           0
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
#define J2D_TRACE_ERROR         1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
#define J2D_TRACE_WARNING       2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
#define J2D_TRACE_INFO          3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
#define J2D_TRACE_VERBOSE       4
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
#define J2D_TRACE_VERBOSE2      5
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
#define J2D_TRACE_MAX           (J2D_TRACE_VERBOSE2+1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
JNIEXPORT void JNICALL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
J2dTraceImpl(int level, jboolean cr, const char *string, ...);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
JNIEXPORT void JNICALL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
J2dTraceInit();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
#ifndef DEBUG
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
#define J2dTrace(level, string)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
#define J2dTrace1(level, string, arg1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
#define J2dTrace2(level, string, arg1, arg2)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
#define J2dTrace3(level, string, arg1, arg2, arg3)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
#define J2dTrace4(level, string, arg1, arg2, arg3, arg4)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
#define J2dTrace5(level, string, arg1, arg2, arg3, arg4, arg5)
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    65
#define J2dTrace6(level, string, arg1, arg2, arg3, arg4, arg5, arg6)
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    66
#define J2dTrace7(level, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    67
#define J2dTrace8(level, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
#define J2dTraceLn(level, string)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
#define J2dTraceLn1(level, string, arg1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
#define J2dTraceLn2(level, string, arg1, arg2)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
#define J2dTraceLn3(level, string, arg1, arg2, arg3)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
#define J2dTraceLn4(level, string, arg1, arg2, arg3, arg4)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
#define J2dTraceLn5(level, string, arg1, arg2, arg3, arg4, arg5)
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    74
#define J2dTraceLn6(level, string, arg1, arg2, arg3, arg4, arg5, arg6)
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    75
#define J2dTraceLn7(level, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    76
#define J2dTraceLn8(level, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
#else /* DEBUG */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
#define J2dTrace(level, string) { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
            J2dTraceImpl(level, JNI_FALSE, string); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
#define J2dTrace1(level, string, arg1) { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
            J2dTraceImpl(level, JNI_FALSE, string, arg1); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
#define J2dTrace2(level, string, arg1, arg2) { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
            J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
#define J2dTrace3(level, string, arg1, arg2, arg3) { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
            J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2, arg3); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
#define J2dTrace4(level, string, arg1, arg2, arg3, arg4) { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
            J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2, arg3, arg4); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
#define J2dTrace5(level, string, arg1, arg2, arg3, arg4, arg5) { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
            J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2, arg3, arg4, arg5); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
        }
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    96
#define J2dTrace6(level, string, arg1, arg2, arg3, arg4, arg5, arg6) { \
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    97
            J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2, arg3, arg4, arg5, arg6); \
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    98
        }
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    99
#define J2dTrace7(level, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7) { \
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   100
            J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7); \
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   101
        }
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   102
#define J2dTrace8(level, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) { \
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   103
            J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   104
        }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
#define J2dTraceLn(level, string) { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
            J2dTraceImpl(level, JNI_TRUE, string); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
#define J2dTraceLn1(level, string, arg1) { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
            J2dTraceImpl(level, JNI_TRUE, string, arg1); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
#define J2dTraceLn2(level, string, arg1, arg2) { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
            J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
#define J2dTraceLn3(level, string, arg1, arg2, arg3) { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
            J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2, arg3); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
#define J2dTraceLn4(level, string, arg1, arg2, arg3, arg4) { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
            J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2, arg3, arg4); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
#define J2dTraceLn5(level, string, arg1, arg2, arg3, arg4, arg5) { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
            J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2, arg3, arg4, arg5); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
        }
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   123
#define J2dTraceLn6(level, string, arg1, arg2, arg3, arg4, arg5, arg6) { \
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   124
            J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2, arg3, arg4, arg5, arg6); \
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   125
        }
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   126
#define J2dTraceLn7(level, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7) { \
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   127
            J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7); \
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   128
        }
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   129
#define J2dTraceLn8(level, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) { \
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   130
            J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   131
        }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
#endif /* DEBUG */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
 * NOTE: Use the following RlsTrace calls very carefully; they are compiled
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
 * into the code and should thus not be put in any performance-sensitive
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
 * areas.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
#define J2dRlsTrace(level, string) { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
            J2dTraceImpl(level, JNI_FALSE, string); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
#define J2dRlsTrace1(level, string, arg1) { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
            J2dTraceImpl(level, JNI_FALSE, string, arg1); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
#define J2dRlsTrace2(level, string, arg1, arg2) { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
            J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
#define J2dRlsTrace3(level, string, arg1, arg2, arg3) { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
            J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2, arg3); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
#define J2dRlsTrace4(level, string, arg1, arg2, arg3, arg4) { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
            J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2, arg3, arg4); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
#define J2dRlsTrace5(level, string, arg1, arg2, arg3, arg4, arg5) { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
            J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2, arg3, arg4, arg5); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
#define J2dRlsTraceLn(level, string) { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
            J2dTraceImpl(level, JNI_TRUE, string); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
#define J2dRlsTraceLn1(level, string, arg1) { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
            J2dTraceImpl(level, JNI_TRUE, string, arg1); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
#define J2dRlsTraceLn2(level, string, arg1, arg2) { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
            J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
#define J2dRlsTraceLn3(level, string, arg1, arg2, arg3) { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
            J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2, arg3); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
#define J2dRlsTraceLn4(level, string, arg1, arg2, arg3, arg4) { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
            J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2, arg3, arg4); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
#define J2dRlsTraceLn5(level, string, arg1, arg2, arg3, arg4, arg5) { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
            J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2, arg3, arg4, arg5); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
#ifdef __cplusplus
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
#endif /* __cplusplus */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
#endif /* _Included_Trace */