本文整理汇总了C++中J2dRlsTraceLn函数的典型用法代码示例。如果您正苦于以下问题:C++ J2dRlsTraceLn函数的具体用法?C++ J2dRlsTraceLn怎么用?C++ J2dRlsTraceLn使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了J2dRlsTraceLn函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OGLFuncs_OpenLibrary
jboolean
OGLFuncs_OpenLibrary()
{
J2dRlsTraceLn(J2D_TRACE_INFO, "OGLFuncs_OpenLibrary");
OGL_OPEN_LIB();
if (OGL_LIB_IS_UNINITIALIZED()) {
J2dRlsTraceLn(J2D_TRACE_ERROR,
"OGLFuncs_OpenLibrary: could not open library");
return JNI_FALSE;
}
return JNI_TRUE;
}
示例2: GLXGC_InitGLX
/**
* Attempts to initialize GLX and the core OpenGL library. For this method
* to return JNI_TRUE, the following must be true:
* - libGL must be loaded successfully (via dlopen)
* - all function symbols from libGL must be available and loaded properly
* - the GLX extension must be available through X11
* - client GLX version must be >= 1.3
* If any of these requirements are not met, this method will return
* JNI_FALSE, indicating there is no hope of using GLX/OpenGL for any
* GraphicsConfig in the environment.
*/
static jboolean
GLXGC_InitGLX()
{
int errorbase, eventbase;
const char *version;
J2dRlsTraceLn(J2D_TRACE_INFO, "GLXGC_InitGLX");
if (!OGLFuncs_OpenLibrary()) {
return JNI_FALSE;
}
if (!OGLFuncs_InitPlatformFuncs() ||
!OGLFuncs_InitBaseFuncs() ||
!OGLFuncs_InitExtFuncs())
{
OGLFuncs_CloseLibrary();
return JNI_FALSE;
}
if (!j2d_glXQueryExtension(awt_display, &errorbase, &eventbase)) {
J2dRlsTraceLn(J2D_TRACE_ERROR,
"GLXGC_InitGLX: GLX extension is not present");
OGLFuncs_CloseLibrary();
return JNI_FALSE;
}
version = j2d_glXGetClientString(awt_display, GLX_VERSION);
if (version == NULL) {
J2dRlsTraceLn(J2D_TRACE_ERROR,
"GLXGC_InitGLX: could not query GLX version");
OGLFuncs_CloseLibrary();
return JNI_FALSE;
}
// we now only verify that the client GLX version is >= 1.3 (if the
// server does not support GLX 1.3, then we will find that out later
// when we attempt to create a GLXFBConfig)
J2dRlsTraceLn1(J2D_TRACE_INFO,
"GLXGC_InitGLX: client GLX version=%s", version);
if (!((version[0] == '1' && version[2] >= '3') || (version[0] > '1'))) {
J2dRlsTraceLn(J2D_TRACE_ERROR,
"GLXGC_InitGLX: invalid GLX version; 1.3 is required");
OGLFuncs_CloseLibrary();
return JNI_FALSE;
}
return JNI_TRUE;
}
示例3: OGLFuncs_CloseLibrary
void
OGLFuncs_CloseLibrary()
{
J2dRlsTraceLn(J2D_TRACE_INFO, "OGLFuncs_CloseLibrary");
if (OGL_LIB_IS_UNINITIALIZED()) {
J2dRlsTraceLn(J2D_TRACE_ERROR,
"OGLFuncs_CloseLibrary: library not yet initialized");
return;
}
if (OGL_CLOSE_LIB()) {
J2dRlsTraceLn(J2D_TRACE_ERROR,
"OGLFuncs_CloseLibrary: could not close library");
}
}
示例4: AccelGlyphCache_Init
/**
* Creates a new GlyphCacheInfo structure, fills in the initial values, and
* then returns a pointer to the GlyphCacheInfo record.
*
* Note that this method only sets up a data structure describing a
* rectangular region of accelerated memory, containing "virtual" cells of
* the requested size. The cell information is added lazily to the linked
* list describing the cache as new glyphs are added. Platform specific
* glyph caching code is responsible for actually creating the accelerated
* memory surface that will contain the individual glyph images.
*/
GlyphCacheInfo *
AccelGlyphCache_Init(jint width, jint height,
jint cellWidth, jint cellHeight,
FlushFunc *func)
{
GlyphCacheInfo *gcinfo;
J2dTraceLn(J2D_TRACE_INFO, "AccelGlyphCache_Init");
gcinfo = (GlyphCacheInfo *)malloc(sizeof(GlyphCacheInfo));
if (gcinfo == NULL) {
J2dRlsTraceLn(J2D_TRACE_ERROR,
"AccelGlyphCache_Init: could not allocate GlyphCacheInfo");
return NULL;
}
gcinfo->head = NULL;
gcinfo->tail = NULL;
gcinfo->width = width;
gcinfo->height = height;
gcinfo->cellWidth = cellWidth;
gcinfo->cellHeight = cellHeight;
gcinfo->isFull = JNI_FALSE;
gcinfo->Flush = func;
return gcinfo;
}
示例5: GLXGC_DestroyOGLContext
/**
* Disposes all memory and resources allocated for the given OGLContext.
*/
static void
GLXGC_DestroyOGLContext(OGLContext *oglc)
{
GLXCtxInfo *ctxinfo;
J2dTraceLn(J2D_TRACE_INFO, "GLXGC_DestroyOGLContext");
if (oglc == NULL) {
J2dRlsTraceLn(J2D_TRACE_ERROR,
"GLXGC_DestroyOGLContext: context is null");
return;
}
// at this point, this context will be current to its scratch surface
// so the following GL/GLX operations should be safe...
OGLContext_DestroyContextResources(oglc);
ctxinfo = (GLXCtxInfo *)oglc->ctxInfo;
if (ctxinfo != NULL) {
// release the current context before we continue
j2d_glXMakeContextCurrent(awt_display, None, None, NULL);
if (ctxinfo->context != 0) {
j2d_glXDestroyContext(awt_display, ctxinfo->context);
}
if (ctxinfo->scratchSurface != 0) {
j2d_glXDestroyPbuffer(awt_display, ctxinfo->scratchSurface);
}
free(ctxinfo);
}
free(oglc);
}
示例6: OGLSD_SetScratchSurface
/**
* 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.
*/
OGLContext *
OGLSD_SetScratchSurface(JNIEnv *env, jlong pConfigInfo)
{
GLXGraphicsConfigInfo *glxInfo =
(GLXGraphicsConfigInfo *)jlong_to_ptr(pConfigInfo);
OGLContext *oglc;
J2dTraceLn(J2D_TRACE_INFO, "OGLSD_SetScratchContext");
if (glxInfo == NULL) {
J2dRlsTraceLn(J2D_TRACE_ERROR,
"OGLSD_SetScratchContext: glx config info is null");
return NULL;
}
oglc = glxInfo->context;
if (!GLXSD_MakeCurrentToScratch(env, oglc)) {
return NULL;
}
if (OGLC_IS_CAP_PRESENT(oglc, CAPS_EXT_FBOBJECT)) {
// 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)
j2d_glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
}
return oglc;
}
示例7: OGLTR_CreateLCDTextProgram
/**
* Compiles and links the LCD text shader program. If successful, this
* function returns a handle to the newly created shader program; otherwise
* returns 0.
*/
static GLhandleARB
OGLTR_CreateLCDTextProgram()
{
GLhandleARB lcdTextProgram;
GLint loc;
J2dTraceLn(J2D_TRACE_INFO, "OGLTR_CreateLCDTextProgram");
lcdTextProgram = OGLContext_CreateFragmentProgram(lcdTextShaderSource);
if (lcdTextProgram == 0) {
J2dRlsTraceLn(J2D_TRACE_ERROR,
"OGLTR_CreateLCDTextProgram: error creating program");
return 0;
}
// "use" the program object temporarily so that we can set the uniforms
j2d_glUseProgramObjectARB(lcdTextProgram);
// set the "uniform" values
loc = j2d_glGetUniformLocationARB(lcdTextProgram, "glyph_tex");
j2d_glUniform1iARB(loc, 0); // texture unit 0
loc = j2d_glGetUniformLocationARB(lcdTextProgram, "dst_tex");
j2d_glUniform1iARB(loc, 1); // texture unit 1
loc = j2d_glGetUniformLocationARB(lcdTextProgram, "invgamma_tex");
j2d_glUniform1iARB(loc, 2); // texture unit 2
loc = j2d_glGetUniformLocationARB(lcdTextProgram, "gamma_tex");
j2d_glUniform1iARB(loc, 3); // texture unit 3
// "unuse" the program object; it will be re-bound later as needed
j2d_glUseProgramObjectARB(0);
return lcdTextProgram;
}
示例8: OGLContext_IsExtensionAvailable
/**
* Returns JNI_TRUE if the given extension name is available for the current
* GraphicsConfig; JNI_FALSE otherwise. An extension is considered available
* if its identifier string is found amongst the space-delimited GL_EXTENSIONS
* string.
*
* Adapted from the OpenGL Red Book, pg. 506.
*/
jboolean
OGLContext_IsExtensionAvailable(const char *extString, char *extName)
{
jboolean ret = JNI_FALSE;
char *p = (char *)extString;
char *end;
if (extString == NULL) {
J2dTraceLn(J2D_TRACE_INFO, "OGLContext_IsExtensionAvailable");
J2dRlsTraceLn(J2D_TRACE_ERROR,
"OGLContext_IsExtensionAvailable: extension string is null");
return JNI_FALSE;
}
end = p + strlen(p);
while (p < end) {
size_t n = strcspn(p, " ");
if ((strlen(extName) == n) && (strncmp(extName, p, n) == 0)) {
ret = JNI_TRUE;
break;
}
p += (n + 1);
}
J2dRlsTraceLn2(J2D_TRACE_INFO,
"OGLContext_IsExtensionAvailable: %s=%s",
extName, ret ? "true" : "false");
return ret;
}
示例9: RETURN_STATUS_IF_NULL
HRESULT
D3DGlyphCache::Init(D3DContext *pCtx)
{
D3DFORMAT format;
RETURN_STATUS_IF_NULL(pCtx, E_FAIL);
J2dTraceLn1(J2D_TRACE_INFO, "D3DGlyphCache::Init pCtx=%x", pCtx);
this->pCtx = pCtx;
if (pGlyphCache == NULL) {
// init glyph cache data structure
pGlyphCache = AccelGlyphCache_Init(D3DTR_CACHE_WIDTH,
D3DTR_CACHE_HEIGHT,
D3DTR_CACHE_CELL_WIDTH,
D3DTR_CACHE_CELL_HEIGHT,
D3DGlyphCache_FlushGlyphVertexCache);
if (pGlyphCache == NULL) {
J2dRlsTraceLn(J2D_TRACE_ERROR,
"D3DGlyphCache::Init: "\
"could not init D3D glyph cache");
return E_FAIL;
}
}
if (gcType == CACHE_GRAY) {
format = pCtx->IsTextureFormatSupported(D3DFMT_A8) ?
D3DFMT_A8 : D3DFMT_A8R8G8B8;
} else { // gcType == CACHE_LCD
format = pCtx->IsTextureFormatSupported(D3DFMT_R8G8B8) ?
D3DFMT_R8G8B8 : D3DFMT_A8R8G8B8;
}
HRESULT res = pCtx->GetResourceManager()->
CreateTexture(D3DTR_CACHE_WIDTH, D3DTR_CACHE_HEIGHT,
FALSE/*isRTT*/, FALSE/*isOpaque*/, &format, 0/*usage*/,
&pGlyphCacheRes);
if (FAILED(res)) {
J2dRlsTraceLn(J2D_TRACE_ERROR,
"D3DGlyphCache::Init: "\
"could not create glyph cache texture");
}
return res;
}
示例10: OGLFuncs_InitBaseFuncs
jboolean
OGLFuncs_InitBaseFuncs()
{
J2dRlsTraceLn(J2D_TRACE_INFO, "OGLFuncs_InitBaseFuncs");
if (OGL_LIB_IS_UNINITIALIZED()) {
J2dRlsTraceLn(J2D_TRACE_ERROR,
"OGLFuncs_InitBaseFuncs: library not yet initialized");
return JNI_FALSE;
}
OGL_EXPRESS_BASE_FUNCS(INIT_AND_CHECK)
J2dTraceLn(J2D_TRACE_VERBOSE,
"OGLFuncs_InitBaseFuncs: successfully loaded base symbols");
return JNI_TRUE;
}
示例11: J2dTraceLn2
/**
* Initializes an OpenGL texture, using the given width and height as
* a guide. See OGLSD_InitTextureObject() for more information.
*/
JNIEXPORT jboolean JNICALL
Java_sun_java2d_opengl_OGLSurfaceData_initTexture
(JNIEnv *env, jobject oglsd,
jlong pData, jboolean isOpaque,
jboolean texNonPow2, jboolean texRect,
jint width, jint height)
{
OGLSDOps *oglsdo = (OGLSDOps *)jlong_to_ptr(pData);
J2dTraceLn2(J2D_TRACE_INFO, "OGLSurfaceData_initTexture: w=%d h=%d",
width, height);
if (oglsdo == NULL) {
J2dRlsTraceLn(J2D_TRACE_ERROR,
"OGLSurfaceData_initTexture: ops are null");
return JNI_FALSE;
}
/*
* We only use the GL_ARB_texture_rectangle extension if it is available
* and the requested bounds are not pow2 (it is probably faster to use
* GL_TEXTURE_2D for pow2 textures, and besides, our TexturePaint
* code relies on GL_REPEAT, which is not allowed for
* GL_TEXTURE_RECTANGLE_ARB targets).
*/
texRect = texRect && !OGLSD_IsPowerOfTwo(width, height);
if (!OGLSD_InitTextureObject(oglsdo, isOpaque, texNonPow2, texRect,
width, height))
{
J2dRlsTraceLn(J2D_TRACE_ERROR,
"OGLSurfaceData_initTexture: could not init texture object");
return JNI_FALSE;
}
OGLSD_SetNativeDimensions(env, oglsdo,
oglsdo->textureWidth, oglsdo->textureHeight);
oglsdo->drawableType = OGLSD_TEXTURE;
// other fields (e.g. width, height) are set in OGLSD_InitTextureObject()
return JNI_TRUE;
}
示例12: OGLSD_GetNativeConfigInfo
/**
* Returns a pointer (as a jlong) to the native WGLGraphicsConfigInfo
* associated with the given OGLSDOps. This method can be called from
* shared code to retrieve the native GraphicsConfig data in a platform-
* independent manner.
*/
jlong
OGLSD_GetNativeConfigInfo(OGLSDOps *oglsdo)
{
WGLSDOps *wglsdo;
if (oglsdo == NULL) {
J2dRlsTraceLn(J2D_TRACE_ERROR,
"OGLSD_GetNativeConfigInfo: ops are null");
return 0L;
}
wglsdo = (WGLSDOps *)oglsdo->privOps;
if (wglsdo == NULL) {
J2dRlsTraceLn(J2D_TRACE_ERROR,
"OGLSD_GetNativeConfigInfo: wgl ops are null");
return 0L;
}
return ptr_to_jlong(wglsdo->configInfo);
}
示例13: OGLContext_IsBIOpShaderSupportAvailable
/**
* Returns JNI_TRUE only if all of the following conditions are met:
* - the GL_ARB_fragment_shader extension is available
* - the BufferedImageOp shader codepath has been enabled via the
* system property
*/
static jboolean
OGLContext_IsBIOpShaderSupportAvailable(JNIEnv *env,
jboolean fragShaderAvailable)
{
jboolean isBIOpShaderEnabled = JNI_FALSE;
J2dTraceLn(J2D_TRACE_INFO, "OGLContext_IsBIOpShaderSupportAvailable");
// first see if the fragment shader extension is available
if (!fragShaderAvailable) {
return JNI_FALSE;
}
// next see if the biopshader system property has been enabled
isBIOpShaderEnabled =
JNU_GetStaticFieldByName(env, NULL,
"sun/java2d/opengl/OGLSurfaceData",
"isBIOpShaderEnabled", "Z").z;
if (!isBIOpShaderEnabled) {
J2dRlsTraceLn(J2D_TRACE_INFO,
"OGLContext_IsBIOpShaderSupportAvailable: disabled via flag");
return JNI_FALSE;
}
/*
* Note: In theory we should probably do some other checks here, like
* linking a sample shader to see if the hardware truly supports our
* shader programs. However, our current BufferedImageOp shaders were
* designed to support first-generation shader-level hardware, so the
* assumption is that if our shaders work on those GPUs, then they'll
* work on newer ones as well. Also, linking a fragment program can
* cost valuable CPU cycles, which is another reason to avoid these
* checks at startup.
*/
J2dRlsTraceLn(J2D_TRACE_INFO,
"OGLContext_IsBIOpShaderSupportAvailable: BufferedImageOp shader supported");
return JNI_TRUE;
}
示例14: J2dTraceLn
/**
* Initializes a surface in the backbuffer of a given double-buffered
* onscreen window for use in a BufferStrategy.Flip situation. The bounds of
* the backbuffer surface should always be kept in sync with the bounds of
* the underlying native window.
*/
JNIEXPORT jboolean JNICALL
Java_sun_java2d_opengl_OGLSurfaceData_initFlipBackbuffer
(JNIEnv *env, jobject oglsd,
jlong pData)
{
OGLSDOps *oglsdo = (OGLSDOps *)jlong_to_ptr(pData);
J2dTraceLn(J2D_TRACE_INFO, "OGLSurfaceData_initFlipBackbuffer");
if (oglsdo == NULL) {
J2dRlsTraceLn(J2D_TRACE_ERROR,
"OGLSurfaceData_initFlipBackbuffer: ops are null");
return JNI_FALSE;
}
if (oglsdo->drawableType == OGLSD_UNDEFINED) {
if (!OGLSD_InitOGLWindow(env, oglsdo)) {
J2dRlsTraceLn(J2D_TRACE_ERROR,
"OGLSurfaceData_initFlipBackbuffer: could not init window");
return JNI_FALSE;
}
}
if (oglsdo->drawableType != OGLSD_WINDOW) {
J2dRlsTraceLn(J2D_TRACE_ERROR,
"OGLSurfaceData_initFlipBackbuffer: drawable is not a window");
return JNI_FALSE;
}
oglsdo->drawableType = OGLSD_FLIP_BACKBUFFER;
// x/yOffset have already been set in OGLSD_InitOGLWindow()...
// REMIND: for some reason, flipping won't work properly on IFB unless we
// explicitly use BACK_LEFT rather than BACK...
oglsdo->activeBuffer = GL_BACK_LEFT;
OGLSD_SetNativeDimensions(env, oglsdo, oglsdo->width, oglsdo->height);
return JNI_TRUE;
}
示例15: OGLContext_IsLCDShaderSupportAvailable
/**
* Returns JNI_TRUE only if all of the following conditions are met:
* - the GL_ARB_fragment_shader extension is available
* - the LCD text shader codepath has been enabled via the system property
* - the hardware supports the minimum number of texture units
*/
static jboolean
OGLContext_IsLCDShaderSupportAvailable(JNIEnv *env,
jboolean fragShaderAvailable)
{
jboolean isLCDShaderEnabled = JNI_FALSE;
GLint maxTexUnits;
J2dTraceLn(J2D_TRACE_INFO, "OGLContext_IsLCDShaderSupportAvailable");
// first see if the fragment shader extension is available
if (!fragShaderAvailable) {
return JNI_FALSE;
}
// next see if the lcdshader system property has been enabled
isLCDShaderEnabled =
JNU_GetStaticFieldByName(env, NULL,
"sun/java2d/opengl/OGLSurfaceData",
"isLCDShaderEnabled", "Z").z;
if (!isLCDShaderEnabled) {
J2dRlsTraceLn(J2D_TRACE_INFO,
"OGLContext_IsLCDShaderSupportAvailable: disabled via flag");
return JNI_FALSE;
}
// finally, check to see if the hardware supports the required number
// of texture units
j2d_glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS_ARB, &maxTexUnits);
if (maxTexUnits < 2) {
J2dRlsTraceLn1(J2D_TRACE_INFO,
"OGLContext_IsLCDShaderSupportAvailable: not enough tex units (%d)",
maxTexUnits);
}
J2dRlsTraceLn(J2D_TRACE_INFO,
"OGLContext_IsLCDShaderSupportAvailable: LCD text shader supported");
return JNI_TRUE;
}