README 4.2 KB

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