Skip to content

Commit

Permalink
Bump traceviewer to master
Browse files Browse the repository at this point in the history
commit 4959b8b832af4f0d91cf1b2bc9bed10fbcccad2e
Author: sullivan <[email protected]>
Date:   Fri Sep 30 11:08:20 2016 -0700
  • Loading branch information
paulirish committed Sep 30, 2016
1 parent c8d0b9c commit ceb56c6
Show file tree
Hide file tree
Showing 23 changed files with 698 additions and 349 deletions.
4 changes: 2 additions & 2 deletions lighthouse-core/third_party/traceviewer-js/base/color.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ global.tr.exportTo('tr.b', function() {
this.a);
},

lighten: function(k, opt_max_l) {
var max_l = opt_max_l !== undefined ? opt_max_l : 1.0;
lighten: function(k, opt_maxL) {
var maxL = opt_maxL !== undefined ? opt_maxL : 1.0;
var hsl = this.toHSL();
hsl.l = clamp01(hsl.l + k);
return Color.fromHSL(hsl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ global.tr.exportTo('tr.b', function() {

heap_dump_stack_frame: new tr.b.Color(128, 128, 128),
heap_dump_object_type: new tr.b.Color(0, 0, 255),
heap_dump_child_node_arrow: new tr.b.Color(204, 102, 0),

cq_build_running: new tr.b.Color(255, 255, 119),
cq_build_passed: new tr.b.Color(153, 238, 102),
Expand Down
26 changes: 13 additions & 13 deletions lighthouse-core/third_party/traceviewer-js/base/math.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ global.tr.exportTo('tr.b', function() {
return sign * y;
}

var tmp_vec2 = vec2.create();
var tmp_vec2b = vec2.create();
var tmp_vec4 = vec4.create();
var tmp_mat2d = mat2d.create();
var tmpVec2 = vec2.create();
var tmpVec2b = vec2.create();
var tmpVec4 = vec4.create();
var tmpMat2d = mat2d.create();

vec2.createFromArray = function(arr) {
if (arr.length != 2)
Expand All @@ -108,9 +108,9 @@ global.tr.exportTo('tr.b', function() {

vec2.addTwoScaledUnitVectors = function(out, u1, scale1, u2, scale2) {
// out = u1 * scale1 + u2 * scale2
vec2.scale(tmp_vec2, u1, scale1);
vec2.scale(tmp_vec2b, u2, scale2);
vec2.add(out, tmp_vec2, tmp_vec2b);
vec2.scale(tmpVec2, u1, scale1);
vec2.scale(tmpVec2b, u2, scale2);
vec2.add(out, tmpVec2, tmpVec2b);
};

vec2.interpolatePiecewiseFunction = function(points, x) {
Expand All @@ -136,13 +136,13 @@ global.tr.exportTo('tr.b', function() {
};

mat2d.translateXY = function(out, x, y) {
vec2.set(tmp_vec2, x, y);
mat2d.translate(out, out, tmp_vec2);
vec2.set(tmpVec2, x, y);
mat2d.translate(out, out, tmpVec2);
};

mat2d.scaleXY = function(out, x, y) {
vec2.set(tmp_vec2, x, y);
mat2d.scale(out, out, tmp_vec2);
vec2.set(tmpVec2, x, y);
mat2d.scale(out, out, tmpVec2);
};

vec4.unitize = function(out, a) {
Expand All @@ -154,8 +154,8 @@ global.tr.exportTo('tr.b', function() {
};

vec2.copyFromVec4 = function(out, a) {
vec4.unitize(tmp_vec4, a);
vec2.copy(out, tmp_vec4);
vec4.unitize(tmpVec4, a);
vec2.copy(out, tmpVec4);
};

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,26 +136,37 @@ global.tr.exportTo('tr.b', function() {
}

asDict() {
return {
mean: this.mean,
meanlogs: this.meanlogs_,
count: this.count,
max: this.max,
min: this.min,
sum: this.sum,
variance: this.variance_
};
if (!this.count) {
return [];
}
// It's more efficient to serialize these fields in an array. If you
// add any other fields, you should re-evaluate whether it would be more
// efficient to serialize as a dict.
return [
this.count_,
this.max_,
this.meanlogs_,
this.mean_,
this.min_,
this.sum_,
this.variance_,
];
}

static fromDict(d) {
static fromDict(dict) {
var result = new RunningStatistics();
result.mean_ = d.mean;
result.count_ = d.count;
result.max_ = d.max;
result.min_ = d.min;
result.sum_ = d.sum;
result.variance_ = d.variance;
result.meanlogs_ = d.meanlogs;
if (dict.length != 7) {
return result;
}
[
result.count_,
result.max_,
result.meanlogs_,
result.mean_,
result.min_,
result.sum_,
result.variance_,
] = dict;
return result;
}
}
Expand Down
Loading

0 comments on commit ceb56c6

Please sign in to comment.