Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: Source/core/inspector/InspectorLayerTreeAgent.cpp

Issue 26110004: Defer the real work in updateCompositingLayers until it's really needed. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: inspector needs fixing, otherwise good to go Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 if (!node) { 190 if (!node) {
191 *errorString = "Provided node id doesn't match any known node"; 191 *errorString = "Provided node id doesn't match any known node";
192 return; 192 return;
193 } 193 }
194 RenderObject* renderer = node->renderer(); 194 RenderObject* renderer = node->renderer();
195 if (!renderer) { 195 if (!renderer) {
196 *errorString = "Node for provided node id doesn't have a renderer"; 196 *errorString = "Node for provided node id doesn't have a renderer";
197 return; 197 return;
198 } 198 }
199 RenderLayer* enclosingLayer = renderer->enclosingLayer(); 199 RenderLayer* enclosingLayer = renderer->enclosingLayer();
200 if (!enclosingLayer->enclosingCompositingLayer() || !enclosingLayer->enclosi ngCompositingLayer()->compositedLayerMapping()) {
201 *errorString = "No CompositedLayerMapping for the provided node";
caseq 2013/10/17 12:37:38 When are we supposed to hit this? enclosingComposi
shawnsingh 2013/10/17 19:00:05 Yeah - as you suspected, this issue occurs when co
202 return;
203 }
200 GraphicsLayer* enclosingGraphicsLayer = enclosingLayer->enclosingCompositing Layer()->compositedLayerMapping()->childForSuperlayers(); 204 GraphicsLayer* enclosingGraphicsLayer = enclosingLayer->enclosingCompositing Layer()->compositedLayerMapping()->childForSuperlayers();
201 buildLayerIdToNodeIdMap(errorString, enclosingLayer, layerIdToNodeIdMap); 205 buildLayerIdToNodeIdMap(errorString, enclosingLayer, layerIdToNodeIdMap);
202 gatherGraphicsLayers(enclosingGraphicsLayer, layerIdToNodeIdMap, layers); 206 gatherGraphicsLayers(enclosingGraphicsLayer, layerIdToNodeIdMap, layers);
203 } 207 }
204 208
205 void InspectorLayerTreeAgent::buildLayerIdToNodeIdMap(ErrorString* errorString, RenderLayer* root, LayerIdToNodeIdMap& layerIdToNodeIdMap) 209 void InspectorLayerTreeAgent::buildLayerIdToNodeIdMap(ErrorString* errorString, RenderLayer* root, LayerIdToNodeIdMap& layerIdToNodeIdMap)
206 { 210 {
207 if (root->isComposited()) { 211 if (root->isComposited()) {
208 if (Node* node = root->renderer()->generatingNode()) { 212 if (Node* node = root->renderer()->generatingNode()) {
209 GraphicsLayer* graphicsLayer = root->compositedLayerMapping()->child ForSuperlayers(); 213 GraphicsLayer* graphicsLayer = root->compositedLayerMapping()->child ForSuperlayers();
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 continue; 328 continue;
325 reasonStrings->addItem(compositingReasonNames[i].protocolName); 329 reasonStrings->addItem(compositingReasonNames[i].protocolName);
326 #ifndef _NDEBUG 330 #ifndef _NDEBUG
327 reasonsBitmask &= ~compositingReasonNames[i].mask; 331 reasonsBitmask &= ~compositingReasonNames[i].mask;
328 #endif 332 #endif
329 } 333 }
330 ASSERT(!reasonsBitmask); 334 ASSERT(!reasonsBitmask);
331 } 335 }
332 336
333 } // namespace WebCore 337 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698