[Webkit-unassigned] [Bug 101883] [TexMap][Cairo] Accelerated compositing debug visuals

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Nov 14 14:37:29 PST 2012


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





--- Comment #10 from Helder Correia <helder.correia at nokia.com>  2012-11-14 14:39:16 PST ---
(In reply to comment #9)
> (From update of attachment 174259 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=174259&action=review
> 
> > Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp:357
> > +    // cairo_text_extents() requires a cairo_t, so dimensions need to be guesstimated.
> 
> no way of getting hold of that?

AFAIK no. We need the width and height to create the surface, which we need to create the context, which we need to use the text extents, which we need to create the surface in the first place. In Qt, QFontMetrics don't need a QPainter. There might be a way in Cairo, but I'm not aware of it. Of course I could create a separate context just for the purpose, but I think there's no point.

> > Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp:361
> > +    cairo_surface_t* surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height);
> 
> why not use RefPtr they work for cairo_surface_t! etc

I know, I chose to explicitly destroy it locally with no smart pointer allocation because its life cycle is pretty tiny and controlled.

> > Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp:363
> > +    cairo_surface_destroy(surface);
> 
> Is this safe here? cr stays valid?



More information about the webkit-unassigned mailing list