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)
Tracking
()
RESOLVED
FIXED
mozilla10
People
(Reporter: jdm, Unassigned)
References
Details
Attachments
(1 file)
|
12.16 KB,
patch
|
jrmuizel
:
review+
|
Details | Diff | Splinter Review |
No description provided.
| Reporter | ||
Comment 1•14 years ago
|
||
Attachment #559956 -
Flags: review?(jmuizelaar)
Comment 2•14 years ago
|
||
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•14 years ago
|
||
Target Milestone: --- → mozilla10
Version: unspecified → Trunk
Comment 4•14 years ago
|
||
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.
Description
•