Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8243159: Disable unused glyph cache code in LCD rendering
  • Loading branch information
jayathirthrao committed Apr 20, 2020
1 parent ec0ca2b commit 61fdc8a95abd5fcb930906565af3e63ecf90e9b1
Showing with 11 additions and 12 deletions.
  1. +11 −12 src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLTextRenderer.m
@@ -525,7 +525,7 @@
MTLTR_DisableGlyphVertexCache(mtlc);
}

if (glyphCacheLCD == NULL) {
/*if (glyphCacheLCD == NULL) {
if (!MTLTR_InitGlyphCache(mtlc, JNI_TRUE)) {
return JNI_FALSE;
}
@@ -536,12 +536,12 @@
// for lastRGBOrder above
MTLGlyphCache_Invalidate(glyphCacheLCD);
lastRGBOrder = rgbOrder;
}
}*/

glyphMode = MODE_USE_CACHE_LCD;
}

if (ginfo->cellInfo == NULL) {
/*if (ginfo->cellInfo == NULL) {
// attempt to add glyph to accelerated glyph cache
// TODO : Handle RGB order
MTLTR_AddToGlyphCache(ginfo, mtlc, MTLPixelFormatRGBA8Unorm);
@@ -550,7 +550,7 @@
// we'll just no-op in the rare case that the cell is NULL
return JNI_TRUE;
}
}
}*/
encoder = [mtlc.encoderManager getTextureEncoder:dstOps->pTexture isSrcOpaque:YES isDstOpaque:YES];
if (!MTLTR_EnableLCDGlyphModeState(encoder, mtlc, dstOps,contrast))
{
@@ -928,15 +928,14 @@
}
}
/*
* This state management needs to be extended for other glyphmodes
* when they are implemented.
* Only in case of grayscale text drawing we need to flush
* cache. Still in case of LCD we are not using any intermediate
* cache.
*/
if (glyphMode != MODE_NO_CACHE_LCD) {
if (glyphMode == MODE_NO_CACHE_GRAY) {
MTLVertexCache_DisableMaskCache(mtlc);
} else {
MTLTR_DisableGlyphVertexCache(mtlc);
}
if (glyphMode == MODE_NO_CACHE_GRAY) {
MTLVertexCache_DisableMaskCache(mtlc);
} else if (glyphMode == MODE_USE_CACHE_GRAY) {
MTLTR_DisableGlyphVertexCache(mtlc);
}
}

0 comments on commit 61fdc8a

Please sign in to comment.