7191872: Xrender: No text displayed using 64 bit JDK on solaris11-sparc
Reviewed-by: prr, ceisserer
This commit is contained in:
parent
1e981ec895
commit
dbb7fe4b2a
@ -747,14 +747,9 @@ public class FileFontStrike extends PhysicalStrike {
|
|||||||
return origMinX;
|
return origMinX;
|
||||||
}
|
}
|
||||||
|
|
||||||
long pixelData;
|
long pixelData =
|
||||||
if (StrikeCache.nativeAddressSize == 4) {
|
StrikeCache.unsafe.getAddress(ptr + StrikeCache.pixelDataOffset);
|
||||||
pixelData = 0xffffffff &
|
|
||||||
StrikeCache.unsafe.getInt(ptr + StrikeCache.pixelDataOffset);
|
|
||||||
} else {
|
|
||||||
pixelData =
|
|
||||||
StrikeCache.unsafe.getLong(ptr + StrikeCache.pixelDataOffset);
|
|
||||||
}
|
|
||||||
if (pixelData == 0L) {
|
if (pixelData == 0L) {
|
||||||
return origMinX;
|
return origMinX;
|
||||||
}
|
}
|
||||||
|
@ -361,16 +361,10 @@ public final class GlyphList {
|
|||||||
graybits = new byte[len];
|
graybits = new byte[len];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
long pixelDataAddress;
|
long pixelDataAddress =
|
||||||
if (StrikeCache.nativeAddressSize == 4) {
|
StrikeCache.unsafe.getAddress(images[glyphindex] +
|
||||||
pixelDataAddress = 0xffffffff &
|
|
||||||
StrikeCache.unsafe.getInt(images[glyphindex] +
|
|
||||||
StrikeCache.pixelDataOffset);
|
StrikeCache.pixelDataOffset);
|
||||||
} else {
|
|
||||||
pixelDataAddress =
|
|
||||||
StrikeCache.unsafe.getLong(images[glyphindex] +
|
|
||||||
StrikeCache.pixelDataOffset);
|
|
||||||
}
|
|
||||||
if (pixelDataAddress == 0L) {
|
if (pixelDataAddress == 0L) {
|
||||||
return graybits;
|
return graybits;
|
||||||
}
|
}
|
||||||
|
@ -69,11 +69,28 @@ public class XRGlyphCacheEntry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static int getGlyphID(long glyphInfoPtr) {
|
public static int getGlyphID(long glyphInfoPtr) {
|
||||||
return (int) StrikeCache.unsafe.getInt(glyphInfoPtr + StrikeCache.cacheCellOffset);
|
// We need to access the GlyphID with Unsafe.getAddress() because the
|
||||||
|
// corresponding field in the underlying C data-structure is of type
|
||||||
|
// 'void*' (see field 'cellInfo' of struct 'GlyphInfo'
|
||||||
|
// in src/share/native/sun/font/fontscalerdefs.h).
|
||||||
|
// On 64-bit Big-endian architectures it would be wrong to access this
|
||||||
|
// field with Unsafe.getInt().
|
||||||
|
return (int) StrikeCache.unsafe.getAddress(glyphInfoPtr +
|
||||||
|
StrikeCache.cacheCellOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setGlyphID(long glyphInfoPtr, int id) {
|
public static void setGlyphID(long glyphInfoPtr, int id) {
|
||||||
StrikeCache.unsafe.putInt(glyphInfoPtr + StrikeCache.cacheCellOffset, id);
|
// We need to access the GlyphID with Unsafe.putAddress() because the
|
||||||
|
// corresponding field in the underlying C data-structure is of type
|
||||||
|
// 'void*' (see field 'cellInfo' of struct 'GlyphInfo' in
|
||||||
|
// src/share/native/sun/font/fontscalerdefs.h).
|
||||||
|
// On 64-bit Big-endian architectures it would be wrong to write this
|
||||||
|
// field with Unsafe.putInt() because it is also accessed from native
|
||||||
|
// code as a 'long'.
|
||||||
|
// See Java_sun_java2d_xr_XRBackendNative_XRAddGlyphsNative()
|
||||||
|
// in src/solaris/native/sun/java2d/x11/XRBackendNative.c
|
||||||
|
StrikeCache.unsafe.putAddress(glyphInfoPtr +
|
||||||
|
StrikeCache.cacheCellOffset, (long)id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getGlyphID() {
|
public int getGlyphID() {
|
||||||
@ -105,12 +122,9 @@ public class XRGlyphCacheEntry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void writePixelData(ByteArrayOutputStream os, boolean uploadAsLCD) {
|
public void writePixelData(ByteArrayOutputStream os, boolean uploadAsLCD) {
|
||||||
long pixelDataAddress;
|
long pixelDataAddress =
|
||||||
if (StrikeCache.nativeAddressSize == 4) {
|
StrikeCache.unsafe.getAddress(glyphInfoPtr +
|
||||||
pixelDataAddress = 0xffffffff & StrikeCache.unsafe.getInt(glyphInfoPtr + StrikeCache.pixelDataOffset);
|
StrikeCache.pixelDataOffset);
|
||||||
} else {
|
|
||||||
pixelDataAddress = StrikeCache.unsafe.getLong(glyphInfoPtr + StrikeCache.pixelDataOffset);
|
|
||||||
}
|
|
||||||
if (pixelDataAddress == 0L) {
|
if (pixelDataAddress == 0L) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -742,7 +742,12 @@ Java_sun_java2d_xr_XRBackendNative_XRAddGlyphsNative
|
|||||||
for (i=0; i < glyphCnt; i++) {
|
for (i=0; i < glyphCnt; i++) {
|
||||||
GlyphInfo *jginfo = (GlyphInfo *) jlong_to_ptr(glyphInfoPtrs[i]);
|
GlyphInfo *jginfo = (GlyphInfo *) jlong_to_ptr(glyphInfoPtrs[i]);
|
||||||
|
|
||||||
gid[i] = (Glyph) (0x0ffffffffL & ((unsigned long)(jginfo->cellInfo)));
|
// 'jginfo->cellInfo' is of type 'void*'
|
||||||
|
// (see definition of 'GlyphInfo' in fontscalerdefs.h)
|
||||||
|
// 'Glyph' is typedefed to 'unsigned long'
|
||||||
|
// (see http://www.x.org/releases/X11R7.7/doc/libXrender/libXrender.txt)
|
||||||
|
// Maybe we should assert that (sizeof(void*) == sizeof(Glyph)) ?
|
||||||
|
gid[i] = (Glyph) (jginfo->cellInfo);
|
||||||
xginfo[i].x = (-jginfo->topLeftX);
|
xginfo[i].x = (-jginfo->topLeftX);
|
||||||
xginfo[i].y = (-jginfo->topLeftY);
|
xginfo[i].y = (-jginfo->topLeftY);
|
||||||
xginfo[i].width = jginfo->width;
|
xginfo[i].width = jginfo->width;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user