[Webkit-unassigned] [Bug 57717] Convert use of raw pointers to RefPtr in using Cairo

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Apr 7 07:56:50 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=57717





--- Comment #15 from Martin Robinson <mrobinson at webkit.org>  2011-04-07 07:56:49 PST ---
(From update of attachment 88561)
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.

> 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?

> 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!

> 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.

> Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp:171
> -    cairo_t* shadowContext = shadow->beginShadowLayer(context, solidFigureExtents);
> -    if (!shadowContext)
> +    RefPtr<cairo_t> shadowContext = shadow->beginShadowLayer(context, solidFigureExtents);
> +    if (!shadowContext.get())

Ditto. I don't think it adds anything here.

> Source/WebCore/platform/graphics/cairo/ImageCairo.cpp:143
>      if (shadow->m_type != ContextShadow::NoShadow) {
> -        cairo_t* shadowContext = shadow->beginShadowLayer(context, dstRect);
> +        RefPtr<cairo_t> shadowContext = shadow->beginShadowLayer(context, dstRect);
>          if (shadowContext) {

Ditto.

> Source/WebCore/platform/graphics/gtk/FontGtk.cpp:248
> -    cairo_t* shadowContext = shadow->beginShadowLayer(graphicsContext, extents);
> +    RefPtr<cairo_t> shadowContext = shadow->beginShadowLayer(graphicsContext, extents);

Ditto.

-- 
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