OLD | NEW |
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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 this._lastFrame._addTimeForCategory(categoryName, selfTime); | 449 this._lastFrame._addTimeForCategory(categoryName, selfTime); |
450 return; | 450 return; |
451 } | 451 } |
452 | 452 |
453 if (!this._framePendingCommit && WebInspector.TracingTimelineFrameModel.
_mainFrameMarkers.indexOf(event.name) >= 0) | 453 if (!this._framePendingCommit && WebInspector.TracingTimelineFrameModel.
_mainFrameMarkers.indexOf(event.name) >= 0) |
454 this._framePendingCommit = new WebInspector.PendingFrame(); | 454 this._framePendingCommit = new WebInspector.PendingFrame(); |
455 if (!this._framePendingCommit) | 455 if (!this._framePendingCommit) |
456 return; | 456 return; |
457 if (event.name === eventNames.Paint && event.args["data"]["layerId"] &&
event.picture) { | 457 if (event.name === eventNames.Paint && event.args["data"]["layerId"] &&
event.picture) { |
458 /** @type {!WebInspector.LayerPaintEvent} */ | 458 /** @type {!WebInspector.LayerPaintEvent} */ |
459 var paintEvent = {layerId: event.args["data"]["layerId"], picture: e
vent.picture, rect: event.layerRect}; | 459 var paintEvent = {layerId: event.args["data"]["layerId"], picture: e
vent.picture, rect: event.layerRect, traceEvent: event}; |
460 this._framePendingCommit.paints.push(paintEvent); | 460 this._framePendingCommit.paints.push(paintEvent); |
461 } | 461 } |
462 | 462 |
463 if (selfTime) { | 463 if (selfTime) { |
464 var categoryName = WebInspector.TracingTimelineUIUtils.eventStyle(ev
ent).category.name; | 464 var categoryName = WebInspector.TracingTimelineUIUtils.eventStyle(ev
ent).category.name; |
465 this._framePendingCommit.timeByCategory[categoryName] = (this._frame
PendingCommit.timeByCategory[categoryName] || 0) + selfTime; | 465 this._framePendingCommit.timeByCategory[categoryName] = (this._frame
PendingCommit.timeByCategory[categoryName] || 0) + selfTime; |
466 } | 466 } |
467 if (event.name === eventNames.CompositeLayers && event.args["layerTreeId
"] === this._layerTreeId) | 467 if (event.name === eventNames.CompositeLayers && event.args["layerTreeId
"] === this._layerTreeId) |
468 this.handleCompositeLayers(); | 468 this.handleCompositeLayers(); |
469 }, | 469 }, |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 * @param {number} time | 572 * @param {number} time |
573 */ | 573 */ |
574 _addTimeForCategory: function(category, time) | 574 _addTimeForCategory: function(category, time) |
575 { | 575 { |
576 this.timeByCategory[category] = (this.timeByCategory[category] || 0) + t
ime; | 576 this.timeByCategory[category] = (this.timeByCategory[category] || 0) + t
ime; |
577 this.cpuTime += time; | 577 this.cpuTime += time; |
578 }, | 578 }, |
579 } | 579 } |
580 | 580 |
581 /** | 581 /** |
582 * @typedef {!{layerId: string, rect: !Array.<number>, picture: string}} | 582 * @typedef {!{layerId: string, rect: !Array.<number>, picture: string, traceEve
nt: !WebInspector.TracingModel.Event}} |
583 */ | 583 */ |
584 WebInspector.LayerPaintEvent; | 584 WebInspector.LayerPaintEvent; |
585 | 585 |
586 /** | 586 /** |
587 * @constructor | 587 * @constructor |
588 */ | 588 */ |
589 WebInspector.PendingFrame = function() | 589 WebInspector.PendingFrame = function() |
590 { | 590 { |
591 /** @type {!Object.<string, number>} */ | 591 /** @type {!Object.<string, number>} */ |
592 this.timeByCategory = {}; | 592 this.timeByCategory = {}; |
593 /** @type {!Array.<!WebInspector.LayerPaintEvent>} */ | 593 /** @type {!Array.<!WebInspector.LayerPaintEvent>} */ |
594 this.paints = []; | 594 this.paints = []; |
595 } | 595 } |
OLD | NEW |