[Webkit-unassigned] [Bug 57717] Convert use of raw pointers to RefPtr in using Cairo
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Apr 8 10:26:00 PDT 2011
https://bugs.webkit.org/show_bug.cgi?id=57717
--- Comment #16 from Joone Hur <joone.hur at collabora.co.uk> 2011-04-08 10:25:59 PST ---
(In reply to comment #15)
> (From update of attachment 88561 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=88561&action=review
>
> > Source/WebCore/platform/graphics/ContextShadow.h:38
> > +#if PLATFORM(CAIRO)
> > +#include "RefPtrCairo.h"
> > +#endif
> > +
>
> Please move this to a separate block with a newline between the first block of includes and this one.
>
I will fix it.
> > Source/WebCore/platform/graphics/ContextShadow.h:57
> > +typedef RefPtr<cairo_surface_t> PlatformImage;
>
> We don't need to take a reference to the m_layerImage, so maybe it makes sense to just leave this as a cairo_surface_t. What do you think?
>
I agree. m_layerImage just takes a static pointer of cairo_surface_t, so we don't need to mange the reference count.
> > Source/WebCore/platform/graphics/cairo/CairoPath.h:34
> > + static RefPtr<cairo_surface_t> pathSurface = adoptRef(cairo_image_surface_create(CAIRO_FORMAT_A8, 1, 1));
>
> Ack! I didn't realize this was static. Please revert this line. Sorry!
>
That's ok.
> > Source/WebCore/platform/graphics/cairo/FontCairo.cpp:95
> > + RefPtr<cairo_t> shadowContext = shadow->beginShadowLayer(graphicsContext, fontExtentsRect);
> > + if (shadowContext.get()) {
> > + prepareContextForGlyphDrawing(shadowContext.get(), font, point);
> > + drawGlyphsToContext(shadowContext.get(), font, glyphs, numGlyphs);
> > shadow->endShadowLayer(graphicsContext);
>
> I don't think you should use RefPtr here since you don't want to take a reference.
>
However, beginShadowLayer returns RefPtr<cairo_t>, so I need to use RefPtr here.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list