On Tue, 12 Jul 2022 22:20:08 GMT, Phil Race <[email protected]> wrote:
>> Ajit Ghaisas has updated the pull request incrementally with one additional >> commit since the last revision: >> >> make method inline + clean commented line > > src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLRenderer.m line > 269: > >> 267: MTLRenderer_AddVertexToBatch(fx+fw, fy); >> 268: >> 269: MTLRenderer_AddVertexToBatch(fx+fw, fy); > > Why are there several duplicates here ? Earlier logic used to draw a rectangle with MTLPrimitiveTypeLineStrip. Hence, 5 vertices were specified to draw 4 sides of the rectangle. Now, the logic has been changed to use MTLPrimitiveTypeLine. Hence, 4 lines need to be specified separately by specifying 8 vertices. There are duplicates since the lines are connected. We cannot use MTLPrimitiveTypeLineStrip if we want to batch the subsequent draw calls as it draws an unwanted line between previous rectangle and current rectangle. ------------- PR: https://git.openjdk.org/jdk/pull/9245
