1. Top-left rule:
A triangle rasterization rule (in Direct3D, OpenGL, GDI) defines how vector data is mapped into raster data. The raster data is snapped to integer locations that are then culled and clipped, and per-pixel attributes are interpolated before being passed to a pixel shader. Top-left rule ensures that adjacent triangles are drawn once.
The shared edge is the left edge of the Triangle (0,0, 5,0, 5,5). Thus pixels on the shared edge are included into the right triangle. If we consider antialiasing or multisampling , it will be more complicated.
2. Diamond-exit rule:
This is a rasterization rule for line segments that share the end point. OpenGL uses a this rule to determine those fragments that are produce by rasterizing a line segment.