render: Take geometry into account when rendering to a buffer
Otherwise e.g. thumbnails of floating windows with drop shadow are cut off.
Fixes a51f7cd1 ("render: Switch thumbnail rendering to new render API")
@arun-mani-j would be great if you could have a look. This (usually) doesn't affect maximized or tiled windows as they usually don't use drop shadows or similar but can be seen with e.g. floating GTK apps.
Testing is appreciated to ensure we don't ever sample outside the texture (as we'd otherwise assert).