  Scattering of light from an anisotropic source produces linear polarization
in spectral lines and the continuum. In the outer layers of a stellar
atmosphere the anisotropy of the radiation field is typically dominated by the
radiation escaping away, but local horizontal fluctuations of the physical
conditions may also contribute, distorting the illumination and hence, the
polarization pattern. Additionally, a magnetic field may perturb and modify the
line scattering polarization signals through the Hanle effect. Here, we study
such symmetry-breaking effects. We develop a method to solve the transfer of
polarized radiation in a scattering atmosphere with weak horizontal
fluctuations of the opacity and source functions. It comprises linearization
(small opacity fluctuations are assumed), reduction to a quasi-planeparallel
problem through harmonic analysis, and numerical solution by generalized
standard techniques. We apply this method to study scattering polarization in
atmospheres with horizontal fluctuations in the Planck function and opacity. We
derive several very general results and constraints from considerations on the
symmetries and dimensionality of the problem, and we give explicit solutions of
a few illustrative problems of especial interest. For example, we show (a) how
the amplitudes of the fractional linear polarization signals change when
considering increasingly smaller horizontal atmospheric inhomogeneities, (b)
that in the presence of such inhomogeneities even a vertical magnetic field may
modify the scattering line polarization, and (c) that forward scattering
polarization may be produced without the need of an inclined magnetic field.
These results are important to understand the physics of the problem and as
benchmarks for multidimensional radiative transfer codes.
