Bug 14129

Summary: [CAIRO] Support the canvas element
Product: WebKit Reporter: Alp Toker <alp>
Component: New BugsAssignee: Alp Toker <alp>
Status: RESOLVED FIXED    
Severity: Normal Keywords: Gtk
Priority: P2    
Version: 523.x (Safari 3)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Initial work on Cairo canvas support
none
Cairo canvas support
none
Cairo canvas support eric: review+

Description Alp Toker 2007-06-13 16:21:50 PDT
A brief look at CanvasRenderingContext2D suggests this can be done in a couple of steps. First we need to add basic Cairo fill/stroke and possibly image support. Gradient support will require some abstraction and further work (for which #13312 may provide inspiration).

It seems that unlike most of the WebKit porting layer, CanvasRenderingContext2D porting is simply done with inline conditional macros.
Comment 1 Alp Toker 2007-09-11 09:52:47 PDT
Created attachment 16258 [details]
Initial work on Cairo canvas support

This is not particularly complete, but eg. canvas painter mostly works (http://caimansys.com/painter/).

Thoughts and improvements welcome.
Comment 2 Alp Toker 2007-09-11 13:56:22 PDT
Created attachment 16261 [details]
Cairo canvas support

Now renders canvas content in the correct position.
Memory leak fixed.
Comment 3 Alp Toker 2007-10-03 01:54:20 PDT
Created attachment 16514 [details]
Cairo canvas support

Not complete, but works quite well. There are a few FIXMEs and CanvasPattern is not yet implemented, but it may make sense to get this landed soon so the patch doesn't become obsolete every time the QT port is tweaked.

(No ChangeLog entry just yet)
Comment 4 Eric Seidel (no email) 2007-10-03 09:46:34 PDT
Comment on attachment 16514 [details]
Cairo canvas support

Ick.  The code looks fine.  The only problem is see is that this makes Canvas code even uglier (as now there is a 3-way ifdef.  Canvas needs to be taught to use platform dependent support classes, and the platform independent bits should then have all the #ifdef'd code removed.

I mentioned some needless comments on IRC.  Please remove those, then feel free to land.
Comment 5 Alp Toker 2007-10-03 10:35:34 PDT
Fixed in r26021