Closed Bug 1531532 Opened 6 years ago Closed 6 years ago

Use preTranslate instead of postTranslate when correcting for the mask offset

Categories

(Core :: Graphics, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: jrmuizel, Assigned: jrmuizel)

References

Details

Attachments

(1 file)

DTO = DrawTargetOffset = (-Origin.x, -Origin.y)
CTM = CurrentTransform
MASKT = MaskTransform = Inv(CurrentTransform)
MASKO = MaskOffset = (GetRect().x, GetRect().y)

The transform to device space is:

MASKT * CTM * DTO

Currently we do:
MASKT = MASKT * MASKO

Which gives us MASKT * MASKO * CTM * DTO. This works fine if there's no scale but
will not properly cancel out if there is.

I believe we want:
MASKO * MASKT * CTM * DTO

To get this we need to preTranslate instead of postTranslate.

DTO = DrawTargetOffset = (-Origin.x, -Origin.y)
CTM = CurrentTransform
MASKT = MaskTransform = Inv(CurrentTransform)
MASKO = MaskOffset = (GetRect().x, GetRect().y)

The transform to device space is:

MASKT * CTM * DTO

Currently we do:
MASKT = MASKT * MASKO

Which gives us MASKT * MASKO * CTM * DTO. This works fine if there's no scale but
will not properly cancel out if there is.

I believe we want:
MASKO * MASKT * CTM * DTO

To get this we need to preTranslate instead of postTranslate.

Priority: -- → P3
Blocks: 1495170
Pushed by jmuizelaar@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/10304db77c0a Use preTranslate instead of postTranslate when correcting for the mask offset. r=mattwoodrow
Pushed by mwoodrow@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/ffd3366e43f3 Remove incorrect reftest fuzzy annotation. r=bustage
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
Assignee: nobody → jmuizelaar
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: