Make beginPaint() become public.