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

Unified Diff: LayoutTests/fast/workers/resources/parallax.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/jank.js ('k') | LayoutTests/fast/workers/resources/parallax1.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/workers/resources/parallax.js
diff --git a/LayoutTests/fast/workers/resources/parallax.js b/LayoutTests/fast/workers/resources/parallax.js
new file mode 100644
index 0000000000000000000000000000000000000000..f584620f82d8289674ce22989ac252531bf1e3a5
--- /dev/null
+++ b/LayoutTests/fast/workers/resources/parallax.js
@@ -0,0 +1,24 @@
+(function(scope) {
+ 'use strict';
+
+ var tokens = null;
+ var scroll = null;
+ var transform = null;
+
+ function tick(context) {
+ var seconds = context.timestamp / 1000.0;
+ var matrix = context.getMatrix(transform);
+ matrix.m42 = 0.5 * context.getScalar(scroll);
+ context.setMatrix(transform, matrix);
+ scope.teleportMessage(context, tick);
+ }
+
+ scope.onmessage = function(e) {
+ tokens = e.data;
+ scroll = tokens[0];
+ transform = tokens[1];
+ var context = new TeleportContext(tokens);
+ scope.teleportMessage(context, tick);
+ };
+
+})(self);
« no previous file with comments | « LayoutTests/fast/workers/resources/jank.js ('k') | LayoutTests/fast/workers/resources/parallax1.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698