Layerized nsDisplayBackgroundImages don't follow the same rules for image snapping as our regular image drawing path ... unfortunately. Regular image drawing always preserves scale factors exactly and snaps a particular "anchor point" to the corner of a pixel. This is especially important when drawing tiled images, where changing scale factors in any way could grossly change the number of tiles that appear in a given region (since any change in tile size is multiplied by the number of tiles). Layerized nsDisplayBackgroundImages currently don't support tiling. Snapping occurs in ImageLayer::ComputeEffectiveTransforms, which snaps the image rect edges to nearest pixel boundaries, possibly changing scale factors. The anchor point is unused. We try to avoid problems by refusing layerization if the anchor point is not (0,0) (the top left of the image), but this doesn't really make sense since layerized image snapping is just different and the anchor point is not relevant. Inconsistency between layerized image drawing and regular image drawing could be problematic but it doesn't seem to have shown up so far. In the meantime we should just remove the anchor check since it can hurt performance and probably isn't helping anything.
5 years ago
Created attachment 800750 [details] [diff] [review] fix
Attachment #800750 - Flags: review?(tnikkel)
Attachment #800750 - Flags: review?(tnikkel) → review+
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
You need to log in before you can comment on or make changes to this bug.