diff options
Diffstat (limited to 'chromium/third_party/skia/experimental/SkV8Example/speed.js')
-rw-r--r-- | chromium/third_party/skia/experimental/SkV8Example/speed.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/chromium/third_party/skia/experimental/SkV8Example/speed.js b/chromium/third_party/skia/experimental/SkV8Example/speed.js new file mode 100644 index 00000000000..5b0f0013546 --- /dev/null +++ b/chromium/third_party/skia/experimental/SkV8Example/speed.js @@ -0,0 +1,23 @@ +/** + * @fileoverview Sample onDraw script for use with SkV8Example. + */ +var onDraw = function(){ + var tick = 0; + function f(canvas) { + tick += 0.1; + canvas.fillStyle = '#0000ff'; + canvas.fillRect(100, 100, Math.sin(tick)*100, Math.cos(tick)*100); + inval(); + }; + + function onTimeout() { + print(tick*10, " FPS"); + setTimeout(onTimeout, 1000); + tick=0; + } + + setTimeout(onTimeout, 1000); + + return f; +}(); + |