Remove usage of texture pool metal-prototype-branch
authorjdv
Fri, 28 Jun 2019 15:22:18 +0530
branchmetal-prototype-branch
changeset 57441 ee34e24af607
parent 57440 10f701a91883
child 57457 95604ec1205d
Remove usage of texture pool
src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLTextRenderer.m
src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLVertexCache.m
--- a/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLTextRenderer.m	Fri Jun 28 14:36:42 2019 +0530
+++ b/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLTextRenderer.m	Fri Jun 28 15:22:18 2019 +0530
@@ -420,6 +420,7 @@
         }
 
         if (ginfo->image == NULL) {
+            J2dTraceLn(J2D_TRACE_INFO, "Glyph image is null");
             continue;
         }
 
--- a/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLVertexCache.m	Fri Jun 28 14:36:42 2019 +0530
+++ b/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLVertexCache.m	Fri Jun 28 15:22:18 2019 +0530
@@ -184,13 +184,16 @@
                                BMTLSDOps *dstOps)
 {
     J2dTraceLn(J2D_TRACE_INFO, "MTLVertexCache_AddGlyphTexture");
+    J2dTraceLn2(J2D_TRACE_INFO, "Glyph width = %d Glyph height = %d", width, height);
     if (texturePoolIndex >= MTLVC_MAX_TEX_INDEX ||
         vertexCacheIndex >= MTLVC_MAX_INDEX)
     {
         MTLVertexCache_FlushVertexCache(mtlc);
         MTLVertexCache_CreateSamplingEncoder(mtlc, dstOps);
     }
-    id<MTLTexture> texture = [mtlc.texturePool getTexture:width height:height format:MTLPixelFormatA8Unorm];
+    MTLTextureDescriptor *textureDescriptor = [MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatA8Unorm width:width height:height mipmapped:NO];
+    id <MTLTexture> texture = [mtlc.device newTextureWithDescriptor:textureDescriptor];
+    J2dTraceLn3(J2D_TRACE_INFO, "MTLVertexCache_AddGlyphTexture: created texture: tex=%p, w=%d h=%d", texture, width, height);
     NSUInteger bytesPerRow = 1 * width;
 
     MTLRegion region = {