Note: There are a few cases of duplicates in user autocompletion which are being worked on.

Ensure as many cairo surfaces are non-null as possible

RESOLVED FIXED in mozilla10

Status

()

Core
Graphics
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: jdm, Unassigned)

Tracking

Trunk
mozilla10
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Comment hidden (empty)
(Reporter)

Comment 1

6 years ago
Created attachment 559956 [details] [diff] [review]
Create invalid cairo surfaces instead of null pointers when possible.
Attachment #559956 - Flags: review?(jmuizelaar)
(Reporter)

Updated

6 years ago
Blocks: 564231
Comment on attachment 559956 [details] [diff] [review]
Create invalid cairo surfaces instead of null pointers when possible.

It's not crystal clear that this is an improvement but feels like it's in the right direction.

The added white space changes make me a little sad

>@@ -83,27 +88,29 @@
> {
>     mCGContext = cairo_quartz_surface_get_cg_context (csurf);
>     CGContextRetain (mCGContext);
> 
>     Init(csurf, PR_TRUE);
> }
> 
> gfxQuartzSurface::gfxQuartzSurface(unsigned char *data,
>-                                   const gfxSize& size,
>+                                   const gfxSize& realSize,
>                                    long stride,
>                                    gfxImageFormat format,
>                                    PRBool aForPrinting)

Why realSize?

>-    : mCGContext(nsnull), mSize(size), mForPrinting(aForPrinting)
>+    : mCGContext(nsnull), mSize(realSize), mForPrinting(aForPrinting)
> {
>-    unsigned int width = (unsigned int) floor(size.width);
>-    unsigned int height = (unsigned int) floor(size.height);
>+    gfxIntSize size((unsigned int) floor(realSize.width),
>+                    (unsigned int) floor(realSize.height));
>+    if (!CheckSurfaceSize(size))
>+        MakeInvalid();
> 
>-    if (!CheckSurfaceSize(gfxIntSize(width, height)))
>-        return;
>+    unsigned int width = (unsigned int) floor(mSize.width);
>+    unsigned int height = (unsigned int) floor(mSize.height);

We shouldn't need to floor mSize

> # Animated gifs with a very large canvas, but tiny actual content.
>-asserts(2) load delaytest.html?523528-1.gif # Bug 564231
>+load delaytest.html?523528-1.gif

Yay!
Attachment #559956 - Flags: review?(jmuizelaar) → review+
(Reporter)

Comment 3

6 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/02ae1f7047eb
Target Milestone: --- → mozilla10
Version: unspecified → Trunk
https://hg.mozilla.org/mozilla-central/rev/02ae1f7047eb
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.