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 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 * @param {?string} text | 626 * @param {?string} text |
627 * @param {number} barX | 627 * @param {number} barX |
628 * @param {number} barY | 628 * @param {number} barY |
629 * @param {number} barWidth | 629 * @param {number} barWidth |
630 * @param {number} barHeight | 630 * @param {number} barHeight |
631 * @param {function(number):number} offsetToPosition | 631 * @param {function(number):number} offsetToPosition |
632 * @return {boolean} | 632 * @return {boolean} |
633 */ | 633 */ |
634 decorateEntry: function(entryIndex, context, text, barX, barY, barWidth, bar
Height, offsetToPosition) | 634 decorateEntry: function(entryIndex, context, text, barX, barY, barWidth, bar
Height, offsetToPosition) |
635 { | 635 { |
636 if (barWidth < 5) | 636 return false; |
637 return false; | |
638 | |
639 var record = this._records[entryIndex]; | |
640 var timelineData = this._timelineData; | |
641 | |
642 var category = WebInspector.TimelineUIUtils.styleForTimelineEvent(record
.name).category; | |
643 // Paint text using white color on dark background. | |
644 if (text) { | |
645 context.save(); | |
646 context.fillStyle = "white"; | |
647 context.shadowColor = "rgba(0, 0, 0, 0.1)"; | |
648 context.shadowOffsetX = 1; | |
649 context.shadowOffsetY = 1; | |
650 context.font = this._font; | |
651 context.fillText(text, barX + this.textPadding(), barY + barHeight -
this.textBaseline()); | |
652 context.restore(); | |
653 } | |
654 | |
655 if (this._model.bindings().eventWarning(record)) { | |
656 context.save(); | |
657 | |
658 context.rect(barX, barY, barWidth, this.barHeight()); | |
659 context.clip(); | |
660 | |
661 context.beginPath(); | |
662 context.fillStyle = "red"; | |
663 context.moveTo(barX + barWidth - 15, barY + 1); | |
664 context.lineTo(barX + barWidth - 1, barY + 1); | |
665 context.lineTo(barX + barWidth - 1, barY + 15); | |
666 context.fill(); | |
667 | |
668 context.restore(); | |
669 } | |
670 | |
671 return true; | |
672 }, | 637 }, |
673 | 638 |
674 /** | 639 /** |
675 * @param {number} entryIndex | 640 * @param {number} entryIndex |
676 * @return {boolean} | 641 * @return {boolean} |
677 */ | 642 */ |
678 forceDecoration: function(entryIndex) | 643 forceDecoration: function(entryIndex) |
679 { | 644 { |
680 var record = this._records[entryIndex]; | 645 return false; |
681 return !!this._model.bindings().eventWarning(record); | |
682 }, | 646 }, |
683 | 647 |
684 /** | 648 /** |
685 * @param {number} entryIndex | 649 * @param {number} entryIndex |
686 * @return {?{startTimeOffset: number, endTimeOffset: number}} | 650 * @return {?{startTimeOffset: number, endTimeOffset: number}} |
687 */ | 651 */ |
688 highlightTimeRange: function(entryIndex) | 652 highlightTimeRange: function(entryIndex) |
689 { | 653 { |
690 var record = this._records[entryIndex]; | 654 var record = this._records[entryIndex]; |
691 if (!record || this._isHeaderRecord(record)) | 655 if (!record || this._isHeaderRecord(record)) |
692 return null; | 656 return null; |
693 return { | 657 return { |
694 startTimeOffset: this._toTimelineTime(record.startTime - this._zeroT
ime), | 658 startTimeOffset: this._toTimelineTime(record.startTime - this._zeroT
ime), |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 _onEntrySelected: function(event) | 899 _onEntrySelected: function(event) |
936 { | 900 { |
937 var entryIndex = event.data; | 901 var entryIndex = event.data; |
938 var record = this._dataProvider._records[entryIndex]; | 902 var record = this._dataProvider._records[entryIndex]; |
939 if (record instanceof WebInspector.TimelineModel.Record) | 903 if (record instanceof WebInspector.TimelineModel.Record) |
940 this._delegate.select(WebInspector.TimelineSelection.fromRecord(reco
rd)); | 904 this._delegate.select(WebInspector.TimelineSelection.fromRecord(reco
rd)); |
941 }, | 905 }, |
942 | 906 |
943 __proto__: WebInspector.VBox.prototype | 907 __proto__: WebInspector.VBox.prototype |
944 } | 908 } |
OLD | NEW |