1 -------------------------------------------------------------------------------
3 -------------------------------------------------------------------------------
5 Release date: 08/01/2006
6 -------------------------------------------------------------------------------
9 HTMLCanvas renderer: experimental
10 -------------------------------------------------------------------------------
12 Eugene Lazutkin (eugene.lazutkin@gmail.com)
13 Kun Xi (bookstack@gmail.com)
14 Chris Mitchell (ccmitchellusa@gmail.com) HTML Canvas
15 -------------------------------------------------------------------------------
18 Implementation of simple portable 2D graphics library.
19 -------------------------------------------------------------------------------
23 -------------------------------------------------------------------------------
26 Currently it can be found here: http://docs.google.com/Doc?id=d764479_1hnb2tn
28 HTMLCanvas Renderer Status
30 To use canvas rendering, insert 'canvas' at the beginning of the gfxRenderers list in your
31 djConfig, for example:
32 <script type="text/javascript" src="../../../dojo/dojo.js"
33 djConfig="parseOnLoad: true, gfxRenderer: 'canvas,svg,silverlight,vml'"></script>
34 canvas currently will only render on non-IE browsers (see dojox/gfx.js for where the renderer is loaded);
35 although it should be possible to use an IE canvas implementation (like Google's); however, it will be very slow.
37 The following tests can be made to work with HTML Canvas with minor testcase modification:
44 test_linearGradient.html
45 test_image1.html - Limitation #3
46 test_transform.html - Bug #1
47 test_poly.html - Bug #1
49 butterfly.html - Bug #1
52 circles.html - No event processing yet :(
55 test_pie2d.html - Dojo Charts on iPhone anyone? :)
58 // To make charts work, the following line needs to be added to the end of the
59 // Chart2D.js render() method (prior to return)
60 if(this.surface.render){this.surface.render()};
63 1) event handling- plan is to capture all events at canvas, perform intersect/hit
64 tests (not implemented) against scene graph, then propogate event to top-most
65 intersected shape. HtmlCanvas shape need intersectsStroke and intersectsBounds,
66 and intersects (region).
67 2) SVG and VML are "live" scene graphs; eg. any state change to objects in the
68 scene automatically get rendered in next engine render pass. For canvas, it's
69 procedural, and current implementation requires application to call surface.render()
70 whenever scene needs to be updated. Plan is to do dirty region checking based
71 on bounding boxes (currently not properly computed), and track dirty areas anytime
72 state changes (invalidate) separate from render phase.
73 Add the following call where changes to the scene graph are complete and you want to
76 if (surface.render){surface.render();}
78 4) Text/Text Paths - Text shape is implemented using DIV overlays. Many text styles are not
79 applied, and outline/fills are not possible. This is due to limitations in Canvas spec.
80 Firefox 3.0 has proprietary text functions that we could test for and use once FF3 is out.
82 3) No Image skewing - Limitation of Canvas
85 1) Matrix xformations (applied from root to shape leaf nodes) not quite right--but very close.
86 Canvas does not have a built in transformation function that allows skewing. Need to
87 track skew matrix with Shape, and perform other trans/rot/scale transformations without
88 using canvas transform functions.
91 -------------------------------------------------------------------------------
92 Installation instructions
94 Grab the following from the Dojo SVN Repository:
95 http://svn.dojotoolkit.org/var/src/dojo/dojox/trunk/gfx.js
96 http://svn.dojotoolkit.org/var/src/dojo/dojox/trunk/gfx/*
98 Install into the following directory structure:
101 ...which should be at the same level as your Dojo checkout.
102 -------------------------------------------------------------------------------