| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 */ | 42 */ |
| 43 WebInspector.TracingLayerPayload; | 43 WebInspector.TracingLayerPayload; |
| 44 | 44 |
| 45 /** | 45 /** |
| 46 * @constructor | 46 * @constructor |
| 47 * @extends {WebInspector.SDKObject} | 47 * @extends {WebInspector.SDKObject} |
| 48 */ | 48 */ |
| 49 WebInspector.LayerTreeModel = function(target) | 49 WebInspector.LayerTreeModel = function(target) |
| 50 { | 50 { |
| 51 WebInspector.SDKObject.call(this, target); | 51 WebInspector.SDKObject.call(this, target); |
| 52 InspectorBackend.registerLayerTreeDispatcher(new WebInspector.LayerTreeDispa
tcher(this)); | 52 target.registerLayerTreeDispatcher(new WebInspector.LayerTreeDispatcher(this
)); |
| 53 target.domModel.addEventListener(WebInspector.DOMModel.Events.DocumentUpdate
d, this._onDocumentUpdated, this); | 53 target.domModel.addEventListener(WebInspector.DOMModel.Events.DocumentUpdate
d, this._onDocumentUpdated, this); |
| 54 /** @type {?WebInspector.LayerTreeBase} */ | 54 /** @type {?WebInspector.LayerTreeBase} */ |
| 55 this._layerTree = null; | 55 this._layerTree = null; |
| 56 } | 56 } |
| 57 | 57 |
| 58 WebInspector.LayerTreeModel.Events = { | 58 WebInspector.LayerTreeModel.Events = { |
| 59 LayerTreeChanged: "LayerTreeChanged", | 59 LayerTreeChanged: "LayerTreeChanged", |
| 60 LayerPainted: "LayerPainted", | 60 LayerPainted: "LayerPainted", |
| 61 } | 61 } |
| 62 | 62 |
| 63 WebInspector.LayerTreeModel.ScrollRectType = { | 63 WebInspector.LayerTreeModel.ScrollRectType = { |
| 64 NonFastScrollable: {name: "NonFastScrollable", description: "Non fast scroll
able"}, | 64 NonFastScrollable: {name: "NonFastScrollable", description: "Non fast scroll
able"}, |
| 65 TouchEventHandler: {name: "TouchEventHandler", description: "Touch event han
dler"}, | 65 TouchEventHandler: {name: "TouchEventHandler", description: "Touch event han
dler"}, |
| 66 WheelEventHandler: {name: "WheelEventHandler", description: "Wheel event han
dler"}, | 66 WheelEventHandler: {name: "WheelEventHandler", description: "Wheel event han
dler"}, |
| 67 RepaintsOnScroll: {name: "RepaintsOnScroll", description: "Repaints on scrol
l"} | 67 RepaintsOnScroll: {name: "RepaintsOnScroll", description: "Repaints on scrol
l"} |
| 68 } | 68 } |
| 69 | 69 |
| 70 WebInspector.LayerTreeModel.prototype = { | 70 WebInspector.LayerTreeModel.prototype = { |
| 71 disable: function() | 71 disable: function() |
| 72 { | 72 { |
| 73 if (!this._enabled) | 73 if (!this._enabled) |
| 74 return; | 74 return; |
| 75 this._enabled = false; | 75 this._enabled = false; |
| 76 this._layerTree = null; | 76 this._layerTree = null; |
| 77 LayerTreeAgent.disable(); | 77 this.target().layerTreeAgent().disable(); |
| 78 }, | 78 }, |
| 79 | 79 |
| 80 enable: function() | 80 enable: function() |
| 81 { | 81 { |
| 82 if (this._enabled) | 82 if (this._enabled) |
| 83 return; | 83 return; |
| 84 this._enabled = true; | 84 this._enabled = true; |
| 85 this._layerTree = new WebInspector.AgentLayerTree(this.target().weakRefe
rence()); | 85 this._layerTree = new WebInspector.AgentLayerTree(this.target()); |
| 86 this._lastPaintRectByLayerId = {}; | 86 this._lastPaintRectByLayerId = {}; |
| 87 LayerTreeAgent.enable(); | 87 this.target().layerTreeAgent().enable(); |
| 88 }, | 88 }, |
| 89 | 89 |
| 90 /** | 90 /** |
| 91 * @param {!WebInspector.LayerTreeBase} layerTree | 91 * @param {!WebInspector.LayerTreeBase} layerTree |
| 92 */ | 92 */ |
| 93 setLayerTree: function(layerTree) | 93 setLayerTree: function(layerTree) |
| 94 { | 94 { |
| 95 this.disable(); | 95 this.disable(); |
| 96 this._layerTree = layerTree; | 96 this._layerTree = layerTree; |
| 97 this.dispatchEventToListeners(WebInspector.LayerTreeModel.Events.LayerTr
eeChanged); | 97 this.dispatchEventToListeners(WebInspector.LayerTreeModel.Events.LayerTr
eeChanged); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 return; | 156 return; |
| 157 this.disable(); | 157 this.disable(); |
| 158 this.enable(); | 158 this.enable(); |
| 159 }, | 159 }, |
| 160 | 160 |
| 161 __proto__: WebInspector.SDKObject.prototype | 161 __proto__: WebInspector.SDKObject.prototype |
| 162 } | 162 } |
| 163 | 163 |
| 164 /** | 164 /** |
| 165 * @constructor | 165 * @constructor |
| 166 * @param {!WeakReference.<!WebInspector.Target>} weakTarget | 166 * @param {?WebInspector.Target} target |
| 167 */ | 167 */ |
| 168 WebInspector.LayerTreeBase = function(weakTarget) | 168 WebInspector.LayerTreeBase = function(target) |
| 169 { | 169 { |
| 170 this._weakTarget = weakTarget; | 170 this._target = target; |
| 171 this._layersById = {}; | 171 this._layersById = {}; |
| 172 this._backendNodeIdToNodeId = {}; | 172 this._backendNodeIdToNodeId = {}; |
| 173 this._reset(); | 173 this._reset(); |
| 174 } | 174 } |
| 175 | 175 |
| 176 WebInspector.LayerTreeBase.prototype = { | 176 WebInspector.LayerTreeBase.prototype = { |
| 177 _reset: function() | 177 _reset: function() |
| 178 { | 178 { |
| 179 this._root = null; | 179 this._root = null; |
| 180 this._contentRoot = null; | 180 this._contentRoot = null; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 { | 219 { |
| 220 return this._layersById[id] || null; | 220 return this._layersById[id] || null; |
| 221 }, | 221 }, |
| 222 | 222 |
| 223 /** | 223 /** |
| 224 * @param {!Array.<number>} requestedNodeIds | 224 * @param {!Array.<number>} requestedNodeIds |
| 225 * @param {function()} callback | 225 * @param {function()} callback |
| 226 */ | 226 */ |
| 227 _resolveBackendNodeIds: function(requestedNodeIds, callback) | 227 _resolveBackendNodeIds: function(requestedNodeIds, callback) |
| 228 { | 228 { |
| 229 var target = this._weakTarget.get(); | 229 if (!requestedNodeIds.length || !this._target) { |
| 230 if (!requestedNodeIds.length || !target) { | |
| 231 callback(); | 230 callback(); |
| 232 return; | 231 return; |
| 233 } | 232 } |
| 234 | 233 |
| 235 target.domModel.pushNodesByBackendIdsToFrontend(requestedNodeIds, popula
teBackendNodeIdMap.bind(this)); | 234 this._target.domModel.pushNodesByBackendIdsToFrontend(requestedNodeIds,
populateBackendNodeIdMap.bind(this)); |
| 236 | 235 |
| 237 /** | 236 /** |
| 238 * @this {WebInspector.LayerTreeBase} | 237 * @this {WebInspector.LayerTreeBase} |
| 239 * @param {?Array.<number>} nodeIds | 238 * @param {?Array.<number>} nodeIds |
| 240 */ | 239 */ |
| 241 function populateBackendNodeIdMap(nodeIds) | 240 function populateBackendNodeIdMap(nodeIds) |
| 242 { | 241 { |
| 243 if (nodeIds) { | 242 if (nodeIds) { |
| 244 for (var i = 0; i < requestedNodeIds.length; ++i) { | 243 for (var i = 0; i < requestedNodeIds.length; ++i) { |
| 245 var nodeId = nodeIds[i]; | 244 var nodeId = nodeIds[i]; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 266 { | 265 { |
| 267 return this._viewportSize; | 266 return this._viewportSize; |
| 268 }, | 267 }, |
| 269 | 268 |
| 270 /** | 269 /** |
| 271 * @param {number} id | 270 * @param {number} id |
| 272 * @return {?WebInspector.DOMNode} | 271 * @return {?WebInspector.DOMNode} |
| 273 */ | 272 */ |
| 274 _nodeForId: function(id) | 273 _nodeForId: function(id) |
| 275 { | 274 { |
| 276 var target = this._weakTarget.get(); | 275 return this._target ? this._target.domModel.nodeForId(id) : null; |
| 277 return target ? target.domModel.nodeForId(id) : null; | |
| 278 } | 276 } |
| 279 }; | 277 }; |
| 280 | 278 |
| 281 /** | 279 /** |
| 282 * @constructor | 280 * @constructor |
| 283 * @extends {WebInspector.LayerTreeBase} | 281 * @extends {WebInspector.LayerTreeBase} |
| 284 * @param {!WeakReference.<!WebInspector.Target>} weakTarget | 282 * @param {?WebInspector.Target} target |
| 285 */ | 283 */ |
| 286 WebInspector.TracingLayerTree = function(weakTarget) | 284 WebInspector.TracingLayerTree = function(target) |
| 287 { | 285 { |
| 288 WebInspector.LayerTreeBase.call(this, weakTarget); | 286 WebInspector.LayerTreeBase.call(this, target); |
| 289 } | 287 } |
| 290 | 288 |
| 291 WebInspector.TracingLayerTree.prototype = { | 289 WebInspector.TracingLayerTree.prototype = { |
| 292 /** | 290 /** |
| 293 * @param {!WebInspector.TracingLayerPayload} root | 291 * @param {!WebInspector.TracingLayerPayload} root |
| 294 * @param {!function()} callback | 292 * @param {!function()} callback |
| 295 */ | 293 */ |
| 296 setLayers: function(root, callback) | 294 setLayers: function(root, callback) |
| 297 { | 295 { |
| 298 var idsToResolve = []; | 296 var idsToResolve = []; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 } | 348 } |
| 351 for (var i = 0; payload.children && i < payload.children.length; ++i) | 349 for (var i = 0; payload.children && i < payload.children.length; ++i) |
| 352 this._extractNodeIdsToResolve(nodeIdsToResolve, seenNodeIds, payload
.children[i]); | 350 this._extractNodeIdsToResolve(nodeIdsToResolve, seenNodeIds, payload
.children[i]); |
| 353 }, | 351 }, |
| 354 | 352 |
| 355 __proto__: WebInspector.LayerTreeBase.prototype | 353 __proto__: WebInspector.LayerTreeBase.prototype |
| 356 } | 354 } |
| 357 | 355 |
| 358 /** | 356 /** |
| 359 * @constructor | 357 * @constructor |
| 360 * @param {!WeakReference.<!WebInspector.Target>} weakTarget | 358 * @param {?WebInspector.Target} target |
| 361 * @extends {WebInspector.LayerTreeBase} | 359 * @extends {WebInspector.LayerTreeBase} |
| 362 */ | 360 */ |
| 363 WebInspector.AgentLayerTree = function(weakTarget) | 361 WebInspector.AgentLayerTree = function(target) |
| 364 { | 362 { |
| 365 WebInspector.LayerTreeBase.call(this, weakTarget); | 363 WebInspector.LayerTreeBase.call(this, target); |
| 366 } | 364 } |
| 367 | 365 |
| 368 WebInspector.AgentLayerTree.prototype = { | 366 WebInspector.AgentLayerTree.prototype = { |
| 369 /** | 367 /** |
| 370 * @param {?Array.<!LayerTreeAgent.Layer>} payload | 368 * @param {?Array.<!LayerTreeAgent.Layer>} payload |
| 371 * @param {function()} callback | 369 * @param {function()} callback |
| 372 */ | 370 */ |
| 373 setLayers: function(payload, callback) | 371 setLayers: function(payload, callback) |
| 374 { | 372 { |
| 375 if (!payload) { | 373 if (!payload) { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 if (!layers) | 408 if (!layers) |
| 411 return; | 409 return; |
| 412 var oldLayersById = this._layersById; | 410 var oldLayersById = this._layersById; |
| 413 this._layersById = {}; | 411 this._layersById = {}; |
| 414 for (var i = 0; i < layers.length; ++i) { | 412 for (var i = 0; i < layers.length; ++i) { |
| 415 var layerId = layers[i].layerId; | 413 var layerId = layers[i].layerId; |
| 416 var layer = oldLayersById[layerId]; | 414 var layer = oldLayersById[layerId]; |
| 417 if (layer) | 415 if (layer) |
| 418 layer._reset(layers[i]); | 416 layer._reset(layers[i]); |
| 419 else | 417 else |
| 420 layer = new WebInspector.AgentLayer(this._weakTarget, layers[i])
; | 418 layer = new WebInspector.AgentLayer(this._target, layers[i]); |
| 421 this._layersById[layerId] = layer; | 419 this._layersById[layerId] = layer; |
| 422 if (layers[i].backendNodeId) { | 420 if (layers[i].backendNodeId) { |
| 423 layer._setNode(this._nodeForId(this._backendNodeIdToNodeId[layer
s[i].backendNodeId])); | 421 layer._setNode(this._nodeForId(this._backendNodeIdToNodeId[layer
s[i].backendNodeId])); |
| 424 if (!this._contentRoot) | 422 if (!this._contentRoot) |
| 425 this._contentRoot = layer; | 423 this._contentRoot = layer; |
| 426 } | 424 } |
| 427 var parentId = layer.parentId(); | 425 var parentId = layer.parentId(); |
| 428 if (parentId) { | 426 if (parentId) { |
| 429 var parent = this._layersById[parentId]; | 427 var parent = this._layersById[parentId]; |
| 430 if (!parent) | 428 if (!parent) |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 | 551 |
| 554 /** | 552 /** |
| 555 * @param {function(!WebInspector.PaintProfilerSnapshot=)} callback | 553 * @param {function(!WebInspector.PaintProfilerSnapshot=)} callback |
| 556 */ | 554 */ |
| 557 requestSnapshot: function(callback) { }, | 555 requestSnapshot: function(callback) { }, |
| 558 } | 556 } |
| 559 | 557 |
| 560 /** | 558 /** |
| 561 * @constructor | 559 * @constructor |
| 562 * @implements {WebInspector.Layer} | 560 * @implements {WebInspector.Layer} |
| 563 * @param {!WeakReference.<!WebInspector.Target>} weakTarget | 561 * @param {?WebInspector.Target} target |
| 564 * @param {!LayerTreeAgent.Layer} layerPayload | 562 * @param {!LayerTreeAgent.Layer} layerPayload |
| 565 */ | 563 */ |
| 566 WebInspector.AgentLayer = function(weakTarget, layerPayload) | 564 WebInspector.AgentLayer = function(target, layerPayload) |
| 567 { | 565 { |
| 568 this._weakTarget = weakTarget; | 566 this._target = target; |
| 569 this._reset(layerPayload); | 567 this._reset(layerPayload); |
| 570 } | 568 } |
| 571 | 569 |
| 572 WebInspector.AgentLayer.prototype = { | 570 WebInspector.AgentLayer.prototype = { |
| 573 /** | 571 /** |
| 574 * @return {string} | 572 * @return {string} |
| 575 */ | 573 */ |
| 576 id: function() | 574 id: function() |
| 577 { | 575 { |
| 578 return this._layerPayload.layerId; | 576 return this._layerPayload.layerId; |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 scrollRects: function() | 737 scrollRects: function() |
| 740 { | 738 { |
| 741 return this._scrollRects; | 739 return this._scrollRects; |
| 742 }, | 740 }, |
| 743 | 741 |
| 744 /** | 742 /** |
| 745 * @param {function(!Array.<string>)} callback | 743 * @param {function(!Array.<string>)} callback |
| 746 */ | 744 */ |
| 747 requestCompositingReasons: function(callback) | 745 requestCompositingReasons: function(callback) |
| 748 { | 746 { |
| 747 if (!this._target) { |
| 748 callback([]); |
| 749 return; |
| 750 } |
| 751 |
| 749 var wrappedCallback = InspectorBackend.wrapClientCallback(callback, "Lay
erTreeAgent.reasonsForCompositingLayer(): ", undefined, []); | 752 var wrappedCallback = InspectorBackend.wrapClientCallback(callback, "Lay
erTreeAgent.reasonsForCompositingLayer(): ", undefined, []); |
| 750 LayerTreeAgent.compositingReasons(this.id(), wrappedCallback); | 753 this._target.layerTreeAgent().compositingReasons(this.id(), wrappedCallb
ack); |
| 751 }, | 754 }, |
| 752 | 755 |
| 753 /** | 756 /** |
| 754 * @param {function(!WebInspector.PaintProfilerSnapshot=)} callback | 757 * @param {function(!WebInspector.PaintProfilerSnapshot=)} callback |
| 755 */ | 758 */ |
| 756 requestSnapshot: function(callback) | 759 requestSnapshot: function(callback) |
| 757 { | 760 { |
| 758 var wrappedCallback = InspectorBackend.wrapClientCallback(callback, "Lay
erTreeAgent.makeSnapshot(): ", WebInspector.PaintProfilerSnapshot.bind(null, thi
s._weakTarget)); | 761 if (!this._target) { |
| 759 LayerTreeAgent.makeSnapshot(this.id(), wrappedCallback); | 762 callback(); |
| 763 return; |
| 764 } |
| 765 |
| 766 var wrappedCallback = InspectorBackend.wrapClientCallback(callback, "Lay
erTreeAgent.makeSnapshot(): ", WebInspector.PaintProfilerSnapshot.bind(null, thi
s._target)); |
| 767 this._target.layerTreeAgent().makeSnapshot(this.id(), wrappedCallback); |
| 760 }, | 768 }, |
| 761 | 769 |
| 762 /** | 770 /** |
| 763 * @param {!DOMAgent.Rect} rect | 771 * @param {!DOMAgent.Rect} rect |
| 764 */ | 772 */ |
| 765 _didPaint: function(rect) | 773 _didPaint: function(rect) |
| 766 { | 774 { |
| 767 this._lastPaintRect = rect; | 775 this._lastPaintRect = rect; |
| 768 this._paintCount = this.paintCount() + 1; | 776 this._paintCount = this.paintCount() + 1; |
| 769 this._image = null; | 777 this._image = null; |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1086 */ | 1094 */ |
| 1087 requestSnapshot: function(callback) | 1095 requestSnapshot: function(callback) |
| 1088 { | 1096 { |
| 1089 var wrappedCallback = InspectorBackend.wrapClientCallback(callback, "Lay
erTreeAgent.makeSnapshot(): ", WebInspector.PaintProfilerSnapshot); | 1097 var wrappedCallback = InspectorBackend.wrapClientCallback(callback, "Lay
erTreeAgent.makeSnapshot(): ", WebInspector.PaintProfilerSnapshot); |
| 1090 LayerTreeAgent.makeSnapshot(this.id(), wrappedCallback); | 1098 LayerTreeAgent.makeSnapshot(this.id(), wrappedCallback); |
| 1091 } | 1099 } |
| 1092 } | 1100 } |
| 1093 | 1101 |
| 1094 /** | 1102 /** |
| 1095 * @constructor | 1103 * @constructor |
| 1096 * @param {!WeakReference.<!WebInspector.Target>} weakTarget | 1104 * @param {?WebInspector.Target} target |
| 1097 */ | 1105 */ |
| 1098 WebInspector.DeferredLayerTree = function(weakTarget) | 1106 WebInspector.DeferredLayerTree = function(target) |
| 1099 { | 1107 { |
| 1100 this._weakTarget = weakTarget; | 1108 this._target = target; |
| 1101 } | 1109 } |
| 1102 | 1110 |
| 1103 WebInspector.DeferredLayerTree.prototype = { | 1111 WebInspector.DeferredLayerTree.prototype = { |
| 1104 /** | 1112 /** |
| 1105 * @param {function(!WebInspector.LayerTreeBase)} callback | 1113 * @param {function(!WebInspector.LayerTreeBase)} callback |
| 1106 */ | 1114 */ |
| 1107 resolve: function(callback) { }, | 1115 resolve: function(callback) { }, |
| 1108 | 1116 |
| 1109 /** | 1117 /** |
| 1110 * @return {!WeakReference.<!WebInspector.Target>} | 1118 * @return {?WebInspector.Target} |
| 1111 */ | 1119 */ |
| 1112 weakTarget: function() | 1120 target: function() |
| 1113 { | 1121 { |
| 1114 return this._weakTarget; | 1122 return this._target; |
| 1115 } | 1123 } |
| 1116 }; | 1124 }; |
| 1117 | 1125 |
| 1118 /** | 1126 /** |
| 1119 * @constructor | 1127 * @constructor |
| 1120 * @extends {WebInspector.DeferredLayerTree} | 1128 * @extends {WebInspector.DeferredLayerTree} |
| 1121 * @param {!WeakReference.<!WebInspector.Target>} weakTarget | 1129 * @param {?WebInspector.Target} target |
| 1122 * @param {!Array.<!LayerTreeAgent.Layer>} layers | 1130 * @param {!Array.<!LayerTreeAgent.Layer>} layers |
| 1123 */ | 1131 */ |
| 1124 WebInspector.DeferredAgentLayerTree = function(weakTarget, layers) | 1132 WebInspector.DeferredAgentLayerTree = function(target, layers) |
| 1125 { | 1133 { |
| 1126 WebInspector.DeferredLayerTree.call(this, weakTarget); | 1134 WebInspector.DeferredLayerTree.call(this, target); |
| 1127 this._layers = layers; | 1135 this._layers = layers; |
| 1128 } | 1136 } |
| 1129 | 1137 |
| 1130 WebInspector.DeferredAgentLayerTree.prototype = { | 1138 WebInspector.DeferredAgentLayerTree.prototype = { |
| 1131 /** | 1139 /** |
| 1132 * @param {function(!WebInspector.LayerTreeBase)} callback | 1140 * @param {function(!WebInspector.LayerTreeBase)} callback |
| 1133 */ | 1141 */ |
| 1134 resolve: function(callback) | 1142 resolve: function(callback) |
| 1135 { | 1143 { |
| 1136 var result = new WebInspector.AgentLayerTree(this._weakTarget); | 1144 var result = new WebInspector.AgentLayerTree(this._target); |
| 1137 result.setLayers(this._layers, callback.bind(null, result)); | 1145 result.setLayers(this._layers, callback.bind(null, result)); |
| 1138 }, | 1146 }, |
| 1139 | 1147 |
| 1140 __proto__: WebInspector.DeferredLayerTree.prototype | 1148 __proto__: WebInspector.DeferredLayerTree.prototype |
| 1141 }; | 1149 }; |
| 1142 | 1150 |
| 1143 /** | 1151 /** |
| 1144 * @constructor | 1152 * @constructor |
| 1145 * @extends {WebInspector.DeferredLayerTree} | 1153 * @extends {WebInspector.DeferredLayerTree} |
| 1146 * @param {!WeakReference.<!WebInspector.Target>} weakTarget | 1154 * @param {?WebInspector.Target} target |
| 1147 * @param {!WebInspector.TracingLayerPayload} root | 1155 * @param {!WebInspector.TracingLayerPayload} root |
| 1148 * @param {!Object} viewportSize | 1156 * @param {!Object} viewportSize |
| 1149 */ | 1157 */ |
| 1150 WebInspector.DeferredTracingLayerTree = function(weakTarget, root, viewportSize) | 1158 WebInspector.DeferredTracingLayerTree = function(target, root, viewportSize) |
| 1151 { | 1159 { |
| 1152 WebInspector.DeferredLayerTree.call(this, weakTarget); | 1160 WebInspector.DeferredLayerTree.call(this, target); |
| 1153 this._root = root; | 1161 this._root = root; |
| 1154 this._viewportSize = viewportSize; | 1162 this._viewportSize = viewportSize; |
| 1155 } | 1163 } |
| 1156 | 1164 |
| 1157 WebInspector.DeferredTracingLayerTree.prototype = { | 1165 WebInspector.DeferredTracingLayerTree.prototype = { |
| 1158 /** | 1166 /** |
| 1159 * @param {function(!WebInspector.LayerTreeBase)} callback | 1167 * @param {function(!WebInspector.LayerTreeBase)} callback |
| 1160 */ | 1168 */ |
| 1161 resolve: function(callback) | 1169 resolve: function(callback) |
| 1162 { | 1170 { |
| 1163 var result = new WebInspector.TracingLayerTree(this._weakTarget); | 1171 var result = new WebInspector.TracingLayerTree(this._target); |
| 1164 result.setViewportSize(this._viewportSize); | 1172 result.setViewportSize(this._viewportSize); |
| 1165 result.setLayers(this._root, callback.bind(null, result)); | 1173 result.setLayers(this._root, callback.bind(null, result)); |
| 1166 }, | 1174 }, |
| 1167 | 1175 |
| 1168 __proto__: WebInspector.DeferredLayerTree.prototype | 1176 __proto__: WebInspector.DeferredLayerTree.prototype |
| 1169 }; | 1177 }; |
| 1170 | 1178 |
| 1171 /** | 1179 /** |
| 1172 * @constructor | 1180 * @constructor |
| 1173 * @implements {LayerTreeAgent.Dispatcher} | 1181 * @implements {LayerTreeAgent.Dispatcher} |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1189 | 1197 |
| 1190 /** | 1198 /** |
| 1191 * @param {!LayerTreeAgent.LayerId} layerId | 1199 * @param {!LayerTreeAgent.LayerId} layerId |
| 1192 * @param {!DOMAgent.Rect} clipRect | 1200 * @param {!DOMAgent.Rect} clipRect |
| 1193 */ | 1201 */ |
| 1194 layerPainted: function(layerId, clipRect) | 1202 layerPainted: function(layerId, clipRect) |
| 1195 { | 1203 { |
| 1196 this._layerTreeModel._layerPainted(layerId, clipRect); | 1204 this._layerTreeModel._layerPainted(layerId, clipRect); |
| 1197 } | 1205 } |
| 1198 } | 1206 } |
| OLD | NEW |