| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 childLayer->setParent(this); | 231 childLayer->setParent(this); |
| 232 | 232 |
| 233 if (!found) | 233 if (!found) |
| 234 m_children.append(childLayer); | 234 m_children.append(childLayer); |
| 235 | 235 |
| 236 updateChildList(); | 236 updateChildList(); |
| 237 } | 237 } |
| 238 | 238 |
| 239 void GraphicsLayer::removeAllChildren() { | 239 void GraphicsLayer::removeAllChildren() { |
| 240 while (!m_children.isEmpty()) { | 240 while (!m_children.isEmpty()) { |
| 241 GraphicsLayer* curLayer = m_children.last(); | 241 GraphicsLayer* curLayer = m_children.back(); |
| 242 ASSERT(curLayer->parent()); | 242 ASSERT(curLayer->parent()); |
| 243 curLayer->removeFromParent(); | 243 curLayer->removeFromParent(); |
| 244 } | 244 } |
| 245 } | 245 } |
| 246 | 246 |
| 247 void GraphicsLayer::removeFromParent() { | 247 void GraphicsLayer::removeFromParent() { |
| 248 if (m_parent) { | 248 if (m_parent) { |
| 249 // We use reverseFind so that removeAllChildren() isn't n^2. | 249 // We use reverseFind so that removeAllChildren() isn't n^2. |
| 250 m_parent->m_children.remove(m_parent->m_children.reverseFind(this)); | 250 m_parent->m_children.remove(m_parent->m_children.reverseFind(this)); |
| 251 setParent(0); | 251 setParent(0); |
| (...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1308 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) { | 1308 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) { |
| 1309 if (!layer) { | 1309 if (!layer) { |
| 1310 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil)."; | 1310 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil)."; |
| 1311 return; | 1311 return; |
| 1312 } | 1312 } |
| 1313 | 1313 |
| 1314 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); | 1314 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); |
| 1315 LOG(INFO) << output.utf8().data(); | 1315 LOG(INFO) << output.utf8().data(); |
| 1316 } | 1316 } |
| 1317 #endif | 1317 #endif |
| OLD | NEW |