/*
* 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 "X11SurfaceData.h"
#include <jni.h>
#include <math.h>
#include "Region.h"
#include "fontscalerdefs.h"
/* On Solaris 10 updates 8, 9, the render.h file defines these
* protocol values but does not define the structs in Xrender.h.
* Thus in order to get these always defined on Solaris 10
* we will undefine the symbols if we have determined via the
* makefiles that Xrender.h is lacking the structs. This will
* trigger providing our own definitions as on earlier updates.
* We could assume that *all* Solaris 10 update versions will lack the updated
* Xrender.h and do this based solely on O/S being any 5.10 version, but this
* could still change and we'd be broken again as we'd be re-defining them.
*/
#ifdef SOLARIS10_NO_XRENDER_STRUCTS
#endif
#ifndef X_RenderCreateLinearGradient
typedef struct _XLinearGradient {
#endif
#ifndef X_RenderCreateRadialGradient
typedef struct _XCircle {
XFixed x;
XFixed y;
} XCircle;
typedef struct _XRadialGradient {
#endif
#include <dlfcn.h>
#ifdef __solaris__
/* Solaris 10 will not have these symbols at runtime */
const XLinearGradient *gradient,
const XRenderColor *colors,
int nstops);
const XRadialGradient *gradient,
const XRenderColor *colors,
int nstops);
static
static
#endif
{ \
}
/* The xrender pipleine requires libXrender.so version 0.9.3 or later. */
#define REQUIRED_XRENDER_VER1 0
void *xrenderlib;
return JNI_FALSE;
}
#ifdef __solaris__
if (xrenderlib != NULL) {
if (XRenderCreateLinearGradientFunc == NULL ||
{
}
} else {
}
#else
pos -= 1;
}
// compose absolute filename to package config
// check whether the config file exist and is a regular file
{
// look for version
if (lineLen > versionPrefixLen &&
{
if (numProcessed == numNeeded) {
// we successfuly read the library version
if (REQUIRED_XRENDER_VER1 == v1 &&
((REQUIRED_XRENDER_VER2 > v2) ||
{
if (verbose) {
printf("INFO: the version %d.%d.%d of libXrender.so is "
"not supported.\n\tSee release notes for more details.\n",
}
} else {
if (verbose) {
printf("INFO: The version of libXrender.so "
}
}
}
break;
}
}
}
}
}
}
if (verbose && !versionInfoIsFound) {
printf("WARNING: The version of libXrender.so cannot be detected.\n,"
"The pipe line will be enabled, but note that versions less than 0.9.3\n"
"may cause hangs and crashes\n"
"\tSee the release notes for more details.\n");
}
#endif
return available;
}
/*
* Class: sun_awt_X11GraphicsEnvironment
* Method: initGLX
* Signature: ()Z
*/
{
#ifndef HEADLESS
if (firstTime) {
AWT_LOCK();
AWT_UNLOCK();
}
return xrenderAvailable;
#else
return JNI_FALSE;
#endif /* !HEADLESS */
}
char *maskData;
return;
}
}
}
return ptr_to_jlong(xgc);
}
}
0, &pict_attr);
}
}
}
}
}
}
}
}
}
int i;
if (rectCnt <= 256) {
} else {
return;
}
}
}
return;
}
for (i=0; i < rectCnt; i++) {
}
}
}
}
jint i;
return -1;
}
return -1;
}
/*TODO optimized & malloc check*/
for (i=0; i < numStops; i++) {
}
#ifdef __solaris__
if (XRenderCreateLinearGradientFunc!=NULL) {
}
#else
#endif
if (gradient != 0) {
}
}
jint i;
if ((pixels =
return -1;
}
return -1; //TODO release pixels first
}
/*TODO optimized & malloc check*/
for (i=0; i < numStops; i++) {
}
#ifdef __solaris__
if (XRenderCreateRadialGradientFunc != NULL) {
}
#else
#endif
if (gradient != 0) {
}
}
switch(filter) {
case 0:
filterName = "fast";
break;
case 1:
filterName = "good";
break;
case 2:
filterName = "best";
break;
}
}
{
int numrects;
&pRect, 256);
}
} else {
}
}
}
char *mask;
char *defaultData;
if ((mask = (char *)
return;
}
if (ea != 1.0f) {
}
}
}
/*
* 1. If existing XImage and supplied buffer match, only adjust the data pointer
* 2. If existing XImage is large enough to hold the data but does not match in
* scan the data is copied to fit the XImage.
* 3. If data is larger than the existing XImage a new temporary XImage is
* allocated.
* The default XImage is optimized for the AA tiles, which are currently 32x32.
*/
img = defaultImg;
if (imageFits &&
} else {
if (imageFits) {
}
}
} else {
}
}
if (img != defaultImg) {
}
}
unsigned char *pixelData;
int i;
}
}
return;
}
{
return;
}
if ((pixelData = (unsigned char *)
{
return;
}
for (i=0; i < glyphCnt; i++) {
// 'jginfo->cellInfo' is of type 'void*'
// (see definition of 'GlyphInfo' in fontscalerdefs.h)
// 'Glyph' is typedefed to 'unsigned long'
// Maybe we should assert that (sizeof(void*) == sizeof(Glyph)) ?
}
(const char*)pixelData, pixelDataLength);
}
/* The glyph ids are 32 bit but may be stored in a 64 bit long on
* a 64 bit architecture. So optimise the 32 bit case to avoid
* extra stack or heap allocations by directly referencing the
* underlying Java array and only allocate on 64 bit.
*/
return;
} else {
}
return;
} else {
int i;
if (glyphCnt <= 64) {
} else {
return;
}
}
}
return;
}
for (i=0; i < glyphCnt; i++) {
}
}
}
}
}
jint i;
unsigned int *xids;
int charCnt = 0;
if (eltCnt <= 24) {
}else {
return;
}
}
if (glyphCnt <= 256) {
} else {
}
return;
}
}
}
}
return;
}
}
}
return;
}
for (i=0; i < glyphCnt; i++) {
}
for (i=0; i < eltCnt; i++) {
}
}
}
}
} else {
}
}
int i;
if (rectCnt <= 256) {
} else {
return;
}
}
}
return;
}
for (i=0; i < rectCnt; i++) {
}
}
}
return;
}
}