Closed
Bug 380757
Opened 17 years ago
Closed 17 years ago
Switch SVG filters to thebes
Categories
(Core :: SVG, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: tor, Unassigned)
References
Details
Attachments
(3 files)
22.66 KB,
patch
|
jwatt
:
review+
|
Details | Diff | Splinter Review |
22.66 KB,
patch
|
roc
:
superreview+
|
Details | Diff | Splinter Review |
22.72 KB,
patch
|
Details | Diff | Splinter Review |
No description provided.
Attachment #264888 -
Flags: review?(jwatt)
Comment 1•17 years ago
|
||
Comment on attachment 264888 [details] [diff] [review] remove direct cairo usage from filters >+ gfxContext ctx(targetSurface); >+ ctx.SetColor(gfxRGBA(NS_GET_R(floodColor) / 255.0, >+ NS_GET_G(floodColor) / 255.0, >+ NS_GET_B(floodColor) / 255.0, >+ NS_GET_A(floodColor) / 255.0 * floodOpacity)); >+ ctx.Rectangle(gfxRect(rect.x, rect.y, rect.width, rect.height)); Would be nice if there was a gfxRect ctor that took an nsRect as it's argument, but, oh well. >+already_AddRefed<gfxImageSurface> > nsSVGFilterInstance::GetImage() > { >- cairo_surface_t *surface = >- cairo_image_surface_create(CAIRO_FORMAT_ARGB32, mFilterResX, mFilterResY); >- >- if (surface && cairo_surface_status(surface)) { >- cairo_surface_destroy(surface); >+ nsRefPtr<gfxImageSurface> surface = >+ new gfxImageSurface(gfxIntSize(mFilterResX, mFilterResY), >+ gfxASurface::ImageFormatARGB32); >+ >+ if (surface && surface->Data()) { >+ gfxContext ctx(surface); >+ ctx.SetOperator(gfxContext::OPERATOR_CLEAR); >+ ctx.Paint(); >+ } else { > surface = nsnull; > } > >- return surface; >+ NS_IF_ADDREF(surface); >+ return surface.get(); I think it would be easier to read as: if (!(surface && surface->Data())) { return nsnull; }
Attachment #264888 -
Flags: review?(jwatt) → review+
Attachment #265544 -
Flags: superreview?(roc)
Comment on attachment 265544 [details] [diff] [review] adjust GetImage per comment + NS_ADDREF(surface); *aSurface = surface; Use *aSurface = nsnull; surface.swap(*aSurface); + NS_ADDREF(surface); + return surface.get(); Similarly, gfxImageSurface* surf = nsnull; surface.swap(surf); return surf;
Attachment #265544 -
Flags: superreview?(roc) → superreview+
Checked in.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Updated•17 years ago
|
Flags: in-testsuite-
You need to log in
before you can comment on or make changes to this bug.
Description
•