| 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 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 = 1; | 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.hasWarnings() ? "hsl(0, 80%, 70%)" : "whit
e"; | 583 context.fillStyle = frame.idle ? "white" : frame.hasWarnings() ? "hs
l(0, 80%, 70%)" : "#eee"; |
| 584 context.fillRect(barX, barY, barWidth, barHeight); | 584 context.fillRect(barX, barY, barWidth, barHeight); |
| 585 | 585 |
| 586 var frameDurationText = Number.preciseMillisToString(frame.duration,
1); | 586 var frameDurationText = Number.preciseMillisToString(frame.duration,
1); |
| 587 var textWidth = context.measureText(frameDurationText).width; | 587 var textWidth = context.measureText(frameDurationText).width; |
| 588 if (barWidth > textWidth) { | 588 if (barWidth > textWidth) { |
| 589 context.fillStyle = this.textColor(entryIndex); | 589 context.fillStyle = this.textColor(entryIndex); |
| 590 context.fillText(frameDurationText, barX + ((barWidth - textWidt
h) >> 1), barY + barHeight - 3); | 590 context.fillText(frameDurationText, barX + ((barWidth - textWidt
h) >> 1), barY + barHeight - 3); |
| 591 } | 591 } |
| 592 return true; | 592 return true; |
| 593 } | 593 } |
| (...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1575 /** | 1575 /** |
| 1576 * @constructor | 1576 * @constructor |
| 1577 * @param {!WebInspector.TimelineSelection} selection | 1577 * @param {!WebInspector.TimelineSelection} selection |
| 1578 * @param {number} entryIndex | 1578 * @param {number} entryIndex |
| 1579 */ | 1579 */ |
| 1580 WebInspector.TimelineFlameChartView.Selection = function(selection, entryIndex) | 1580 WebInspector.TimelineFlameChartView.Selection = function(selection, entryIndex) |
| 1581 { | 1581 { |
| 1582 this.timelineSelection = selection; | 1582 this.timelineSelection = selection; |
| 1583 this.entryIndex = entryIndex; | 1583 this.entryIndex = entryIndex; |
| 1584 } | 1584 } |
| OLD | NEW |