/*
* 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.
*/
/**
* Glyph cache used by the XRender pipeline.
*
* @author Clemens Eisserer
*/
HashMap<MutableInteger, XRGlyphCacheEntry> cacheMap = new HashMap<MutableInteger, XRGlyphCacheEntry>(256);
int grayGlyphSet;
int lcdGlyphSet;
static final boolean batchGlyphUpload = true; // Boolean.parseBoolean(System.getProperty("sun.java2d.xrender.batchGlyphUpload"));
this.maskBuffer = maskBuf;
}
try {
for (long glyphPtr : glyphPtrList) {
//Check if glyph hasn't been freed already
if (glyphID != 0) {
}
}
} finally {
}
}
protected int getFreeGlyphID() {
return newID;
}
return nextID++;
}
if (id == 0) {
return null;
}
}
time++;
// Find uncached glyphs and queue them for upload
if (uncachedGlyphs == null) {
}
}
}
// Add glyphs to cache
if (uncachedGlyphs != null) {
}
return entries;
}
protected void uploadGlyphs(XRGlyphCacheEntry[] glyphs, ArrayList<XRGlyphCacheEntry> uncachedGlyphs, GlyphList gl, int[] glIndices) {
}
if (cachedPixels > MAX_CACHED_PIXELS) {
}
List<XRGlyphCacheEntry>[] seperatedGlyphList = seperateGlyphTypes(uncachedGlyphs, containsLCDGlyphs);
/*
* Some XServers crash when uploading multiple glyphs at once. TODO:
* Implement build-switch in local case for distributors who know their
* XServer is fixed
*/
if (batchGlyphUpload) {
}
}
} else {
} else {
}
}
}
}
/**
* Seperates lcd and grayscale glyphs queued for upload, and sets the
* appropriate glyphset for the cache entries.
*/
protected List<XRGlyphCacheEntry>[] seperateGlyphTypes(List<XRGlyphCacheEntry> glyphList, boolean containsLCDGlyphs) {
if (grayGlyphs == null) {
}
} else {
}
}
}
}
/**
* Copies the glyph-images into a continous buffer, required for uploading.
*/
ByteArrayOutputStream stream = new ByteArrayOutputStream((isLCDGlyph ? 4 : 1) * 48 * glyphList.size());
}
return stream.toByteArray();
}
boolean containsLCDGlyphs = false;
if (containsLCDGlyphs) {
return true;
}
}
return false;
}
/*
* Glyph uploading is so slow anyway, we can afford some inefficiency
* here, as the cache should usually be quite small. TODO: Implement
* something not that stupid ;)
*/
}
});
}
}
}
glyph.setUnpinned();
}
}
} else {
}
}
}
}
}
}