The icon "Use mask" forces all drawing tools, the gradient and many other functions to pay attention to the mask of the active layer (see chapter 2.4.1).