We determine completely the analytic functions \(\varphi \) in the unit disk \(\mathbb {D}\) such that for all (normalized) orientation-preserving harmonic mappings \(f=h+\overline{g}\) produced by the shear construction with \(h+ g=\varphi \) , the condition that each f maps \(\mathbb {D}\) onto a convex domain holds. As a consequence, we obtain the following more general result: for a given complex number \(\eta \) , with \(|\eta |=1\) , we characterize those holomorphic mappings \(\varphi \) in \(\mathbb {D}\) such that every harmonic function \(f=h+\overline{g}\) as above with \(h-\eta g=\varphi \) maps \(\mathbb {D}\) onto a convex domain. The resulting functions are mappings onto a half-plane and mappings onto a strip, and the shear direction, determined by the parameter \(\eta \) above, is parallel to the linear boundaries of the half-planes and strips.