Closed Bug 1152838 Opened 7 years ago Closed 7 years ago

BaseRect::InflateToMultiple is wrong, and we're not using it and instead inflating everything by the tile size (not to snapping to tile boundaries, as intended)

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: mstange, Assigned: mstange)

References

Details

Attachments

(2 files, 1 obsolete file)

Heh.
Oh, we're not inflating by the tile size, we're just not clipping the one-pixel inflation to tiles. So it's less bad than I first thought.
> x = static_cast<T>(floor(x / aMultiple.width)) * aMultiple.width;
> y = static_cast<T>(floor(y / aMultiple.height)) * aMultiple.height;
> xMost = static_cast<T>(ceil(x / aMultiple.width)) * aMultiple.width;
> yMost = static_cast<T>(ceil(y / aMultiple.height)) * aMultiple.height;

There are two problems with this code:
 1. It's using integer division, if the rect is an nsIntRect. So floor / ceil do nothing.
 2. The snapped xMost and yMost are computed from x / y instead of from xMost / yMost.
/r/6801 - Bug 1152838 - Fix BaseRect::InflateToMultiple and move it to nsIntRect. r=mattwoodrow, r=jrmuizel
/r/6803 - Bug 1152838 - Correctly inflate valid regions to tile boundaries. r=mattwoodrow

Pull down these commits:

hg pull -r d8025ebb54d0852b19cf1bcbd0b9247283c0dd46 https://reviewboard-hg.mozilla.org/gecko/
Attachment #8590470 - Flags: review?(matt.woodrow)
Attachment #8590470 - Flags: review?(jmuizelaar)
https://reviewboard.mozilla.org/r/6801/#review5703

Ship It!

::: gfx/2d/NumericTools.h
(Diff revision 1)
> +  // to optimize.

And slower.
https://hg.mozilla.org/mozilla-central/rev/304252ab0165
https://hg.mozilla.org/mozilla-central/rev/1e271824dcca
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
Attachment #8590470 - Flags: review?(jmuizelaar) → review+
Attachment #8590470 - Flags: review?(matt.woodrow)
Attachment #8590470 - Attachment is obsolete: true
Attachment #8620007 - Flags: review+
Attachment #8620008 - Flags: review+
You need to log in before you can comment on or make changes to this bug.