This slide takes a closer look at how the algorithm works. Initially, on the right we have the current window consisting of the top 3 rows. On the left, we have just obtained another new row.
We now have all the neighbors that we need to subdivide the horizontal edges and vertices in the middle row. This gives a new row at the finer level.
Also, we have enough information to split the diagonal and vertical edges connecting the middle and bottom rows, which produces another row of vertices at the finer level.
And here's the pseudocode for the algorithm: (from slide).
In the actual implementation, we figure out for how many levels we have memory and unroll the recursion up to that level.