Bug 67577

Summary: Enable use of Cairo backend on platforms other than GTK
Product: WebKit Reporter: Robin Dunn <robin>
Component: WebKit wxAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: kevino, mrobinson
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
cairo backend patch kevino: review+

Description Robin Dunn 2011-09-04 08:01:14 PDT
Created attachment 106286 [details]
cairo backend patch

Enable wxWebKit to run using the wxGC Cairo backend on platforms other than GTK.
Comment 1 Kevin Ollivier 2011-09-04 09:48:36 PDT
Landed in r94501, thanks!
Comment 2 Martin Robinson 2011-09-11 18:23:09 PDT
Comment on attachment 106286 [details]
cairo backend patch

View in context: https://bugs.webkit.org/attachment.cgi?id=106286&action=review

> Source/WebCore/platform/graphics/GlyphBuffer.h:54
> +#if USE(CAIRO) || (PLATFORM(WX) && defined(wxUSE_CAIRO) && wxUSE_CAIRO)

For this file, I think it would be much better to just ensure that Wx has the proper WTF flag defined so that USE(CAIRO) works. If it doesn't, things might break in the future.
Comment 3 Kevin Ollivier 2011-09-11 19:21:04 PDT
(In reply to comment #2)
> (From update of attachment 106286 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=106286&action=review
> 
> > Source/WebCore/platform/graphics/GlyphBuffer.h:54
> > +#if USE(CAIRO) || (PLATFORM(WX) && defined(wxUSE_CAIRO) && wxUSE_CAIRO)
> 
> For this file, I think it would be much better to just ensure that Wx has the proper WTF flag defined so that USE(CAIRO) works. If it doesn't, things might break in the future.

The flags are not indicating the same thing, though. That is, USE(CAIRO) != wxUSE_CAIRO

wxUSE_CAIRO indicates that wx's wxGraphicsContext API is using Cairo internally to draw. wxWebKit's drawing code is implemented in terms of wxGraphicsContext, not the WebKit Cairo rendering backend. (and wxGraphicsContext is not always using Cairo, either.) While wx is using Cairo internally, there are a couple spots where wx doesn't support what we need to do, and so in those cases we share some code with the native Cairo port, but it's a very small amount of what USE(CAIRO) actually defines and uses.

Making USE(CAIRO) work would be a significant project for the wx port and will actually break a lot of things.
Comment 4 Martin Robinson 2011-09-11 21:29:42 PDT
(In reply to comment #3)

> wxUSE_CAIRO indicates that wx's wxGraphicsContext API is using Cairo internally to draw. wxWebKit's drawing code is implemented in terms of wxGraphicsContext, not the WebKit Cairo rendering backend. (and wxGraphicsContext is not always using Cairo, either.) While wx is using Cairo internally, there are a couple spots where wx doesn't support what we need to do, and so in those cases we share some code with the native Cairo port, but it's a very small amount of what USE(CAIRO) actually defines and uses.

Thanks for the clarification! You might consider collapsing this logic into a flag that's more explanatory like WX_USES_CAIRO.