In 2.78 (current master) the grease pencil erase tool doesn't check if the line is in front of the view or not.
In this file, use the eraser in the top viewport, (just erase over the whole view a few strokes). notice in the bottom viewport that lines are removed which aren't visible.
Likely cause is gp_point_to_xy not passing V3D_PROJ_TEST_CLIP_NEAR flag.
view3d_point_depth also isn't correctly checking the depth - should probably call mul_project_m4_v3_zfac directly since ED_view3d_calc_zfac flips negative values - since its intended for tool code.