| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 1635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1646 */ | 1646 */ |
| 1647 didPaint: function(paintEvent) | 1647 didPaint: function(paintEvent) |
| 1648 { | 1648 { |
| 1649 this._didPaint = true; | 1649 this._didPaint = true; |
| 1650 | 1650 |
| 1651 // If a paint doesn't have a corresponding graphics layer id, it paints | 1651 // If a paint doesn't have a corresponding graphics layer id, it paints |
| 1652 // into its parent so add an effectivePaintId to these events. | 1652 // into its parent so add an effectivePaintId to these events. |
| 1653 var layerId = paintEvent.args["data"]["layerId"]; | 1653 var layerId = paintEvent.args["data"]["layerId"]; |
| 1654 if (layerId) | 1654 if (layerId) |
| 1655 this._lastPaintWithLayer = paintEvent; | 1655 this._lastPaintWithLayer = paintEvent; |
| 1656 if (!this._lastPaintWithLayer) { | 1656 // Quietly discard top-level paints without layerId, as these are likely |
| 1657 console.error("Failed to find a paint container for a paint event.")
; | 1657 // to come from overlay. |
| 1658 if (!this._lastPaintWithLayer) |
| 1658 return; | 1659 return; |
| 1659 } | |
| 1660 | 1660 |
| 1661 var effectivePaintId = this._lastPaintWithLayer.args["data"]["nodeId"]; | 1661 var effectivePaintId = this._lastPaintWithLayer.args["data"]["nodeId"]; |
| 1662 var paintFrameId = paintEvent.args["data"]["frame"]; | 1662 var paintFrameId = paintEvent.args["data"]["frame"]; |
| 1663 var types = [WebInspector.TimelineModel.RecordType.StyleRecalcInvalidati
onTracking, | 1663 var types = [WebInspector.TimelineModel.RecordType.StyleRecalcInvalidati
onTracking, |
| 1664 WebInspector.TimelineModel.RecordType.LayoutInvalidationTracking, | 1664 WebInspector.TimelineModel.RecordType.LayoutInvalidationTracking, |
| 1665 WebInspector.TimelineModel.RecordType.PaintInvalidationTracking, | 1665 WebInspector.TimelineModel.RecordType.PaintInvalidationTracking, |
| 1666 WebInspector.TimelineModel.RecordType.ScrollInvalidationTracking]; | 1666 WebInspector.TimelineModel.RecordType.ScrollInvalidationTracking]; |
| 1667 for (var invalidation of this._invalidationsOfTypes(types)) { | 1667 for (var invalidation of this._invalidationsOfTypes(types)) { |
| 1668 if (invalidation.paintId === effectivePaintId) | 1668 if (invalidation.paintId === effectivePaintId) |
| 1669 this._addInvalidationToEvent(paintEvent, paintFrameId, invalidat
ion); | 1669 this._addInvalidationToEvent(paintEvent, paintFrameId, invalidat
ion); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1778 if (!id) | 1778 if (!id) |
| 1779 return; | 1779 return; |
| 1780 /** @type {!Map<string, !WebInspector.TracingModel.Event>|undefined} */ | 1780 /** @type {!Map<string, !WebInspector.TracingModel.Event>|undefined} */ |
| 1781 var initiatorMap = this._initiatorByType.get(initiatorType); | 1781 var initiatorMap = this._initiatorByType.get(initiatorType); |
| 1782 if (isInitiator) | 1782 if (isInitiator) |
| 1783 initiatorMap.set(id, event); | 1783 initiatorMap.set(id, event); |
| 1784 else | 1784 else |
| 1785 event.initiator = initiatorMap.get(id) || null; | 1785 event.initiator = initiatorMap.get(id) || null; |
| 1786 } | 1786 } |
| 1787 } | 1787 } |
| OLD | NEW |