Disable mAnchor check in nsDisplayBackgroundImage::TryOptimizeImageLayer

RESOLVED FIXED in mozilla27

Status

()

Core
Layout
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: roc, Assigned: roc)

Tracking

Trunk
mozilla27
x86_64
Linux
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

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.
Attachment #800750 - Flags: review?(tnikkel) → review+
https://hg.mozilla.org/mozilla-central/rev/f038ed247498
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.