[dojo-contributors] Re: Draft: Unified 2D graphics subsystem for Dojo

Tom Trenka ttrenka at gmail.com
Mon Jun 5 15:21:08 EDT 2006


So in re-reading the proposal, I've a few more definite comments...and one
inspired by Bob's reply here.

1st thing, foremost--instead of emulating existing APIs, perhaps we should
try something a little different--maybe a more functional approach.  For
instance, we could have the Path functions return a reference to a path
object, so that we could draw something in one fell swoop, like so:

surface.beginPath().moveTo(1,1).lineTo(20,20).closePath().end();

...which looks more complex but is kind of in keeping with some of the
coding style trends we've been using with Dojo (thinking about Deferred
here, but other things as well).

Another overall comment I'd make is that we should probably try to use named
argument objects more (similar to the way dojo.io.bind works), particularly
when it comes to functions that require point coordinates. For instance:

surface.createLinearGradient({x:0,y:0},{x:20,y:20});

...that kind of thing.

Lastly, I'd advocate something like this for general audience usage, but I'd
recommend against it (unless there were a really good reason to) for any
widgets that Dojo releases itself that need to be high performance (and not
functioning as an example).  I'd think that the goal would be to bring
vector drawing, in a Dojo style, to the general audience but we (being the
Masters of the Universe(tm)) would take a tip from game development and go
as raw as possible.

trt

(otherwise it looks pretty good, we should compare it to the other spec
that's floating out there)

On 6/5/06, Bob Ippolito <bob at redivi.com> wrote:
>
>
> On Jun 5, 2006, at 10:55 AM, Eugene Lazutkin wrote:
>
> > Tom Trenka wrote:
> >> I'll look it over well today and post more commentary.  I do agree
> >> with the Canvas emulation approach (although I would consider
> >> going back to OpenGL and seeing if there's more we can do) but I
> >> would definitely like
> >
> > I still remember OpenGL reasonably well. What exactly caught your eye?
>
> The only thing I can think of is that Canvas forces you do do scale/
> translate/rotate separately where in OpenGL you can just use a matrix
> to do all three in one fell swoop. Because of this, affine transforms
> seem especially painful to do in Canvas.
>
> -bob
>
> _______________________________________________
> dojo-contributors mailing list
> dojo-contributors at dojotoolkit.org
> http://dojotoolkit.org/mailman/listinfo/dojo-contributors
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.dojotoolkit.org/pipermail/dojo-contributors/attachments/20060605/a78abc60/attachment.htm 


More information about the dojo-contributors mailing list