szeged/methanol — pull request #2 by kuii (2012-10-31 04:38:40+00:00)
Title: Add collect/show FPS in engine and a little css/canvas benchmarks

Hi master,
Add collecting/showing FPS functions in engine for Canvas benchmarking.
How to get fps?
1. Collect fps using canvas/engines/FPSUtil, samples=50
2. Get average FPS in intoxicate.js, then send to engine.js in message.
3. Show fps results in engine.js

Following are changes:
* intoxicate.js
- Remove structure message. Get result (Date().getTime()-methanol_frame_start) in intoxicate.js directly. then send msg.
- In this way, we can unify message proc API in engine.js.
* engine.js
- add var methanol_benchmark_name that identify fps test or page-loading test
- add function methanol_show_fps() that show fps results.
- remove var methanol_builtin_ignition, do we need it?
* intoxicate-fps.js
- create intoxicate-fps.js that get average FPS then send to engine.js in message.
- this file needs to be included into index.html of canvas test sites
* README
- update

I also added a little canvas and css benchmarks that can be used to test new fps engine.
Canvas benchmarks:
* fire-canvas.html
* canvas.js
* canvas/
|- engines
# utils.js: add function getRandom (min, max), FPSUtil(), window.requestAnimFrame()
|-feature_based/
# canvas_draw_arc.html: draw 300 arcs per frame with random angle.
# canvas_draw_bezier.html: fill/stroke many bezier flowers per frame
# canvas_draw_line.html: draw many lines with different stroking styles per frame.

CSS benchmarks:
* fire-css.html
* css.js
* css/
|- css_filters
# css_filter_blur.html
# css_filter_brightness.html
# css_filter_dropshadow.html
|-feature_based/
# css_border_image.html
# css_border_radius.html
# css_box_shadow.html

pls help to review, thank you very much