jdk/src/macosx/native/sun/java2d/opengl/CGLGraphicsConfig.m
changeset 23325 4c3942938b0d
parent 15988 6db6e40405cf
child 23328 4c53a6ebc779
equal deleted inserted replaced
23324:fb6002beb0ce 23325:4c3942938b0d
     1 /*
     1 /*
     2  * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2011, 2014, 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
   431         return cglinfo->context->caps;
   431         return cglinfo->context->caps;
   432     }
   432     }
   433 }
   433 }
   434 
   434 
   435 JNIEXPORT jint JNICALL
   435 JNIEXPORT jint JNICALL
   436 Java_sun_java2d_opengl_CGLGraphicsConfig_getMaxTextureSize
   436 Java_sun_java2d_opengl_CGLGraphicsConfig_nativeGetMaxTextureSize
   437     (JNIEnv *env, jclass cglgc)
   437     (JNIEnv *env, jclass cglgc)
   438 {
   438 {
   439     J2dTraceLn(J2D_TRACE_INFO, "CGLGraphicsConfig_getMaxTextureSize");
   439     J2dTraceLn(J2D_TRACE_INFO, "CGLGraphicsConfig_nativeGetMaxTextureSize");
   440 
   440 
   441     __block int max = 0;
   441     __block int max = 0;
   442 
   442 
   443     [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
   443     [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
   444         [sharedContext makeCurrentContext];
   444         [sharedContext makeCurrentContext];
   445         j2d_glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max);
   445         j2d_glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max);
       
   446         [NSOpenGLContext clearCurrentContext];
   446     }];
   447     }];
   447 
   448 
   448     return (jint)max;
   449     return (jint)max;
   449 }
   450 }
   450