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

Side by Side Diff: Source/devtools/front_end/FlameChart.js

Issue 235913011: DevTools: fix rendering of markers on flame chart (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 context.beginPath(); 618 context.beginPath();
619 for (i = 0; i < indexes.length; ++i) { 619 for (i = 0; i < indexes.length; ++i) {
620 var entryIndex = indexes[i]; 620 var entryIndex = indexes[i];
621 var entryOffset = entryOffsets[entryIndex]; 621 var entryOffset = entryOffsets[entryIndex];
622 var barX = this._offsetToPosition(entryOffset); 622 var barX = this._offsetToPosition(entryOffset);
623 var barRight = this._offsetToPosition(entryOffset + entryTotalTi mes[entryIndex]); 623 var barRight = this._offsetToPosition(entryOffset + entryTotalTi mes[entryIndex]);
624 var barWidth = Math.max(barRight - barX, minWidth); 624 var barWidth = Math.max(barRight - barX, minWidth);
625 var barLevel = entryLevels[entryIndex]; 625 var barLevel = entryLevels[entryIndex];
626 var barY = this._levelToHeight(barLevel); 626 var barY = this._levelToHeight(barLevel);
627 if (isNaN(entryTotalTimes[entryIndex])) { 627 if (isNaN(entryTotalTimes[entryIndex])) {
628 context.moveTo(barX + this._markerRadius, barY + barHeight / 2);
628 context.arc(barX, barY + barHeight / 2, this._markerRadius, 0, Math.PI * 2); 629 context.arc(barX, barY + barHeight / 2, this._markerRadius, 0, Math.PI * 2);
629 markerIndices[nextMarkerIndex++] = entryIndex; 630 markerIndices[nextMarkerIndex++] = entryIndex;
630 } else { 631 } else {
631 context.rect(barX, barY, barWidth, barHeight); 632 context.rect(barX, barY, barWidth, barHeight);
632 if (barWidth > minTextWidth || this._dataProvider.forceDecor ation(entryIndex)) 633 if (barWidth > minTextWidth || this._dataProvider.forceDecor ation(entryIndex))
633 titleIndices[nextTitleIndex++] = entryIndex; 634 titleIndices[nextTitleIndex++] = entryIndex;
634 } 635 }
635 } 636 }
636 context.fill(); 637 context.fill();
637 } 638 }
638 639
639 context.strokeStyle = "rgb(0, 0, 0)"; 640 context.strokeStyle = "rgb(0, 0, 0)";
641 context.beginPath();
640 for (var m = 0; m < nextMarkerIndex; ++m) { 642 for (var m = 0; m < nextMarkerIndex; ++m) {
641 var entryIndex = markerIndices[m]; 643 var entryIndex = markerIndices[m];
642 var entryOffset = entryOffsets[entryIndex]; 644 var entryOffset = entryOffsets[entryIndex];
643 var barX = this._offsetToPosition(entryOffset); 645 var barX = this._offsetToPosition(entryOffset);
644 var barLevel = entryLevels[entryIndex]; 646 var barLevel = entryLevels[entryIndex];
645 var barY = this._levelToHeight(barLevel); 647 var barY = this._levelToHeight(barLevel);
646 context.beginPath(); 648 context.moveTo(barX + this._markerRadius, barY + barHeight / 2);
647 context.arc(barX, barY + barHeight / 2, this._markerRadius, 0, Math. PI * 2); 649 context.arc(barX, barY + barHeight / 2, this._markerRadius, 0, Math. PI * 2);
648 context.stroke();
649 } 650 }
651 context.stroke();
650 652
651 context.textBaseline = "alphabetic"; 653 context.textBaseline = "alphabetic";
652 654
653 for (var i = 0; i < nextTitleIndex; ++i) { 655 for (var i = 0; i < nextTitleIndex; ++i) {
654 var entryIndex = titleIndices[i]; 656 var entryIndex = titleIndices[i];
655 var entryOffset = entryOffsets[entryIndex]; 657 var entryOffset = entryOffsets[entryIndex];
656 var barX = this._offsetToPosition(entryOffset); 658 var barX = this._offsetToPosition(entryOffset);
657 var barRight = this._offsetToPosition(entryOffset + entryTotalTimes[ entryIndex]); 659 var barRight = this._offsetToPosition(entryOffset + entryTotalTimes[ entryIndex]);
658 var barWidth = Math.max(barRight - barX, minWidth); 660 var barWidth = Math.max(barRight - barX, minWidth);
659 var barLevel = entryLevels[entryIndex]; 661 var barLevel = entryLevels[entryIndex];
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 reset: function() 853 reset: function()
852 { 854 {
853 this._highlightedEntryIndex = -1; 855 this._highlightedEntryIndex = -1;
854 this._selectedEntryIndex = -1; 856 this._selectedEntryIndex = -1;
855 this._textWidth = {}; 857 this._textWidth = {};
856 this.update(); 858 this.update();
857 }, 859 },
858 860
859 __proto__: WebInspector.HBox.prototype 861 __proto__: WebInspector.HBox.prototype
860 } 862 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698