Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.
/ lanai Public archive

8242035: Combine drawPrimitive calls in text drawing flush #19

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -93,10 +93,9 @@
atIndex:MeshVertexBuffer];

[encoder setFragmentTexture:maskCacheTex.texture atIndex: 0];
for (int i = 0; i < maskCacheIndex; i++) {
J2dTraceLn1(J2D_TRACE_INFO, "MTLVertexCache_FlushVertexCache : draw texture at index %d", i);
[encoder drawPrimitives:MTLPrimitiveTypeTriangle vertexStart:i*6 vertexCount:6];
}
J2dTraceLn1(J2D_TRACE_INFO,
"MTLVertexCache_FlushVertexCache : encode %d characters", (vertexCacheIndex / 6));
[encoder drawPrimitives:MTLPrimitiveTypeTriangle vertexStart:0 vertexCount:vertexCacheIndex];
}
vertexCacheIndex = 0;
maskCacheIndex = 0;
@@ -118,10 +117,9 @@
atIndex:MeshVertexBuffer];
id<MTLTexture> glyphCacheTex = MTLTR_GetGlyphCacheTexture();
[encoder setFragmentTexture:glyphCacheTex atIndex: 0];
for (int i = 0; i < vertexCacheIndex; i = i + 6) {
J2dTraceLn1(J2D_TRACE_INFO, "MTLVertexCache_FlushGlyphVertexCache : draw texture at index %d", (int)(i + 1)/6);
[encoder drawPrimitives:MTLPrimitiveTypeTriangle vertexStart:i vertexCount:6];
}
J2dTraceLn1(J2D_TRACE_INFO,
"MTLVertexCache_FlushGlyphVertexCache : encode %d characters", (vertexCacheIndex / 6));
[encoder drawPrimitives:MTLPrimitiveTypeTriangle vertexStart:0 vertexCount:vertexCacheIndex];
}
vertexCacheIndex = 0;
}