| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 | 569 |
| 570 this._appendHeaderRecord("GPU"); | 570 this._appendHeaderRecord("GPU"); |
| 571 return this._timelineData; | 571 return this._timelineData; |
| 572 }, | 572 }, |
| 573 | 573 |
| 574 /** | 574 /** |
| 575 * @return {number} | 575 * @return {number} |
| 576 */ | 576 */ |
| 577 minimumBoundary: function() | 577 minimumBoundary: function() |
| 578 { | 578 { |
| 579 return this._toTimelineTime(this._minimumBoundary); | 579 return this._minimumBoundary; |
| 580 }, | 580 }, |
| 581 | 581 |
| 582 /** | 582 /** |
| 583 * @return {number} | 583 * @return {number} |
| 584 */ | 584 */ |
| 585 totalTime: function() | 585 totalTime: function() |
| 586 { | 586 { |
| 587 return this._toTimelineTime(this._timeSpan); | 587 return this._timeSpan; |
| 588 }, | 588 }, |
| 589 | 589 |
| 590 /** | 590 /** |
| 591 * @return {number} | 591 * @return {number} |
| 592 */ | 592 */ |
| 593 maxStackDepth: function() | 593 maxStackDepth: function() |
| 594 { | 594 { |
| 595 return this._currentLevel; | 595 return this._currentLevel; |
| 596 }, | 596 }, |
| 597 | 597 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 /** | 691 /** |
| 692 * @param {number} entryIndex | 692 * @param {number} entryIndex |
| 693 * @return {?{startTime: number, endTime: number}} | 693 * @return {?{startTime: number, endTime: number}} |
| 694 */ | 694 */ |
| 695 highlightTimeRange: function(entryIndex) | 695 highlightTimeRange: function(entryIndex) |
| 696 { | 696 { |
| 697 var event = this._entryEvents[entryIndex]; | 697 var event = this._entryEvents[entryIndex]; |
| 698 if (!event) | 698 if (!event) |
| 699 return null; | 699 return null; |
| 700 return { | 700 return { |
| 701 startTime: this._toTimelineTime(event.startTime), | 701 startTime: event.startTime, |
| 702 endTime: this._toTimelineTime(event.endTime) | 702 endTime: event.endTime |
| 703 } | 703 } |
| 704 }, | 704 }, |
| 705 | 705 |
| 706 /** | 706 /** |
| 707 * @return {number} | 707 * @return {number} |
| 708 */ | 708 */ |
| 709 paddingLeft: function() | 709 paddingLeft: function() |
| 710 { | 710 { |
| 711 return 0; | 711 return 0; |
| 712 }, | 712 }, |
| 713 | 713 |
| 714 /** | 714 /** |
| 715 * @param {number} entryIndex | 715 * @param {number} entryIndex |
| 716 * @return {!string} | 716 * @return {!string} |
| 717 */ | 717 */ |
| 718 textColor: function(entryIndex) | 718 textColor: function(entryIndex) |
| 719 { | 719 { |
| 720 return "white"; | 720 return "white"; |
| 721 }, | 721 }, |
| 722 | 722 |
| 723 /** | 723 /** |
| 724 * @param {string} title | 724 * @param {string} title |
| 725 */ | 725 */ |
| 726 _appendHeaderRecord: function(title) | 726 _appendHeaderRecord: function(title) |
| 727 { | 727 { |
| 728 var index = this._entryEvents.length; | 728 var index = this._entryEvents.length; |
| 729 this._entryIndexToTitle[index] = title; | 729 this._entryIndexToTitle[index] = title; |
| 730 this._entryEvents.push(null); | 730 this._entryEvents.push(null); |
| 731 this._timelineData.entryLevels[index] = this._currentLevel++; | 731 this._timelineData.entryLevels[index] = this._currentLevel++; |
| 732 this._timelineData.entryTotalTimes[index] = this._toTimelineTime(this._t
imeSpan); | 732 this._timelineData.entryTotalTimes[index] = this._timeSpan; |
| 733 this._timelineData.entryStartTimes[index] = this._toTimelineTime(this._m
inimumBoundary); | 733 this._timelineData.entryStartTimes[index] = this._minimumBoundary; |
| 734 }, | 734 }, |
| 735 | 735 |
| 736 /** | 736 /** |
| 737 * @param {!WebInspector.TracingModel.Event} event | 737 * @param {!WebInspector.TracingModel.Event} event |
| 738 */ | 738 */ |
| 739 _appendEvent: function(event) | 739 _appendEvent: function(event) |
| 740 { | 740 { |
| 741 var index = this._entryEvents.length; | 741 var index = this._entryEvents.length; |
| 742 this._entryEvents.push(event); | 742 this._entryEvents.push(event); |
| 743 this._timelineData.entryLevels[index] = this._currentLevel + event.level
; | 743 this._timelineData.entryLevels[index] = this._currentLevel + event.level
; |
| 744 this._timelineData.entryTotalTimes[index] = this._toTimelineTime(event.d
uration || 1000); | 744 this._timelineData.entryTotalTimes[index] = event.duration || 1; |
| 745 this._timelineData.entryStartTimes[index] = this._toTimelineTime(event.s
tartTime); | 745 this._timelineData.entryStartTimes[index] = event.startTime; |
| 746 }, | 746 }, |
| 747 | 747 |
| 748 /** | 748 /** |
| 749 * @param {number} time | |
| 750 * @return {number} | |
| 751 */ | |
| 752 _toTimelineTime: function(time) | |
| 753 { | |
| 754 return time / 1000; | |
| 755 }, | |
| 756 | |
| 757 /** | |
| 758 * @param {number} entryIndex | 749 * @param {number} entryIndex |
| 759 * @return {?WebInspector.TimelineSelection} | 750 * @return {?WebInspector.TimelineSelection} |
| 760 */ | 751 */ |
| 761 createSelection: function(entryIndex) | 752 createSelection: function(entryIndex) |
| 762 { | 753 { |
| 763 var event = this._entryEvents[entryIndex]; | 754 var event = this._entryEvents[entryIndex]; |
| 764 if (!event) | 755 if (!event) |
| 765 return null; | 756 return null; |
| 766 this._lastSelection = new WebInspector.TimelineFlameChart.Selection(WebI
nspector.TimelineSelection.fromTraceEvent(event), entryIndex); | 757 this._lastSelection = new WebInspector.TimelineFlameChart.Selection(WebI
nspector.TimelineSelection.fromTraceEvent(event), entryIndex); |
| 767 return this._lastSelection.timelineSelection; | 758 return this._lastSelection.timelineSelection; |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 980 * @param {number} entryIndex | 971 * @param {number} entryIndex |
| 981 * @return {?WebInspector.TimelineSelection} | 972 * @return {?WebInspector.TimelineSelection} |
| 982 */ | 973 */ |
| 983 createSelection: function(entryIndex) { }, | 974 createSelection: function(entryIndex) { }, |
| 984 /** | 975 /** |
| 985 * @param {?WebInspector.TimelineSelection} selection | 976 * @param {?WebInspector.TimelineSelection} selection |
| 986 * @return {number} | 977 * @return {number} |
| 987 */ | 978 */ |
| 988 entryIndexForSelection: function(selection) { } | 979 entryIndexForSelection: function(selection) { } |
| 989 } | 980 } |
| OLD | NEW |