Chromium Code Reviews| 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 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 567 * @param {number} barY | 567 * @param {number} barY |
| 568 * @param {number} barWidth | 568 * @param {number} barWidth |
| 569 * @param {number} barHeight | 569 * @param {number} barHeight |
| 570 * @return {boolean} | 570 * @return {boolean} |
| 571 */ | 571 */ |
| 572 decorateEntry: function(entryIndex, context, text, barX, barY, barWidth, bar Height) | 572 decorateEntry: function(entryIndex, context, text, barX, barY, barWidth, bar Height) |
| 573 { | 573 { |
| 574 var frame = this._entryIndexToFrame[entryIndex]; | 574 var frame = this._entryIndexToFrame[entryIndex]; |
| 575 if (frame) { | 575 if (frame) { |
| 576 var /** @const */ vPadding = 1; | 576 var /** @const */ vPadding = 1; |
| 577 var /** @const */ hPadding = 2; | 577 var /** @const */ hPadding = 1; |
| 578 barX += hPadding; | 578 barX += hPadding; |
| 579 barWidth -= 2 * hPadding; | 579 barWidth -= 2 * hPadding; |
| 580 barY += vPadding; | 580 barY += vPadding; |
| 581 barHeight -= 2 * vPadding + 1; | 581 barHeight -= 2 * vPadding + 1; |
| 582 | 582 |
| 583 context.fillStyle = frame.idle ? "#eee" : "#ccc"; | 583 context.fillStyle = frame.hasWarnings() ? "hsl(0, 80%, 70%)" : "whit e"; |
| 584 context.fillRect(barX, barY, barWidth, barHeight); | 584 context.fillRect(barX, barY, barWidth, barHeight); |
| 585 | 585 |
| 586 // Draw frame perforation. | |
| 587 context.fillStyle = "white"; | |
|
yurys
2015/06/17 13:16:29
Please note this in the description.
alph
2015/06/17 13:23:18
Done.
| |
| 588 for (var i = 1; i < barWidth; i += 4) { | |
| 589 context.fillRect(barX + i, barY + 1, 2, 2); | |
| 590 context.fillRect(barX + i, barY + barHeight - 3, 2, 2); | |
| 591 } | |
| 592 | |
| 593 var frameDurationText = Number.preciseMillisToString(frame.duration, 1); | 586 var frameDurationText = Number.preciseMillisToString(frame.duration, 1); |
| 594 var textWidth = context.measureText(frameDurationText).width; | 587 var textWidth = context.measureText(frameDurationText).width; |
| 595 if (barWidth > textWidth) { | 588 if (barWidth > textWidth) { |
| 596 context.fillStyle = this.textColor(entryIndex); | 589 context.fillStyle = this.textColor(entryIndex); |
| 597 context.fillText(frameDurationText, barX + ((barWidth - textWidt h) >> 1), barY + barHeight - 3); | 590 context.fillText(frameDurationText, barX + ((barWidth - textWidt h) >> 1), barY + barHeight - 3); |
| 598 } | 591 } |
| 599 return true; | 592 return true; |
| 600 } | 593 } |
| 601 if (barWidth < 5) | 594 if (barWidth < 5) |
| 602 return false; | 595 return false; |
| (...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1582 /** | 1575 /** |
| 1583 * @constructor | 1576 * @constructor |
| 1584 * @param {!WebInspector.TimelineSelection} selection | 1577 * @param {!WebInspector.TimelineSelection} selection |
| 1585 * @param {number} entryIndex | 1578 * @param {number} entryIndex |
| 1586 */ | 1579 */ |
| 1587 WebInspector.TimelineFlameChartView.Selection = function(selection, entryIndex) | 1580 WebInspector.TimelineFlameChartView.Selection = function(selection, entryIndex) |
| 1588 { | 1581 { |
| 1589 this.timelineSelection = selection; | 1582 this.timelineSelection = selection; |
| 1590 this.entryIndex = entryIndex; | 1583 this.entryIndex = entryIndex; |
| 1591 } | 1584 } |
| OLD | NEW |