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
↓ 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
↓ 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