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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/perf_ui/FlameChart.js

Issue 2746153005: DevTools: move flow events tracking to TracingModel, support cross-threads case (Closed)
Patch Set: fixed infinite chains of flow events Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 /** 1 /**
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 _drawFlowEvents(context, width, height) { 950 _drawFlowEvents(context, width, height) {
951 context.save(); 951 context.save();
952 var ratio = window.devicePixelRatio; 952 var ratio = window.devicePixelRatio;
953 var top = this.getScrollOffset(); 953 var top = this.getScrollOffset();
954 var arrowWidth = 6; 954 var arrowWidth = 6;
955 context.scale(ratio, ratio); 955 context.scale(ratio, ratio);
956 context.translate(0, -top); 956 context.translate(0, -top);
957 957
958 context.fillStyle = '#7f5050'; 958 context.fillStyle = '#7f5050';
959 context.strokeStyle = '#7f5050'; 959 context.strokeStyle = '#7f5050';
960 context.lineWidth = 0.5;
961
960 var td = this._timelineData(); 962 var td = this._timelineData();
961 var endIndex = td.flowStartTimes.lowerBound(this._timeWindowRight); 963 for (var i = 0; i < td.flowStartTimes.length && td.flowStartTimes[i] < this. _timeWindowRight; ++i) {
962
963 context.lineWidth = 0.5;
964 for (var i = 0; i < endIndex; ++i) {
965 if (!td.flowEndTimes[i] || td.flowEndTimes[i] < this._timeWindowLeft) 964 if (!td.flowEndTimes[i] || td.flowEndTimes[i] < this._timeWindowLeft)
966 continue; 965 continue;
967 var startX = this._timeToPosition(td.flowStartTimes[i]); 966 var startX = this._timeToPosition(td.flowStartTimes[i]);
968 var endX = this._timeToPosition(td.flowEndTimes[i]); 967 var endX = this._timeToPosition(td.flowEndTimes[i]);
969 var startY = this._levelToHeight(td.flowStartLevels[i]) + this._barHeight / 2; 968 var startY = this._levelToHeight(td.flowStartLevels[i]) + this._barHeight / 2;
970 var endY = this._levelToHeight(td.flowEndLevels[i]) + this._barHeight / 2; 969 var endY = this._levelToHeight(td.flowEndLevels[i]) + this._barHeight / 2;
971 970
972
973 var segment = Math.min((endX - startX) / 4, 40); 971 var segment = Math.min((endX - startX) / 4, 40);
974 var distanceTime = td.flowEndTimes[i] - td.flowStartTimes[i]; 972 var distanceTime = td.flowEndTimes[i] - td.flowStartTimes[i];
975 var distanceY = (endY - startY) / 10; 973 var distanceY = (endY - startY) / 10;
976 var spread = 30; 974 var spread = 30;
977 var lineY = distanceTime < 1 ? startY : spread + Math.max(0, startY + dist anceY * (i % spread)); 975 var lineY = distanceTime < 1 ? startY : spread + Math.max(0, startY + dist anceY * (i % spread));
978 976
979 var p = []; 977 var p = [];
980 p.push({x: startX, y: startY}); 978 p.push({x: startX, y: startY});
981 p.push({x: startX + arrowWidth, y: startY}); 979 p.push({x: startX + arrowWidth, y: startY});
982 p.push({x: startX + segment + 2 * arrowWidth, y: startY}); 980 p.push({x: startX + segment + 2 * arrowWidth, y: startY});
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
1601 } 1599 }
1602 1600
1603 /** 1601 /**
1604 * @override 1602 * @override
1605 * @return {number} 1603 * @return {number}
1606 */ 1604 */
1607 boundarySpan() { 1605 boundarySpan() {
1608 return this._maximumBoundaries - this._minimumBoundaries; 1606 return this._maximumBoundaries - this._minimumBoundaries;
1609 } 1607 }
1610 }; 1608 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698