Handle zero size native drawing more gracefully.

RESOLVED FIXED in mozilla25

Status

()

RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: jrmuizel, Assigned: jrmuizel)

Tracking

unspecified
mozilla25
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Created attachment 777236 [details] [diff] [review]
Handle zero size native drawing more gracefully.

This is causing crashes with CoreGraphics Azure.
Attachment #777236 - Flags: review?(matt.woodrow)
Comment on attachment 777236 [details] [diff] [review]
Handle zero size native drawing more gracefully.

Review of attachment 777236 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/thebes/gfxQuartzNativeDrawing.cpp
@@ +43,5 @@
>          IntSize backingSize(NSToIntFloor(mNativeRect.width * mBackingScale),
>                              NSToIntFloor(mNativeRect.height * mBackingScale));
> +
> +       if (backingSize.IsEmpty())
> +          return nullptr;

Couldn't we assert that mBackingScale is never 0, and then move this check up to the root scope of this function?

Seems better than having the overhead of borrowing our CGContext, or creating an temporary cairo surface if nothing is going to be drawn.
Attachment #777236 - Flags: review?(matt.woodrow) → review+
https://hg.mozilla.org/mozilla-central/rev/605f61628a4b
Assignee: nobody → jmuizelaar
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
You need to log in before you can comment on or make changes to this bug.