Print this page
Added gradle and cmake project
Split |
Close |
Expand all |
Collapse all |
--- old/src/java.desktop/share/native/libawt/java2d/Trace.h
+++ new/src/java.desktop/share/native/libawt/java2d/Trace.h
1 1 /*
2 2 * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 4 *
5 5 * This code is free software; you can redistribute it and/or modify it
6 6 * under the terms of the GNU General Public License version 2 only, as
7 7 * published by the Free Software Foundation. Oracle designates this
8 8 * particular file as subject to the "Classpath" exception as provided
9 9 * by Oracle in the LICENSE file that accompanied this code.
10 10 *
11 11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 14 * version 2 for more details (a copy is included in the LICENSE file that
15 15 * accompanied this code).
16 16 *
17 17 * You should have received a copy of the GNU General Public License version
18 18 * 2 along with this work; if not, write to the Free Software Foundation,
19 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
↓ open down ↓ |
19 lines elided |
↑ open up ↑ |
20 20 *
21 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 22 * or visit www.oracle.com if you need additional information or have any
23 23 * questions.
24 24 */
25 25
26 26 #ifndef _Included_Trace
27 27 #define _Included_Trace
28 28
29 29 #include <jni.h>
30 +#include "jni_util.h"
30 31 #include "debug_trace.h"
31 32
32 33 #ifdef __cplusplus
33 34 extern "C" {
34 35 #endif /* __cplusplus */
36 +extern JavaVM *jvm;
37 +extern jint graphicsPrimitive_traceflags;
35 38
36 39 /**
37 40 * J2dTrace
38 41 * Trace utility used throughout Java 2D code. Uses a "level"
39 42 * parameter that allows user to specify how much detail
40 43 * they want traced at runtime. Tracing is only enabled
41 44 * in debug mode, to avoid overhead running release build.
42 45 */
43 46
44 47 #define J2D_TRACE_INVALID -1
45 48 #define J2D_TRACE_OFF 0
46 49 #define J2D_TRACE_ERROR 1
47 50 #define J2D_TRACE_WARNING 2
48 51 #define J2D_TRACE_INFO 3
49 52 #define J2D_TRACE_VERBOSE 4
50 53 #define J2D_TRACE_VERBOSE2 5
51 54 #define J2D_TRACE_MAX (J2D_TRACE_VERBOSE2+1)
52 55
53 56 JNIEXPORT void JNICALL
54 57 J2dTraceImpl(int level, jboolean cr, const char *string, ...);
55 58 JNIEXPORT void JNICALL
56 59 J2dTraceInit();
57 60
58 61 #ifndef DEBUG
59 62 #define J2dTrace(level, string)
60 63 #define J2dTrace1(level, string, arg1)
61 64 #define J2dTrace2(level, string, arg1, arg2)
62 65 #define J2dTrace3(level, string, arg1, arg2, arg3)
63 66 #define J2dTrace4(level, string, arg1, arg2, arg3, arg4)
64 67 #define J2dTrace5(level, string, arg1, arg2, arg3, arg4, arg5)
65 68 #define J2dTrace6(level, string, arg1, arg2, arg3, arg4, arg5, arg6)
66 69 #define J2dTrace7(level, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
67 70 #define J2dTrace8(level, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
68 71 #define J2dTraceLn(level, string)
69 72 #define J2dTraceLn1(level, string, arg1)
70 73 #define J2dTraceLn2(level, string, arg1, arg2)
71 74 #define J2dTraceLn3(level, string, arg1, arg2, arg3)
72 75 #define J2dTraceLn4(level, string, arg1, arg2, arg3, arg4)
73 76 #define J2dTraceLn5(level, string, arg1, arg2, arg3, arg4, arg5)
74 77 #define J2dTraceLn6(level, string, arg1, arg2, arg3, arg4, arg5, arg6)
75 78 #define J2dTraceLn7(level, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
76 79 #define J2dTraceLn8(level, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
77 80 #else /* DEBUG */
78 81 #define J2dTrace(level, string) { \
79 82 J2dTraceImpl(level, JNI_FALSE, string); \
80 83 }
81 84 #define J2dTrace1(level, string, arg1) { \
82 85 J2dTraceImpl(level, JNI_FALSE, string, arg1); \
83 86 }
84 87 #define J2dTrace2(level, string, arg1, arg2) { \
85 88 J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2); \
86 89 }
87 90 #define J2dTrace3(level, string, arg1, arg2, arg3) { \
88 91 J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2, arg3); \
89 92 }
90 93 #define J2dTrace4(level, string, arg1, arg2, arg3, arg4) { \
91 94 J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2, arg3, arg4); \
92 95 }
93 96 #define J2dTrace5(level, string, arg1, arg2, arg3, arg4, arg5) { \
94 97 J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2, arg3, arg4, arg5); \
95 98 }
96 99 #define J2dTrace6(level, string, arg1, arg2, arg3, arg4, arg5, arg6) { \
97 100 J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2, arg3, arg4, arg5, arg6); \
98 101 }
99 102 #define J2dTrace7(level, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7) { \
100 103 J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7); \
101 104 }
102 105 #define J2dTrace8(level, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) { \
103 106 J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \
104 107 }
105 108 #define J2dTraceLn(level, string) { \
106 109 J2dTraceImpl(level, JNI_TRUE, string); \
107 110 }
108 111 #define J2dTraceLn1(level, string, arg1) { \
109 112 J2dTraceImpl(level, JNI_TRUE, string, arg1); \
110 113 }
111 114 #define J2dTraceLn2(level, string, arg1, arg2) { \
112 115 J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2); \
113 116 }
114 117 #define J2dTraceLn3(level, string, arg1, arg2, arg3) { \
115 118 J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2, arg3); \
116 119 }
117 120 #define J2dTraceLn4(level, string, arg1, arg2, arg3, arg4) { \
118 121 J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2, arg3, arg4); \
119 122 }
120 123 #define J2dTraceLn5(level, string, arg1, arg2, arg3, arg4, arg5) { \
121 124 J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2, arg3, arg4, arg5); \
122 125 }
123 126 #define J2dTraceLn6(level, string, arg1, arg2, arg3, arg4, arg5, arg6) { \
124 127 J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2, arg3, arg4, arg5, arg6); \
125 128 }
126 129 #define J2dTraceLn7(level, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7) { \
127 130 J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7); \
128 131 }
129 132 #define J2dTraceLn8(level, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) { \
130 133 J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \
131 134 }
132 135 #endif /* DEBUG */
133 136
134 137
135 138 /**
136 139 * NOTE: Use the following RlsTrace calls very carefully; they are compiled
137 140 * into the code and should thus not be put in any performance-sensitive
138 141 * areas.
139 142 */
140 143
141 144 #define J2dRlsTrace(level, string) { \
142 145 J2dTraceImpl(level, JNI_FALSE, string); \
143 146 }
144 147 #define J2dRlsTrace1(level, string, arg1) { \
145 148 J2dTraceImpl(level, JNI_FALSE, string, arg1); \
146 149 }
147 150 #define J2dRlsTrace2(level, string, arg1, arg2) { \
148 151 J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2); \
149 152 }
150 153 #define J2dRlsTrace3(level, string, arg1, arg2, arg3) { \
151 154 J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2, arg3); \
152 155 }
153 156 #define J2dRlsTrace4(level, string, arg1, arg2, arg3, arg4) { \
154 157 J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2, arg3, arg4); \
155 158 }
156 159 #define J2dRlsTrace5(level, string, arg1, arg2, arg3, arg4, arg5) { \
157 160 J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2, arg3, arg4, arg5); \
158 161 }
159 162 #define J2dRlsTraceLn(level, string) { \
160 163 J2dTraceImpl(level, JNI_TRUE, string); \
161 164 }
162 165 #define J2dRlsTraceLn1(level, string, arg1) { \
163 166 J2dTraceImpl(level, JNI_TRUE, string, arg1); \
164 167 }
165 168 #define J2dRlsTraceLn2(level, string, arg1, arg2) { \
166 169 J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2); \
167 170 }
↓ open down ↓ |
123 lines elided |
↑ open up ↑ |
168 171 #define J2dRlsTraceLn3(level, string, arg1, arg2, arg3) { \
169 172 J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2, arg3); \
170 173 }
171 174 #define J2dRlsTraceLn4(level, string, arg1, arg2, arg3, arg4) { \
172 175 J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2, arg3, arg4); \
173 176 }
174 177 #define J2dRlsTraceLn5(level, string, arg1, arg2, arg3, arg4, arg5) { \
175 178 J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2, arg3, arg4, arg5); \
176 179 }
177 180
181 +#define J2dTracePrimitive(string) { \
182 + if (graphicsPrimitive_traceflags && jvm) { \
183 + JNIEnv *env; \
184 + jstring jstr; \
185 + (*jvm)->AttachCurrentThreadAsDaemon(jvm, &env, NULL); \
186 + jstr = (*env)->NewStringUTF(env, string); \
187 + JNU_CallStaticMethodByName(env, NULL, "sun/java2d/loops/GraphicsPrimitive", \
188 + "tracePrimitive", "(Ljava/lang/Object;)V", jstr); \
189 + (*env)->DeleteLocalRef(env, jstr); \
190 + } \
191 + }
192 +
193 +#define J2dTraceNotImplPrimitive(string) { \
194 + if (graphicsPrimitive_traceflags && jvm) { \
195 + JNIEnv *env; \
196 + jstring jstr; \
197 + (*jvm)->AttachCurrentThreadAsDaemon(jvm, &env, NULL); \
198 + jstr = (*env)->NewStringUTF(env, string); \
199 + JNU_CallStaticMethodByName(env, NULL, "sun/java2d/loops/GraphicsPrimitive", \
200 + "traceNotImplPrimitive", "(Ljava/lang/Object;)V", jstr); \
201 + (*env)->DeleteLocalRef(env, jstr); \
202 + } \
203 + }
204 +
178 205 #ifdef __cplusplus
179 206 };
180 207 #endif /* __cplusplus */
181 208
182 209 #endif /* _Included_Trace */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX