[Webkit-unassigned] [Bug 55150] [Cairo] Better separate the concerns of GraphicsContextCairo

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 8 13:02:03 PST 2011


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





--- Comment #7 from Martin Robinson <mrobinson at webkit.org>  2011-03-08 13:02:03 PST ---
(In reply to comment #6)
> (From update of attachment 84821 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=84821&action=review

Thanks for the comments.

> Looks fine to me.  My only minor nit is that the repeated stanzas of code required to go from cairo_t* to GraphicsContext seem unattractive.

Many of them will go away over time as I move more code into PlatformContextCairo. 

> > Source/WebCore/platform/graphics/cairo/PathCairo.cpp:290
> > +        GraphicsContext gc(&platformContext);
> 
> Would a GraphicsContext constructor from cairo_t make sense here?  Seems inconvenient to have to create these temporaries if this is done in a lot of places.
> 
> > Source/WebCore/platform/graphics/cairo/PathCairo.cpp:316
> > +    GraphicsContext gc(&platformContext);
> 
> Ditto above...
> 
> > Source/WebCore/platform/graphics/win/ImageCairoWin.cpp:83
> > +    GraphicsContext gc(&platformContext);
> 
> Again, declaring a stack temporary just to convert to GraphicsContext.

There are a few options here. We can either allocate the PlatformContext on the stack like we do, or make the PlatformContext reference counted. I believe I attempted the reference counted approach at some point, but found it to be messier.

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