Closed Bug 1258558 Opened 8 years ago Closed 8 years ago

pixman region _equal returns false for empty region

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla48
Tracking Status
firefox48 --- fixed

People

(Reporter: BenWa, Assigned: BenWa)

References

Details

Attachments

(1 file)

      No description provided.
Blocks: 1248044
What's the motivation for this change?
Flags: needinfo?(bgirard)
Region::IsEqual will be false if the region is empty and the empty extents don't match. The test case in the bug 1248044  triggered this by adding rects and them removing them all again.
Flags: needinfo?(bgirard)
Comment on attachment 8733109 [details]
MozReview Request: Bug 1258558 - Don't check extents for empty regions. r=jrmuizel

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/41555/diff/1-2/
Comment on attachment 8733109 [details]
MozReview Request: Bug 1258558 - Don't check extents for empty regions. r=jrmuizel

https://reviewboard.mozilla.org/r/41555/#review38511

::: gfx/cairo/libpixman/src/pixman-region.c:305
(Diff revision 2)
>  
> +    // pixman only guarantes that the extends are empty, not that
> +    // they are (0, 0, 0, 0), so we can't compare them for empty
> +    // region.
> +    if (PIXREGION_NUMRECTS (reg1) == 0 && PIXREGION_NUMRECTS (reg2) == 0)
> +        return TRUE;

if (PIXREGION_NIL (reg1) && PIXREGION_NIL(reg2))

and use /* style comments.

Change the comment to something like:
/* If the region is empty the extents are undefined so we need to check for empty before comparing the extents. */
Attachment #8733109 - Flags: review?(jmuizelaar) → review+
Comment on attachment 8733109 [details]
MozReview Request: Bug 1258558 - Don't check extents for empty regions. r=jrmuizel

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/41555/diff/2-3/
https://hg.mozilla.org/mozilla-central/rev/1cc3d0a27d30
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Depends on: 1287066
Assignee: nobody → b56girard
You need to log in before you can comment on or make changes to this bug.