Added optimization for only drawing objects in visible screen region. Added layer support