| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright (c) 2013 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
| 5 found in the LICENSE file. | 5 found in the LICENSE file. |
| 6 --> | 6 --> |
| 7 | 7 |
| 8 <link rel="stylesheet" href="/tracing/ui/extras/chrome/cc/layer_picker.css"> | 8 <link rel="stylesheet" href="/tracing/ui/extras/chrome/cc/layer_picker.css"> |
| 9 | 9 |
| 10 <link rel="import" href="/tracing/base/unit.html"> | 10 <link rel="import" href="/tracing/base/unit.html"> |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 this.lthiSnapshot_ = lthiSnapshot; | 75 this.lthiSnapshot_ = lthiSnapshot; |
| 76 this.updateContents_(); | 76 this.updateContents_(); |
| 77 }, | 77 }, |
| 78 | 78 |
| 79 get whichTree() { | 79 get whichTree() { |
| 80 return this.renderPassQuads_ ? constants.ACTIVE_TREE : this.whichTree_; | 80 return this.renderPassQuads_ ? constants.ACTIVE_TREE : this.whichTree_; |
| 81 }, | 81 }, |
| 82 | 82 |
| 83 set whichTree(whichTree) { | 83 set whichTree(whichTree) { |
| 84 this.whichTree_ = whichTree; | 84 this.whichTree_ = whichTree; |
| 85 this.renderPassQuads_ = (whichTree == RENDER_PASS_QUADS); | 85 this.renderPassQuads_ = (whichTree === RENDER_PASS_QUADS); |
| 86 this.updateContents_(); | 86 this.updateContents_(); |
| 87 tr.b.dispatchSimpleEvent(this, 'selection-change', false); | 87 tr.b.dispatchSimpleEvent(this, 'selection-change', false); |
| 88 }, | 88 }, |
| 89 | 89 |
| 90 get layerTreeImpl() { | 90 get layerTreeImpl() { |
| 91 if (this.lthiSnapshot === undefined) | 91 if (this.lthiSnapshot === undefined) |
| 92 return undefined; | 92 return undefined; |
| 93 return this.lthiSnapshot.getTree(this.whichTree); | 93 return this.lthiSnapshot.getTree(this.whichTree); |
| 94 }, | 94 }, |
| 95 | 95 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 var tree = this.lthiSnapshot_.getTree(this.whichTree_); | 135 var tree = this.lthiSnapshot_.getTree(this.whichTree_); |
| 136 if (!tree) | 136 if (!tree) |
| 137 return []; | 137 return []; |
| 138 | 138 |
| 139 var layerInfos = []; | 139 var layerInfos = []; |
| 140 | 140 |
| 141 var showPureTransformLayers = this.showPureTransformLayers_; | 141 var showPureTransformLayers = this.showPureTransformLayers_; |
| 142 | 142 |
| 143 function isPureTransformLayer(layer) { | 143 function isPureTransformLayer(layer) { |
| 144 if (layer.args.compositingReasons && | 144 if (layer.args.compositingReasons && |
| 145 layer.args.compositingReasons.length != 1 && | 145 layer.args.compositingReasons.length !== 1 && |
| 146 layer.args.compositingReasons[0] != 'No reasons given') | 146 layer.args.compositingReasons[0] !== 'No reasons given') |
| 147 return false; | 147 return false; |
| 148 | 148 |
| 149 if (layer.args.drawsContent) | 149 if (layer.args.drawsContent) |
| 150 return false; | 150 return false; |
| 151 | 151 |
| 152 return true; | 152 return true; |
| 153 } | 153 } |
| 154 var visitedLayers = {}; | 154 var visitedLayers = {}; |
| 155 function visitLayer(layer, depth, isMask, isReplica) { | 155 function visitLayer(layer, depth, isMask, isReplica) { |
| 156 if (visitedLayers[layer.layerId]) | 156 if (visitedLayers[layer.layerId]) |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 var id = renderPassInfo.id; | 198 var id = renderPassInfo.id; |
| 199 | 199 |
| 200 var item = this.createElementWithDepth_(renderPassInfo.depth); | 200 var item = this.createElementWithDepth_(renderPassInfo.depth); |
| 201 var labelEl = Polymer.dom(item).appendChild(tr.ui.b.createSpan()); | 201 var labelEl = Polymer.dom(item).appendChild(tr.ui.b.createSpan()); |
| 202 | 202 |
| 203 Polymer.dom(labelEl).textContent = renderPassInfo.name + ' ' + id; | 203 Polymer.dom(labelEl).textContent = renderPassInfo.name + ' ' + id; |
| 204 item.renderPass = renderPass; | 204 item.renderPass = renderPass; |
| 205 item.renderPassId = id; | 205 item.renderPassId = id; |
| 206 Polymer.dom(this.itemList_).appendChild(item); | 206 Polymer.dom(this.itemList_).appendChild(item); |
| 207 | 207 |
| 208 if (id == selectedRenderPassId) { | 208 if (id === selectedRenderPassId) { |
| 209 renderPass.selectionState = | 209 renderPass.selectionState = |
| 210 tr.model.SelectionState.SELECTED; | 210 tr.model.SelectionState.SELECTED; |
| 211 } | 211 } |
| 212 }, this); | 212 }, this); |
| 213 }, | 213 }, |
| 214 | 214 |
| 215 updateLayerContents_: function() { | 215 updateLayerContents_: function() { |
| 216 this.changingItemSelection_ = true; | 216 this.changingItemSelection_ = true; |
| 217 try { | 217 try { |
| 218 this.itemList_.clear(); | 218 this.itemList_.clear(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 240 if ((layer.gpuMemoryUsageInBytes !== undefined) && | 240 if ((layer.gpuMemoryUsageInBytes !== undefined) && |
| 241 (layer.gpuMemoryUsageInBytes > 0)) { | 241 (layer.gpuMemoryUsageInBytes > 0)) { |
| 242 var gpuUsageStr = tr.b.Unit.byName.sizeInBytes.format( | 242 var gpuUsageStr = tr.b.Unit.byName.sizeInBytes.format( |
| 243 layer.gpuMemoryUsageInBytes); | 243 layer.gpuMemoryUsageInBytes); |
| 244 Polymer.dom(notesEl).textContent += ' (' + gpuUsageStr + ' MiB)'; | 244 Polymer.dom(notesEl).textContent += ' (' + gpuUsageStr + ' MiB)'; |
| 245 } | 245 } |
| 246 | 246 |
| 247 item.layer = layer; | 247 item.layer = layer; |
| 248 Polymer.dom(this.itemList_).appendChild(item); | 248 Polymer.dom(this.itemList_).appendChild(item); |
| 249 | 249 |
| 250 if (layer.layerId == selectedLayerId) { | 250 if (layer.layerId === selectedLayerId) { |
| 251 layer.selectionState = tr.model.SelectionState.SELECTED; | 251 layer.selectionState = tr.model.SelectionState.SELECTED; |
| 252 item.selected = true; | 252 item.selected = true; |
| 253 } | 253 } |
| 254 }, this); | 254 }, this); |
| 255 } finally { | 255 } finally { |
| 256 this.changingItemSelection_ = false; | 256 this.changingItemSelection_ = false; |
| 257 } | 257 } |
| 258 }, | 258 }, |
| 259 | 259 |
| 260 createElementWithDepth_: function(depth) { | 260 createElementWithDepth_: function(depth) { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 this.selection_ = new tr.ui.e.chrome.cc.LayerSelection(selectedLayer); | 305 this.selection_ = new tr.ui.e.chrome.cc.LayerSelection(selectedLayer); |
| 306 else | 306 else |
| 307 this.selection_ = undefined; | 307 this.selection_ = undefined; |
| 308 }, | 308 }, |
| 309 | 309 |
| 310 get selection() { | 310 get selection() { |
| 311 return this.selection_; | 311 return this.selection_; |
| 312 }, | 312 }, |
| 313 | 313 |
| 314 set selection(selection) { | 314 set selection(selection) { |
| 315 if (this.selection_ == selection) | 315 if (this.selection_ === selection) |
| 316 return; | 316 return; |
| 317 this.selection_ = selection; | 317 this.selection_ = selection; |
| 318 this.updateContents_(); | 318 this.updateContents_(); |
| 319 } | 319 } |
| 320 }; | 320 }; |
| 321 | 321 |
| 322 return { | 322 return { |
| 323 LayerPicker: LayerPicker | 323 LayerPicker: LayerPicker |
| 324 }; | 324 }; |
| 325 }); | 325 }); |
| 326 </script> | 326 </script> |
| OLD | NEW |