[Webkit-unassigned] [Bug 17336] Update WinCairo WebKit with Font/Text Support

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 13 10:44:02 PST 2008


http://bugs.webkit.org/show_bug.cgi?id=17336


alp at atoker.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alp at atoker.com




------- Comment #2 from alp at atoker.com  2008-02-13 10:44 PDT -------
(In reply to comment #1)
> Created an attachment (id=19102)
 --> (http://bugs.webkit.org/attachment.cgi?id=19102&action=view) [edit]
> Patch to add font support to Cairo/Win backend.
> 

I didn't have the chance to look over this fully yet.


Some things I spotted:

+        static cairo_font_options_t* fontOptions;
+        if (!fontOptions)
+           fontOptions = cairo_font_options_create();

^ Uninitialised variable, this will break in release builds. You should be fine
with just:

static cairo_font_options_t* fontOptions = cairo_font_options_create();

or you could keep the logic (it'll become useful later when Win implements
central font options) and assign 0.



+#if PLATFORM(CG)
         CGContextSaveGState(pctx);

         IntRect printRect = printerRect(printDC);
@@ -2740,6 +2741,9 @@ HRESULT STDMETHODCALLTYPE WebFrame::spoo

         CGContextEndPage(pctx);
         CGContextRestoreGState(pctx);
+#else
+        notImplemented();
+#endif


^ I'm already working on printing abstraction, so it's good that you just
stubbed it out and didn't try to implement it.



The rename of cgFont() to platformFont() is a clever shortcut, I like that :-)




+#if PLATFORM(CG)
 typedef struct CGColor* CGColorRef;
-typedef struct CGContext* CGContextRef;
+typedef struct CGContext* ContextRef;
+typedef const CGColorRef ColorRef;
+#elif PLATFORM(CAIRO)
+#include "GraphicsContext.h"
+typedef WebCore::GraphicsContext* ContextRef;
+typedef const WebCore::Color* ColorRef;
+#endif

^ I'd just do #else here, though it doesn't matter much.



I think there are a few more worthwhile code sharing opportunities here before,
but didn't study the split closely enough to be sure yet.


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list