Both panels are driven by the same single pass through the scores, sorted highest to lowest. Method A does what your ROC library actually does: lower the threshold past each unique score, and after every negative label it plots a new point at (cumulative FPR, cumulative TPR) — that's the staircase.
Method B is the "compare every positive/negative pair" definition. It never runs explicitly in the ROC code, but it's happening implicitly: the moment the sweep passes a negative example, every positive already counted above it is a pair the positive correctly outranked. That's exactly one row of green cells lighting up.
Run to the end and check the two AUC numbers below the panels — concordant ÷ 16 from the grid and the shaded trapezoid area from the curve land on the identical value, because they are the identical computation, just told two different ways.