Closed Bug 686453 Opened 14 years ago Closed 14 years ago

Ensure as many cairo surfaces are non-null as possible

Categories

(Core :: Graphics, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla10

People

(Reporter: jdm, Unassigned)

References

Details

Attachments

(1 file)

No description provided.
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+
Target Milestone: --- → mozilla10
Version: unspecified → Trunk
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: