Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8240264: iOS: Unnecessary logging on every pulse when GL context changes #165

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -34,6 +34,26 @@
#include "com_sun_prism_es2_IOSGLContext.h"

extern void printAndReleaseResources(jlong pf, jlong ctx, const char *message);
jboolean pulseLoggingRequested;

jboolean isPulseLoggingRequested(JNIEnv *env) {
jclass loggerCls = (*env)->FindClass(env, "com/sun/javafx/logging/PulseLogger");
if ((*env)->ExceptionCheck(env) || loggerCls == NULL) {
(*env)->ExceptionClear(env);
return JNI_FALSE;
}
jmethodID loggerMID = (*env)->GetStaticMethodID(env, loggerCls, "isPulseLoggingRequested", "()Z");
if ((*env)->ExceptionCheck(env) || loggerMID == NULL) {
(*env)->ExceptionClear(env);
return JNI_FALSE;
}
jboolean result = (*env)->CallStaticBooleanMethod(env, loggerCls, loggerMID);
if ((*env)->ExceptionCheck(env)) {
(*env)->ExceptionClear(env);
return JNI_FALSE;
}
return result;
}

/*
* Class: com_sun_prism_es2_IOSGLContext
@@ -51,6 +71,7 @@ JNIEXPORT jlong JNICALL Java_com_sun_prism_es2_IOSGLContext_nInitialize
int versionNumbers[2];
const char *glExtensions;

pulseLoggingRequested = isPulseLoggingRequested(env);
jlong pixelFormat = 0;
jlong win = 0;
jlong context = 0;
@@ -289,5 +310,7 @@ JNIEXPORT void JNICALL Java_com_sun_prism_es2_IOSGLContext_nMakeCurrent
interval = (vSyncNeeded) ? 1 : 0;
ctxInfo->state.vSyncEnabled = vSyncNeeded;
setSwapInterval(ctxInfo->context, interval);
fprintf(stderr, "setSwapInterval(%d)\n", interval);
if (pulseLoggingRequested) {
fprintf(stderr, "setSwapInterval(%d)\n", interval);
}
}
@@ -92,7 +92,9 @@ jboolean flushBuffer(void *context) {
}

void setSwapInterval(void *context, int interval) {
fprintf(stderr, "IOSWindowSystemInterface : setSwapInterval unimp\n");
if (pulseLoggingRequested) {
fprintf(stderr, "IOSWindowSystemInterface : setSwapInterval unimp\n");
}
}


@@ -50,3 +50,4 @@ void* getProcAddress(const char *procName);

void setSwapInterval(void* nsContext, int interval);

extern jboolean pulseLoggingRequested;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.