Marking layout params as dirty only when necessary.