Closed Bug 895007 Opened 11 years ago Closed 11 years ago

Handle zero size native drawing more gracefully.

Categories

(Core :: Graphics, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla25

People

(Reporter: jrmuizel, Assigned: jrmuizel)

Details

Attachments

(1 file)

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
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: