W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2010

[whatwg] fxCanvas 0.2 and some remarks about canvas spec

From: Evgeny Burzak <buzzilo@gmail.com>
Date: Tue, 16 Nov 2010 08:38:26 +0300
Message-ID: <AANLkTindcQ01qFXDMz91dQKg=h3cdmmdw5_eQT5jmCGX@mail.gmail.com>
2010/11/15 Samuel Ytterbrink <samuel at ytterbrink.nu>:
> hmm... Can you explain the path-object more in detail. It sounds
> interesting... but why shouldn't i just create a function that takes a
> context and do the same path commands on it instead of having a context
> taking a path object?
>

In case of >1000 path nodes , path object may save good portion of
time due to caching mechanism.
Inside  IExplorer, path is serialized  so that , I can drawing even
complicated curves without a hung.

And technical details:
CanvasPath instance has all canvas path drawings methods , plus:

append(<path object>)
clone()
push(<segment>)
pop()

Path segment is just an array, for ex. ["moveTo", [0,0]].

In current version nodes are saved in _stack property, but i think
CanvasPath should be special array, so that i can get n-th segment as
path[n].

Related methods in canvas context:

beginPath() - is created new path object inside context
createPath() - creates and returns path obj instance
appendPath() - appends to the current path
clonePath() - clones and returns path obj

Evgeny
Received on Monday, 15 November 2010 21:38:26 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:28 UTC