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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 return; | 187 return; |
188 var root; | 188 var root; |
189 var oldLayersById = this._layersById; | 189 var oldLayersById = this._layersById; |
190 this._layersById = {}; | 190 this._layersById = {}; |
191 for (var i = 0; i < layers.length; ++i) { | 191 for (var i = 0; i < layers.length; ++i) { |
192 var layerId = layers[i].layerId; | 192 var layerId = layers[i].layerId; |
193 var layer = oldLayersById[layerId]; | 193 var layer = oldLayersById[layerId]; |
194 if (layer) | 194 if (layer) |
195 layer._reset(layers[i]); | 195 layer._reset(layers[i]); |
196 else | 196 else |
197 layer = new Layers.AgentLayer(this._target, layers[i]); | 197 layer = new Layers.AgentLayer(this.target(), layers[i]); |
198 this._layersById[layerId] = layer; | 198 this._layersById[layerId] = layer; |
199 var backendNodeId = layers[i].backendNodeId; | 199 var backendNodeId = layers[i].backendNodeId; |
200 if (backendNodeId) | 200 if (backendNodeId) |
201 layer._setNode(this._backendNodeIdToNode.get(backendNodeId)); | 201 layer._setNode(this._backendNodeIdToNode.get(backendNodeId)); |
202 if (!this.contentRoot() && layer.drawsContent()) | 202 if (!this.contentRoot() && layer.drawsContent()) |
203 this.setContentRoot(layer); | 203 this.setContentRoot(layer); |
204 var parentId = layer.parentId(); | 204 var parentId = layer.parentId(); |
205 if (parentId) { | 205 if (parentId) { |
206 var parent = this._layersById[parentId]; | 206 var parent = this._layersById[parentId]; |
207 if (!parent) | 207 if (!parent) |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 | 560 |
561 /** | 561 /** |
562 * @override | 562 * @override |
563 * @param {!Protocol.LayerTree.LayerId} layerId | 563 * @param {!Protocol.LayerTree.LayerId} layerId |
564 * @param {!Protocol.DOM.Rect} clipRect | 564 * @param {!Protocol.DOM.Rect} clipRect |
565 */ | 565 */ |
566 layerPainted(layerId, clipRect) { | 566 layerPainted(layerId, clipRect) { |
567 this._layerTreeModel._layerPainted(layerId, clipRect); | 567 this._layerTreeModel._layerPainted(layerId, clipRect); |
568 } | 568 } |
569 }; | 569 }; |
OLD | NEW |