# HG changeset patch # User jdv # Date 1565253954 -19800 # Node ID 6b0febcd7b438e9e0d69145c878dcea7db6d0fc1 # Parent c47331043c12423d3eed1e9fc6de93e0e2c5f2a1 Disable usage of check_previous_op for text rendering diff -r c47331043c12 -r 6b0febcd7b43 src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLTextRenderer.m --- a/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLTextRenderer.m Wed Jul 24 11:08:24 2019 +0530 +++ b/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLTextRenderer.m Thu Aug 08 14:15:54 2019 +0530 @@ -339,8 +339,8 @@ J2dTraceLn(J2D_TRACE_INFO, "MTLTR_DrawGrayscaleGlyphNoCache"); if (glyphMode != MODE_NO_CACHE_GRAY) { - MTLTR_DisableGlyphModeState(); - CHECK_PREVIOUS_OP(MTL_STATE_MASK_OP); + //MTLTR_DisableGlyphModeState(); + //CHECK_PREVIOUS_OP(MTL_STATE_MASK_OP); glyphMode = MODE_NO_CACHE_GRAY; } @@ -411,6 +411,7 @@ glyphMode = MODE_NOT_INITED; isCachedDestValid = JNI_FALSE; J2dTraceLn1(J2D_TRACE_INFO, "totalGlyphs = %d", totalGlyphs); + MTLVertexCache_EnableMaskCache(mtlc, dstOps); for (glyphCounter = 0; glyphCounter < totalGlyphs; glyphCounter++) { J2dTraceLn(J2D_TRACE_INFO, "Entered for loop for glyph list"); @@ -504,7 +505,7 @@ break; } } - + MTLVertexCache_FlushVertexCache(mtlc); MTLTR_DisableGlyphModeState(); } diff -r c47331043c12 -r 6b0febcd7b43 src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLVertexCache.m --- a/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLVertexCache.m Wed Jul 24 11:08:24 2019 +0530 +++ b/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLVertexCache.m Thu Aug 08 14:15:54 2019 +0530 @@ -102,6 +102,8 @@ vertexBuffer = nil; } vertexCacheIndex = 0; + maskCacheIndex = 0; + maskCacheTex = nil; } /** @@ -180,6 +182,9 @@ void MTLVertexCache_DisableMaskCache(MTLContext *mtlc) { + // TODO : Once we enable check_previous_op + // we will start using DisableMaskCache until then + // we are force flusging vertexcache. J2dTraceLn(J2D_TRACE_INFO, "MTLVertexCache_DisableMaskCache"); MTLVertexCache_FlushVertexCache(mtlc); MTLVertexCache_RestoreColorState(mtlc);