| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "TreeSynchronizer.h" | 7 #include "TreeSynchronizer.h" |
| 8 | 8 |
| 9 #include "CCLayerImpl.h" | 9 #include "CCLayerImpl.h" |
| 10 #include "CCScrollbarAnimationController.h" | 10 #include "CCScrollbarAnimationController.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 return newTree.release(); | 29 return newTree.release(); |
| 30 } | 30 } |
| 31 | 31 |
| 32 void TreeSynchronizer::collectExistingCCLayerImplRecursive(OwnPtrCCLayerImplMap&
oldLayers, PassOwnPtr<CCLayerImpl> popCCLayerImpl) | 32 void TreeSynchronizer::collectExistingCCLayerImplRecursive(OwnPtrCCLayerImplMap&
oldLayers, PassOwnPtr<CCLayerImpl> popCCLayerImpl) |
| 33 { | 33 { |
| 34 OwnPtr<CCLayerImpl> ccLayerImpl = popCCLayerImpl; | 34 OwnPtr<CCLayerImpl> ccLayerImpl = popCCLayerImpl; |
| 35 | 35 |
| 36 if (!ccLayerImpl) | 36 if (!ccLayerImpl) |
| 37 return; | 37 return; |
| 38 | 38 |
| 39 Vector<OwnPtr<CCLayerImpl> >& children = ccLayerImpl->m_children; | 39 OwnPtrVector<CCLayerImpl>& children = ccLayerImpl->m_children; |
| 40 for (size_t i = 0; i < children.size(); ++i) | 40 for (size_t i = 0; i < children.size(); ++i) |
| 41 collectExistingCCLayerImplRecursive(oldLayers, children[i].release()); | 41 collectExistingCCLayerImplRecursive(oldLayers, children.take(i)); |
| 42 | 42 |
| 43 collectExistingCCLayerImplRecursive(oldLayers, ccLayerImpl->m_maskLayer.rele
ase()); | 43 collectExistingCCLayerImplRecursive(oldLayers, ccLayerImpl->m_maskLayer.rele
ase()); |
| 44 collectExistingCCLayerImplRecursive(oldLayers, ccLayerImpl->m_replicaLayer.r
elease()); | 44 collectExistingCCLayerImplRecursive(oldLayers, ccLayerImpl->m_replicaLayer.r
elease()); |
| 45 | 45 |
| 46 int id = ccLayerImpl->id(); | 46 int id = ccLayerImpl->id(); |
| 47 oldLayers.set(id, ccLayerImpl.release()); | 47 oldLayers.set(id, ccLayerImpl.release()); |
| 48 } | 48 } |
| 49 | 49 |
| 50 PassOwnPtr<CCLayerImpl> TreeSynchronizer::reuseOrCreateCCLayerImpl(RawPtrCCLayer
ImplMap& newLayers, OwnPtrCCLayerImplMap& oldLayers, LayerChromium* layer) | 50 PassOwnPtr<CCLayerImpl> TreeSynchronizer::reuseOrCreateCCLayerImpl(RawPtrCCLayer
ImplMap& newLayers, OwnPtrCCLayerImplMap& oldLayers, LayerChromium* layer) |
| 51 { | 51 { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 CCLayerImpl* ccScrollLayerImpl = newLayers.get(scrollbarLayer->scrollLayerId
()); | 103 CCLayerImpl* ccScrollLayerImpl = newLayers.get(scrollbarLayer->scrollLayerId
()); |
| 104 ASSERT(ccScrollLayerImpl); | 104 ASSERT(ccScrollLayerImpl); |
| 105 | 105 |
| 106 if (ccScrollbarLayerImpl->orientation() == WebKit::WebScrollbar::Horizontal) | 106 if (ccScrollbarLayerImpl->orientation() == WebKit::WebScrollbar::Horizontal) |
| 107 ccScrollLayerImpl->setHorizontalScrollbarLayer(ccScrollbarLayerImpl); | 107 ccScrollLayerImpl->setHorizontalScrollbarLayer(ccScrollbarLayerImpl); |
| 108 else | 108 else |
| 109 ccScrollLayerImpl->setVerticalScrollbarLayer(ccScrollbarLayerImpl); | 109 ccScrollLayerImpl->setVerticalScrollbarLayer(ccScrollbarLayerImpl); |
| 110 } | 110 } |
| 111 | 111 |
| 112 } // namespace cc | 112 } // namespace cc |
| OLD | NEW |