Bug 748718 tried to fix masking of the checkerboard layer, but incorrectly
calculated the values for the right and bottom sides of the page, causing
less masking to occur than should happen.
It also possibly broke single-colour layer drawing (though I'm not sure this
worked previously), which this fixes by clearing to the page colour instead of
generating and drawing a texture for it.
ScreenshotLayer overrides SingleTileLayer's draw function to simplify the
drawing process. Unfortunately, this doesn't respect the layer mask, and can
cause the layer to appear incorrectly stretched.
Change the screenshot process so that whole-page screenshots pass parameters
that are pre-scaled (to avoid mismatches when the viewport changes), and set
the page size on the ScreenShotLayer so it draws in the correct place.
This also alters the masking slightly to avoid visible seams around masks in
the centre of the page, and to avoid unnnecessary drawing at the edges of the
page.
This change fixes the frame-rate issues with the screenshot layer, as it
removes unnecessary over-draw.
--HG--
extra : rebase_source : 671c5a48d7bc08b3b452ed7eea228eb22843c1ce