src/share/classes/sun/awt/PlatformFont.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 268,278 ****
while(stringIndex < end)
{
currentDefaultChar = data[stringIndex];
// Note that cache sizes must be a power of two!
! cacheIndex = (int)(currentDefaultChar & this.FONTCACHEMASK);
theChar = (PlatformFontCache)getFontCache()[cacheIndex];
// Is the unicode char we want cached?
if(theChar == null || theChar.uniChar != currentDefaultChar)
--- 268,278 ----
while(stringIndex < end)
{
currentDefaultChar = data[stringIndex];
// Note that cache sizes must be a power of two!
! cacheIndex = (int)(currentDefaultChar & PlatformFont.FONTCACHEMASK);
theChar = (PlatformFontCache)getFontCache()[cacheIndex];
// Is the unicode char we want cached?
if(theChar == null || theChar.uniChar != currentDefaultChar)
*** 307,317 ****
/*
currentFontDescriptor.unicodeEncoder.encode(CharBuffer.wrap(input),
theChar.bb,
true);
*/
! if (currentFontDescriptor.isLE) {
theChar.bb.put((byte)(input[0] & 0xff));
theChar.bb.put((byte)(input[0] >>8));
} else {
theChar.bb.put((byte)(input[0] >> 8));
theChar.bb.put((byte)(input[0] & 0xff));
--- 307,317 ----
/*
currentFontDescriptor.unicodeEncoder.encode(CharBuffer.wrap(input),
theChar.bb,
true);
*/
! if (FontDescriptor.isLE) {
theChar.bb.put((byte)(input[0] & 0xff));
theChar.bb.put((byte)(input[0] >>8));
} else {
theChar.bb.put((byte)(input[0] >> 8));
theChar.bb.put((byte)(input[0] & 0xff));
*** 418,428 ****
// This method is not MT-safe by design. Since this is just a
// cache anyways, it's okay if we occasionally allocate the array
// twice or return an array which will be dereferenced and gced
// right away.
if (fontCache == null) {
! fontCache = new Object[this.FONTCACHESIZE];
}
return fontCache;
}
--- 418,428 ----
// This method is not MT-safe by design. Since this is just a
// cache anyways, it's okay if we occasionally allocate the array
// twice or return an array which will be dereferenced and gced
// right away.
if (fontCache == null) {
! fontCache = new Object[PlatformFont.FONTCACHESIZE];
}
return fontCache;
}