/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#import <stdlib.h>
#import <string.h>
#import "sun_java2d_opengl_CGLGraphicsConfig.h"
#import "jni.h"
#import "jni_util.h"
#import "CGLGraphicsConfig.h"
#import "CGLSurfaceData.h"
#import "LWCToolkit.h"
#import "ThreadUtilities.h"
/**
* Disposes all memory and resources associated with the given
* CGLGraphicsConfigInfo (including its native OGLContext data).
*/
void
{
"OGLGC_DestroyOGLGraphicsConfig: info is null");
return;
}
}
}
}
}
int remoteSocketFD = -1;
static void *JRSRemoteThreadFn(void *data) {
// Negotiate a unix domain socket to communicate the
// out of band data: to read the mach port server name, and
// subsequently write out the layer ID.
static char* sock_path = "/tmp/JRSRemoteDemoSocket";
int BUFLEN = 256;
if (remoteSocketFD < 0) {
NSLog(@"socket() failed");
return NULL;
}
if (status != 0) {
tries++;
usleep(5000000);
}
}
if (status != 0) {
NSLog(@"failed to connect");
return NULL;
}
return NULL;
}
void sendLayerID(int layerID) {
NSLog(@"No connection to send ID");
return;
}
int BUFLEN = 256;
}
#endif /* REMOTELAYER */
/**
* This is a globally shared context used when creating textures. When any
* new contexts are created, they specify this context as the "share list"
* context, which means any texture objects created when this shared context
* is current will be available to any other context in any other thread.
*/
/**
* Attempts to initialize CGL and the core OpenGL library.
*/
{
if (!OGLFuncs_OpenLibrary()) {
return JNI_FALSE;
}
if (!OGLFuncs_InitPlatformFuncs() ||
!OGLFuncs_InitBaseFuncs() ||
{
return JNI_FALSE;
}
return JNI_TRUE;
}
/**
* Determines whether the CGL pipeline can be used for a given GraphicsConfig
* provided its screen number and visual ID. If the minimum requirements are
* met, the native CGLGraphicsConfigInfo structure is initialized for this
* GraphicsConfig with the necessary information (pixel format, etc.)
* and a pointer to this structure is returned as a jlong. If
* initialization fails at any point, zero is returned, indicating that CGL
* cannot be used for this GraphicsConfig (we should fallback on an existing
* 2D pipeline).
*/
{
if ([NSThread isMainThread]) {
} else {
[GraphicsConfigUtil performSelectorOnMainThread: @selector(_getCGLConfigInfo:) withObject: retArray waitUntilDone: YES];
}
return ret;
}
if (sharedContext == NULL) {
if (glMask == 0) {
}
NSOpenGLPFAColorSize, 32,
NSOpenGLPFADepthSize, 16,
0
};
if (sharedPixelFormat == nil) {
J2dRlsTraceLn(J2D_TRACE_ERROR, "CGLGraphicsConfig_getCGLConfigInfo: shared NSOpenGLPixelFormat is NULL");
return;
}
shareContext: NULL];
if (sharedContext == nil) {
J2dRlsTraceLn(J2D_TRACE_ERROR, "CGLGraphicsConfig_getCGLConfigInfo: shared NSOpenGLContext is NULL");
return;
}
}
defer: false];
return;
}
if (scratchSurface == nil) {
return;
}
#else
pixelsWide:64
pixelsHigh:64];
return;
}
#else
// get version and extension strings
if (!OGLContext_IsVersionSupported(versionstr)) {
return;
}
J2dRlsTraceLn1(J2D_TRACE_INFO, "CGLGraphicsConfig_getCGLConfigInfo: OpenGL version=%s", versionstr);
if (value != 0) {
}
if (value != 0) {
}
"CGLGraphicsConfig_getCGLConfigInfo: db=%d alpha=%d",
// remove before shipping (?)
#if 1
if (value == 0) {
}
// 0: the buffers are swapped with no regard to the vertical refresh rate
// 1: the buffers are swapped only during the vertical retrace
return;
}
if (oglc == 0L) {
return;
}
// create the CGLGraphicsConfigInfo record for this config
J2dRlsTraceLn(J2D_TRACE_ERROR, "CGLGraphicsConfig_getCGLConfigInfo: could not allocate memory for cglinfo");
return;
}
}
@end //GraphicsConfigUtil
{
return CAPS_EMPTY;
} else {
}
}
{
}];
}