XRGlyphCacheEntry.java revision 6133
/*
* 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.
*/
/**
* Stores glyph-related data, used in the pure-java glyphcache.
*
* @author Clemens Eisserer
*/
public class XRGlyphCacheEntry {
long glyphInfoPtr;
int lastUsed;
boolean pinned;
int xOff;
int yOff;
int glyphSet;
this.glyphInfoPtr = glyphInfoPtr;
/* TODO: Does it make sence to cache results? */
}
public int getXOff() {
return xOff;
}
public int getYOff() {
return yOff;
}
public void setGlyphSet(int glyphSet) {
}
public int getGlyphSet() {
return glyphSet;
}
public static int getGlyphID(long glyphInfoPtr) {
// 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'
// On 64-bit Big-endian architectures it would be wrong to access this
// field with Unsafe.getInt().
}
// 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
// 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()
}
public int getGlyphID() {
return getGlyphID(glyphInfoPtr);
}
public void setGlyphID(int id) {
}
public float getXAdvance() {
}
public float getYAdvance() {
}
public int getSourceRowBytes() {
}
public int getWidth() {
}
public int getHeight() {
}
long pixelDataAddress =
if (pixelDataAddress == 0L) {
return;
}
int rowBytes = getSourceRowBytes();
if (!uploadAsLCD) {
for(int x = 0; x < paddedWidth; x++) {
if(x < width) {
}else {
/*pad to multiple of 4 bytes per line*/
}
}
}
} else {
int srcpix = 0;
while (srcpix < rowBytesWidth) {
srcpix += 3;
}
}
}
}
public float getTopLeftXOffset() {
}
public float getTopLeftYOffset() {
}
public long getGlyphInfoPtr() {
return glyphInfoPtr;
}
public boolean isGrayscale(boolean listContainsLCDGlyphs) {
return getSourceRowBytes() == getWidth() && !(getWidth() == 0 && getHeight() == 0 && listContainsLCDGlyphs);
}
public int getPaddedWidth(boolean listContainsLCDGlyphs) {
}
public int getDestinationRowBytes(boolean listContainsLCDGlyphs) {
}
public int getGlyphDataLenth(boolean listContainsLCDGlyphs) {
}
public void setPinned() {
pinned = true;
}
public void setUnpinned() {
pinned = false;
}
public int getLastUsed() {
return lastUsed;
}
public void setLastUsed(int lastUsed) {
}
public int getPixelCnt() {
}
public boolean isPinned() {
return pinned;
}
}