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 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 this._lastFrame._addTimeForCategory(categoryName, selfTime); | 458 this._lastFrame._addTimeForCategory(categoryName, selfTime); |
459 return; | 459 return; |
460 } | 460 } |
461 | 461 |
462 if (!this._framePendingCommit && WebInspector.TracingTimelineFrameModel.
_mainFrameMarkers.indexOf(event.name) >= 0) | 462 if (!this._framePendingCommit && WebInspector.TracingTimelineFrameModel.
_mainFrameMarkers.indexOf(event.name) >= 0) |
463 this._framePendingCommit = new WebInspector.PendingFrame(); | 463 this._framePendingCommit = new WebInspector.PendingFrame(); |
464 if (!this._framePendingCommit) | 464 if (!this._framePendingCommit) |
465 return; | 465 return; |
466 if (event.name === eventNames.Paint && event.args["data"]["layerId"] &&
event.picture) { | 466 if (event.name === eventNames.Paint && event.args["data"]["layerId"] &&
event.picture) { |
467 /** @type {!WebInspector.LayerPaintEvent} */ | 467 /** @type {!WebInspector.LayerPaintEvent} */ |
468 var paintEvent = {layerId: event.args["data"]["layerId"], picture: e
vent.picture, rect: event.layerRect}; | 468 var paintEvent = {layerId: event.args["data"]["layerId"], picture: e
vent.picture, rect: event.layerRect, traceEvent: event}; |
469 this._framePendingCommit.paints.push(paintEvent); | 469 this._framePendingCommit.paints.push(paintEvent); |
470 } | 470 } |
471 | 471 |
472 if (selfTime) { | 472 if (selfTime) { |
473 var categoryName = WebInspector.TracingTimelineUIUtils.eventStyle(ev
ent).category.name; | 473 var categoryName = WebInspector.TracingTimelineUIUtils.eventStyle(ev
ent).category.name; |
474 this._framePendingCommit.timeByCategory[categoryName] = (this._frame
PendingCommit.timeByCategory[categoryName] || 0) + selfTime; | 474 this._framePendingCommit.timeByCategory[categoryName] = (this._frame
PendingCommit.timeByCategory[categoryName] || 0) + selfTime; |
475 } | 475 } |
476 if (event.name === eventNames.CompositeLayers && event.args["layerTreeId
"] === this._layerTreeId) | 476 if (event.name === eventNames.CompositeLayers && event.args["layerTreeId
"] === this._layerTreeId) |
477 this.handleCompositeLayers(); | 477 this.handleCompositeLayers(); |
478 }, | 478 }, |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 * @param {number} time | 581 * @param {number} time |
582 */ | 582 */ |
583 _addTimeForCategory: function(category, time) | 583 _addTimeForCategory: function(category, time) |
584 { | 584 { |
585 this.timeByCategory[category] = (this.timeByCategory[category] || 0) + t
ime; | 585 this.timeByCategory[category] = (this.timeByCategory[category] || 0) + t
ime; |
586 this.cpuTime += time; | 586 this.cpuTime += time; |
587 }, | 587 }, |
588 } | 588 } |
589 | 589 |
590 /** | 590 /** |
591 * @typedef {!{layerId: string, rect: !Array.<number>, picture: string}} | 591 * @typedef {!{layerId: string, rect: !Array.<number>, picture: string, traceEve
nt: !WebInspector.TracingModel.Event}} |
592 */ | 592 */ |
593 WebInspector.LayerPaintEvent; | 593 WebInspector.LayerPaintEvent; |
594 | 594 |
595 /** | 595 /** |
596 * @constructor | 596 * @constructor |
597 */ | 597 */ |
598 WebInspector.PendingFrame = function() | 598 WebInspector.PendingFrame = function() |
599 { | 599 { |
600 /** @type {!Object.<string, number>} */ | 600 /** @type {!Object.<string, number>} */ |
601 this.timeByCategory = {}; | 601 this.timeByCategory = {}; |
602 /** @type {!Array.<!WebInspector.LayerPaintEvent>} */ | 602 /** @type {!Array.<!WebInspector.LayerPaintEvent>} */ |
603 this.paints = []; | 603 this.paints = []; |
604 } | 604 } |
OLD | NEW |