/*
* 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.
*/
#include <jlong.h>
#include "sun_java2d_opengl_GLXSurfaceData.h"
#include "OGLRenderQueue.h"
#include "GLXGraphicsConfig.h"
#include "GLXSurfaceData.h"
#include "awt_Component.h"
#include "awt_GraphicsEnv.h"
/**
* The methods in this file implement the native windowing system specific
* layer (GLX) for the OpenGL-based Java 2D pipeline.
*/
#ifndef HEADLESS
extern LockFunc OGLSD_Lock;
extern GetRasInfoFunc OGLSD_GetRasInfo;
extern UnlockFunc OGLSD_Unlock;
extern DisposeFunc OGLSD_Dispose;
extern struct MComponentPeerIDs mComponentPeerIDs;
extern void
#endif /* !HEADLESS */
{
#ifndef HEADLESS
sizeof(OGLSDOps));
return;
}
return;
}
#ifdef XAWT
"getContentWindow", "()J").j;
} else {
}
#else
cdata = (struct ComponentData *)
return;
}
return;
}
} else {
}
#endif
"Native GraphicsConfig data block missing");
return;
}
return;
}
#endif /* HEADLESS */
}
#ifndef HEADLESS
/**
* This function disposes of any native windowing system resources associated
* with this surface. For instance, if the given OGLSDOps is of type
* OGLSD_PBUFFER, this method implementation will destroy the actual pbuffer
* surface.
*/
void
{
}
// X Window is free'd later by AWT code...
}
}
/**
* Makes the given context current to its associated "scratch" surface. If
* the operation is successful, this method will return JNI_TRUE; otherwise,
* returns JNI_FALSE.
*/
static jboolean
{
"GLXSD_MakeCurrentToScratch: context is null");
return JNI_FALSE;
}
{
"GLXSD_MakeCurrentToScratch: could not make current");
return JNI_FALSE;
}
return JNI_TRUE;
}
/**
* Returns a pointer (as a jlong) to the native GLXGraphicsConfigInfo
* associated with the given OGLSDOps. This method can be called from
* shared code to retrieve the native GraphicsConfig data in a platform-
* independent manner.
*/
{
"OGLSD_GetNativeConfigInfo: ops are null");
return 0L;
}
"OGLSD_GetNativeConfigInfo: glx ops are null");
return 0L;
}
"OGLSD_GetNativeConfigInfo: config data is null");
return 0L;
}
}
/**
* Makes the given GraphicsConfig's context current to its associated
* "scratch" surface. If there is a problem making the context current,
* this method will return NULL; otherwise, returns a pointer to the
* OGLContext that is associated with the given GraphicsConfig.
*/
{
"OGLSD_SetScratchContext: glx config info is null");
return NULL;
}
return NULL;
}
// the GL_EXT_framebuffer_object extension is present, so this call
// will ensure that we are bound to the scratch pbuffer (and not
// some other framebuffer object)
}
return oglc;
}
/**
* Makes a context current to the given source and destination
* surfaces. If there is a problem making the context current, this method
* will return NULL; otherwise, returns a pointer to the OGLContext that is
* associated with the destination surface.
*/
{
"OGLSD_MakeOGLContextCurrent: context is null");
return NULL;
}
// first make sure we have a current context (if the context isn't
// already current to some drawable, we will make it current to
// its scratch surface)
if (oglc != currentContext) {
return NULL;
}
}
// now bind to the fbobject associated with the destination surface;
// this means that all rendering will go into the fbobject destination
// (note that we unbind the currently bound texture first; this is
// recommended procedure when binding an fbobject)
} else {
// make the context current
{
"OGLSD_MakeOGLContextCurrent: could not make current");
return NULL;
}
// the GL_EXT_framebuffer_object extension is present, so we
// must bind to the default (windowing system provided)
// framebuffer
}
}
return oglc;
}
/**
* This function initializes a native window surface and caches the window
* bounds in the given OGLSDOps. Returns JNI_TRUE if the operation was
* successful; JNI_FALSE otherwise.
*/
{
#ifdef XAWT
#else
#endif
"OGLSD_InitOGLWindow: ops are null");
return JNI_FALSE;
}
"OGLSD_InitOGLWindow: glx ops are null");
return JNI_FALSE;
}
#ifdef XAWT
if (window == 0) {
"OGLSD_InitOGLWindow: window is invalid");
return JNI_FALSE;
}
#else
}
if (!XtIsRealized(widget)) {
"OGLSD_InitOGLWindow: widget is unrealized");
return JNI_FALSE;
}
#endif
return JNI_TRUE;
}
{
"GLXSurfaceData_initPbuffer: w=%d h=%d opq=%d",
"GLXSurfaceData_initPbuffer: ops are null");
return JNI_FALSE;
}
"GLXSurfaceData_initPbuffer: glx ops are null");
return JNI_FALSE;
}
"GLXSurfaceData_initPbuffer: glx config info is null");
return JNI_FALSE;
}
// Call XSync without the acquired AWT lock to avoid a deadlock (see 8015730).
if ((pbuffer == 0) || errorOccurredFlag) {
"GLXSurfaceData_initPbuffer: could not create glx pbuffer");
return JNI_FALSE;
}
return JNI_TRUE;
}
void
{
if (window == 0L) {
"OGLSD_SwapBuffers: window is null");
return;
}
}
// needed by Mac OS X port, no-op on other platforms
void
{
}
#endif /* !HEADLESS */