Question d’entretien chez BlackBerry

How would you implement paints "fill" function?