[webkit-dev] Abstracting the canvas

Christopher Brichford chrisb at adobe.com
Wed Jan 23 09:52:59 PST 2008

I agree with Darin, it would be better to have the graphics code  
behind the GraphicsContext interface as much as possible.


On Jan 23, 2008, at 7:50 AM, Darin Adler wrote:

> On Jan 23, 2008, at 3:25 AM, Alp Toker wrote:
>> Oliver has proposed the first move in abstracting WebKit's canvas  
>> implementation as part of his putImageData patch:
>>  http://bugs.webkit.org/show_bug.cgi?id=16954
>> The strategy involves splitting functions out into  
>> CanvasRenderingContext2DCG, CanvasRenderingContext2DCairo, and  
>> possibly moving other parts into the respective GraphicsContext  
>> platform implementations.
>> I know others have also considered abstracting the canvas but no  
>> other approaches have yet been proposed, so I thought I'd give a  
>> heads up on the list.
>> If you're planning a different way to split canvas, now is a good  
>> time to propose it -- silence is acceptance.
> My proposal is to move everything into the platform/graphics  
> implementation; there should be no platform specific code in the  
> canvas class at all. There would be no separate functions per- 
> platform in the canvas rendering context or canvas object. We'd  
> create classes like Image and Pixmap that go along with  
> GraphicsContext and abstract everything needed by canvas.
> I was working on this a year or two ago, got about half way done,  
> and then dropped it. This was back when canvas had only a CG  
> implementation. Then others decided to port by adding more ifdefs  
> instead, which I found disappointing.
> I'd like to rework Oliver's patch to fit my preferred approach.
>     -- Darin
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo/webkit-dev

More information about the webkit-dev mailing list