| 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 */ | 275 */ |
| 276 entryColor: function(entryIndex) | 276 entryColor: function(entryIndex) |
| 277 { | 277 { |
| 278 var record = this._records[entryIndex]; | 278 var record = this._records[entryIndex]; |
| 279 if (record === this._cpuThreadRecord || record === this._gpuThreadRecord
) | 279 if (record === this._cpuThreadRecord || record === this._gpuThreadRecord
) |
| 280 return "#555"; | 280 return "#555"; |
| 281 | 281 |
| 282 if (record.type() === WebInspector.TimelineModel.RecordType.JSFrame) | 282 if (record.type() === WebInspector.TimelineModel.RecordType.JSFrame) |
| 283 return WebInspector.TimelineFlameChartDataProvider.jsFrameColorGener
ator().colorForID(record.data()["functionName"]); | 283 return WebInspector.TimelineFlameChartDataProvider.jsFrameColorGener
ator().colorForID(record.data()["functionName"]); |
| 284 | 284 |
| 285 var category = WebInspector.TimelineUIUtils.categoryForRecord(record); | 285 return record.category().fillColorStop1; |
| 286 return category.fillColorStop1; | |
| 287 }, | 286 }, |
| 288 | 287 |
| 289 | 288 |
| 290 /** | 289 /** |
| 291 * @param {number} entryIndex | 290 * @param {number} entryIndex |
| 292 * @param {!CanvasRenderingContext2D} context | 291 * @param {!CanvasRenderingContext2D} context |
| 293 * @param {?string} text | 292 * @param {?string} text |
| 294 * @param {number} barX | 293 * @param {number} barX |
| 295 * @param {number} barY | 294 * @param {number} barY |
| 296 * @param {number} barWidth | 295 * @param {number} barWidth |
| 297 * @param {number} barHeight | 296 * @param {number} barHeight |
| 298 * @param {function(number):number} offsetToPosition | 297 * @param {function(number):number} offsetToPosition |
| 299 * @return {boolean} | 298 * @return {boolean} |
| 300 */ | 299 */ |
| 301 decorateEntry: function(entryIndex, context, text, barX, barY, barWidth, bar
Height, offsetToPosition) | 300 decorateEntry: function(entryIndex, context, text, barX, barY, barWidth, bar
Height, offsetToPosition) |
| 302 { | 301 { |
| 303 if (barWidth < 5) | 302 if (barWidth < 5) |
| 304 return false; | 303 return false; |
| 305 | 304 |
| 306 var record = this._records[entryIndex]; | 305 var record = this._records[entryIndex]; |
| 307 var timelineData = this._timelineData; | 306 var timelineData = this._timelineData; |
| 308 | 307 |
| 309 var category = WebInspector.TimelineUIUtils.categoryForRecord(record); | 308 var category = record.category(); |
| 310 // Paint text using white color on dark background. | 309 // Paint text using white color on dark background. |
| 311 if (text) { | 310 if (text) { |
| 312 context.save(); | 311 context.save(); |
| 313 context.fillStyle = "white"; | 312 context.fillStyle = "white"; |
| 314 context.shadowColor = "rgba(0, 0, 0, 0.1)"; | 313 context.shadowColor = "rgba(0, 0, 0, 0.1)"; |
| 315 context.shadowOffsetX = 1; | 314 context.shadowOffsetX = 1; |
| 316 context.shadowOffsetY = 1; | 315 context.shadowOffsetY = 1; |
| 317 context.font = this._font; | 316 context.font = this._font; |
| 318 context.fillText(text, barX + this.textPadding(), barY + barHeight -
this.textBaseline()); | 317 context.fillText(text, barX + this.textPadding(), barY + barHeight -
this.textBaseline()); |
| 319 context.restore(); | 318 context.restore(); |
| (...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 971 * @param {number} entryIndex | 970 * @param {number} entryIndex |
| 972 * @return {?WebInspector.TimelineSelection} | 971 * @return {?WebInspector.TimelineSelection} |
| 973 */ | 972 */ |
| 974 createSelection: function(entryIndex) { }, | 973 createSelection: function(entryIndex) { }, |
| 975 /** | 974 /** |
| 976 * @param {?WebInspector.TimelineSelection} selection | 975 * @param {?WebInspector.TimelineSelection} selection |
| 977 * @return {number} | 976 * @return {number} |
| 978 */ | 977 */ |
| 979 entryIndexForSelection: function(selection) { } | 978 entryIndexForSelection: function(selection) { } |
| 980 } | 979 } |
| OLD | NEW |