Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(940)

Unified Diff: bower_components/gif.js/site/contents/tests/canvas.coffee

Issue 786953007: npm_modules: Fork bower_components into Polymer 0.4.0 and 0.5.0 versions (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 5 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: bower_components/gif.js/site/contents/tests/canvas.coffee
diff --git a/bower_components/gif.js/site/contents/tests/canvas.coffee b/bower_components/gif.js/site/contents/tests/canvas.coffee
deleted file mode 100644
index f02abe24f59c8b356557cc85fbbf51ff1b1c76a0..0000000000000000000000000000000000000000
--- a/bower_components/gif.js/site/contents/tests/canvas.coffee
+++ /dev/null
@@ -1,65 +0,0 @@
-require '../scripts/vendor/mootools.js'
-ready = require '../scripts/vendor/ready.js'
-
-num_frames = 20
-width = 600
-height = 300
-text = 'HYPNO TOAD'
-textSize = 70
-
-now = window.performance?.now?.bind(window.performance) or Date.now
-
-rgb = (rgb...) -> "rgb(#{ rgb.map((v) -> Math.floor(v * 255)).join(',') })"
-hsl = (hsl...) ->
- hsl = hsl.map (v, i) -> if i is 0 then v * 360 else "#{ v * 100 }%"
- return "hsl(#{ hsl.join(',') })"
-
-ready ->
- canvas = document.createElement 'canvas'
- canvas.width = width
- canvas.height = height
-
- startTime = null
- ctx = canvas.getContext '2d'
- info = document.id 'info'
-
- gif = new GIF
- workers: 4
- workerScript: '/gif.js/gif.worker.js'
- width: width
- height: height
-
- gif.on 'start', -> startTime = now()
-
- gif.on 'progress', (p) -> info.set 'text', Math.round(p * 100)+'%'
-
- gif.on 'finished', (blob) ->
- img = document.id 'result'
- img.src = URL.createObjectURL(blob)
- delta = now() - startTime
- info.set 'text', """
- 100%
- #{ (delta / 1000).toFixed 2 }sec
- #{ (blob.size / 1000).toFixed 2 }kb
- """
-
- ctx.font = "bold #{ textSize }px Helvetica"
- ctx.textAlign = 'center'
- ctx.textBaseline = 'middle'
- ctx.lineWidth = 3
- w2 = width / 2
- h2 = height / 2
- for i in [0...num_frames]
- p = i / (num_frames - 1)
- grad = ctx.createRadialGradient w2, h2, 0, w2, h2, w2
- grad.addColorStop 0, hsl p, 1, 0.5
- grad.addColorStop 1, hsl (p + 0.2) % 1, 1, 0.4
- ctx.fillStyle = grad
- ctx.fillRect 0, 0, width, height
- ctx.fillStyle = hsl (p + 0.5) % 1, 1, 0.7
- ctx.strokeStyle = hsl (p + 0.8) % 1, 1, 0.9
- ctx.fillText text, w2, h2
- ctx.strokeText text, w2, h2
- gif.addFrame ctx, {copy: true, delay: 20}
-
- gif.render()
« no previous file with comments | « bower_components/gif.js/site/contents/styles/vendor/reset.less ('k') | bower_components/gif.js/site/contents/tests/canvas.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698