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

Unified Diff: LayoutTests/fast/workers/resources/scrub.js

Issue 474683003: Not for review - Rebase of crrev.com/62833003 Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 6 years, 2 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
« no previous file with comments | « LayoutTests/fast/workers/resources/scrub.html ('k') | LayoutTests/fast/workers/resources/snap.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/workers/resources/scrub.js
diff --git a/LayoutTests/fast/workers/resources/scrub.js b/LayoutTests/fast/workers/resources/scrub.js
new file mode 100644
index 0000000000000000000000000000000000000000..25760bd2a56b05b7d9455758308a1f6ac5cd5d33
--- /dev/null
+++ b/LayoutTests/fast/workers/resources/scrub.js
@@ -0,0 +1,34 @@
+(function(scope) {
+ 'use strict';
+
+ var tokens = null;
+ var transform = null;
+ var opacity = null;
+ var scroll = null;
+
+ // An extremely cheesy animation.
+ function tick(context) {
+ var seconds = context.timestamp / 1000.0;
+ var matrix = context.getMatrix(transform);
+ matrix.m14 = 200.0 + context.getScalar(scroll); //Math.sin(seconds);
+
+ console.log('tick');
+
+ context.setMatrix(transform, matrix);
+ context.setScalar(opacity, 0.5 + 0.5 * (Math.sin(seconds * 2.0)));
+ // context.setScalar(opacity, 0.5 + 0.05 * context.getScalar(scroll));
+ //context.setScalar(scroll, 200.0 + 100.0 * (Math.sin(seconds * 0.75)));
+
+ scope.teleportMessage(context, tick);
+ }
+
+ scope.onmessage = function(e) {
+ tokens = e.data;
+ transform = tokens[0];
+ opacity = tokens[1];
+ scroll = tokens[2];
+ var context = new TeleportContext(tokens);
+ scope.teleportMessage(context, tick);
+ };
+
+})(self);
« no previous file with comments | « LayoutTests/fast/workers/resources/scrub.html ('k') | LayoutTests/fast/workers/resources/snap.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698