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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 return (reason && reason !== "no reason") ? this._boldFont : this._font; | 269 return (reason && reason !== "no reason") ? this._boldFont : this._font; |
270 }, | 270 }, |
271 | 271 |
272 /** | 272 /** |
273 * @param {number} entryIndex | 273 * @param {number} entryIndex |
274 * @return {!string} | 274 * @return {!string} |
275 */ | 275 */ |
276 entryColor: function(entryIndex) | 276 entryColor: function(entryIndex) |
277 { | 277 { |
278 var node = this._entryNodes[entryIndex]; | 278 var node = this._entryNodes[entryIndex]; |
279 return this._colorGenerator.colorForID(node.functionName + ":" + node.ur
l + ":" + node.lineNumber); | 279 return this._colorGenerator.colorForID(node.functionName + ":" + node.ur
l); |
280 }, | 280 }, |
281 | 281 |
282 /** | 282 /** |
283 * @param {number} entryIndex | 283 * @param {number} entryIndex |
284 * @param {!CanvasRenderingContext2D} context | 284 * @param {!CanvasRenderingContext2D} context |
285 * @param {?string} text | 285 * @param {?string} text |
286 * @param {number} barX | 286 * @param {number} barX |
287 * @param {number} barY | 287 * @param {number} barY |
288 * @param {number} barWidth | 288 * @param {number} barWidth |
289 * @param {number} barHeight | 289 * @param {number} barHeight |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 } | 335 } |
336 } | 336 } |
337 | 337 |
338 | 338 |
339 /** | 339 /** |
340 * @return {!WebInspector.FlameChart.ColorGenerator} | 340 * @return {!WebInspector.FlameChart.ColorGenerator} |
341 */ | 341 */ |
342 WebInspector.CPUFlameChartDataProvider.colorGenerator = function() | 342 WebInspector.CPUFlameChartDataProvider.colorGenerator = function() |
343 { | 343 { |
344 if (!WebInspector.CPUFlameChartDataProvider._colorGenerator) { | 344 if (!WebInspector.CPUFlameChartDataProvider._colorGenerator) { |
345 var colorGenerator = new WebInspector.FlameChart.ColorGenerator(); | 345 var colorGenerator = new WebInspector.FlameChart.ColorGenerator( |
346 colorGenerator.setColorForID("(idle)::0", "hsl(0, 0%, 94%)"); | 346 { min: 180, max: 310, count: 7 }, |
347 colorGenerator.setColorForID("(program)::0", "hsl(0, 0%, 80%)"); | 347 { min: 50, max: 80, count: 5 }, |
348 colorGenerator.setColorForID("(garbage collector)::0", "hsl(0, 0%, 80%)"
); | 348 { min: 80, max: 90, count: 3 }); |
| 349 colorGenerator.setColorForID("(idle):", "hsl(0, 0%, 94%)"); |
| 350 colorGenerator.setColorForID("(program):", "hsl(0, 0%, 80%)"); |
| 351 colorGenerator.setColorForID("(garbage collector):", "hsl(0, 0%, 80%)"); |
349 WebInspector.CPUFlameChartDataProvider._colorGenerator = colorGenerator; | 352 WebInspector.CPUFlameChartDataProvider._colorGenerator = colorGenerator; |
350 } | 353 } |
351 return WebInspector.CPUFlameChartDataProvider._colorGenerator; | 354 return WebInspector.CPUFlameChartDataProvider._colorGenerator; |
352 } | 355 } |
353 | 356 |
354 | 357 |
355 /** | 358 /** |
356 * @constructor | 359 * @constructor |
357 * @extends {WebInspector.VBox} | 360 * @extends {WebInspector.VBox} |
358 * @param {!WebInspector.FlameChartDataProvider} dataProvider | 361 * @param {!WebInspector.FlameChartDataProvider} dataProvider |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 { | 641 { |
639 var ratio = window.devicePixelRatio; | 642 var ratio = window.devicePixelRatio; |
640 this._overviewCanvas.width = width * ratio; | 643 this._overviewCanvas.width = width * ratio; |
641 this._overviewCanvas.height = height * ratio; | 644 this._overviewCanvas.height = height * ratio; |
642 this._overviewCanvas.style.width = width + "px"; | 645 this._overviewCanvas.style.width = width + "px"; |
643 this._overviewCanvas.style.height = height + "px"; | 646 this._overviewCanvas.style.height = height + "px"; |
644 }, | 647 }, |
645 | 648 |
646 __proto__: WebInspector.VBox.prototype | 649 __proto__: WebInspector.VBox.prototype |
647 } | 650 } |
OLD | NEW |