Changeset 108886 in webkit
- Timestamp:
- Feb 24, 2012 8:09:52 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 47 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r108885 r108886 1 2012-02-24 Tien-Ren Chen <trchen@chromium.org> 2 3 [chromium] Replace RefPtr with OwnPtr for CCLayerImpl tree structure 4 https://bugs.webkit.org/show_bug.cgi?id=78404 5 6 Reviewed by James Robinson. 7 8 No new tests. Updated existing test to reflect changes. 9 10 * platform/graphics/chromium/CanvasLayerChromium.cpp: 11 (WebCore::CanvasLayerChromium::createCCLayerImpl): 12 * platform/graphics/chromium/CanvasLayerChromium.h: 13 (CanvasLayerChromium): 14 * platform/graphics/chromium/LayerChromium.cpp: 15 (WebCore::LayerChromium::createCCLayerImpl): 16 * platform/graphics/chromium/LayerChromium.h: 17 (LayerChromium): 18 * platform/graphics/chromium/PluginLayerChromium.cpp: 19 (WebCore::PluginLayerChromium::createCCLayerImpl): 20 * platform/graphics/chromium/PluginLayerChromium.h: 21 (PluginLayerChromium): 22 * platform/graphics/chromium/SolidColorLayerChromium.cpp: 23 (WebCore::SolidColorLayerChromium::createCCLayerImpl): 24 * platform/graphics/chromium/SolidColorLayerChromium.h: 25 (SolidColorLayerChromium): 26 * platform/graphics/chromium/TiledLayerChromium.cpp: 27 (WebCore::TiledLayerChromium::createCCLayerImpl): 28 * platform/graphics/chromium/TiledLayerChromium.h: 29 (TiledLayerChromium): 30 * platform/graphics/chromium/TreeSynchronizer.cpp: 31 (WebCore::TreeSynchronizer::synchronizeTrees): 32 (WebCore::TreeSynchronizer::collectExistingCCLayerImplRecursive): 33 (WebCore): 34 (WebCore::TreeSynchronizer::reuseOrCreateCCLayerImpl): 35 (WebCore::TreeSynchronizer::synchronizeTreeRecursive): 36 * platform/graphics/chromium/TreeSynchronizer.h: 37 (TreeSynchronizer): 38 * platform/graphics/chromium/VideoLayerChromium.cpp: 39 (WebCore::VideoLayerChromium::createCCLayerImpl): 40 * platform/graphics/chromium/VideoLayerChromium.h: 41 (VideoLayerChromium): 42 * platform/graphics/chromium/cc/CCCanvasLayerImpl.h: 43 (WebCore::CCCanvasLayerImpl::create): 44 * platform/graphics/chromium/cc/CCDamageTracker.cpp: 45 (WebCore::CCDamageTracker::updateDamageTrackingState): 46 (WebCore::CCDamageTracker::trackDamageFromActiveLayers): 47 * platform/graphics/chromium/cc/CCDamageTracker.h: 48 (CCDamageTracker): 49 * platform/graphics/chromium/cc/CCLayerImpl.cpp: 50 (WebCore::CCLayerImpl::CCLayerImpl): 51 (WebCore::CCLayerImpl::addChild): 52 (WebCore::sortLayers): 53 (WebCore::CCLayerImpl::setMaskLayer): 54 (WebCore::CCLayerImpl::setReplicaLayer): 55 * platform/graphics/chromium/cc/CCLayerImpl.h: 56 (WebCore::CCLayerImpl::create): 57 (WebCore::CCLayerImpl::children): 58 (CCLayerImpl): 59 (WebCore): 60 * platform/graphics/chromium/cc/CCLayerIterator.cpp: 61 (WebCore): 62 (WebCore::CCLayerIteratorActions::BackToFront::begin): 63 (WebCore::CCLayerIteratorActions::BackToFront::end): 64 (WebCore::CCLayerIteratorActions::BackToFront::next): 65 (WebCore::CCLayerIteratorActions::FrontToBack::begin): 66 (WebCore::CCLayerIteratorActions::FrontToBack::end): 67 (WebCore::CCLayerIteratorActions::FrontToBack::next): 68 (WebCore::CCLayerIteratorActions::FrontToBack::goToHighestInSubtree): 69 * platform/graphics/chromium/cc/CCLayerIterator.h: 70 (WebCore): 71 (CCLayerIterator): 72 (WebCore::CCLayerIterator::begin): 73 (WebCore::CCLayerIterator::end): 74 (WebCore::CCLayerIterator::targetRenderSurfaceLayer): 75 (WebCore::CCLayerIterator::CCLayerIterator): 76 (WebCore::CCLayerIterator::getRawPtr): 77 (WebCore::CCLayerIterator::currentLayer): 78 (WebCore::CCLayerIterator::targetRenderSurfaceChildren): 79 (BackToFront): 80 (FrontToBack): 81 * platform/graphics/chromium/cc/CCLayerSorter.cpp: 82 (WebCore::CCLayerSorter::createGraphNodes): 83 * platform/graphics/chromium/cc/CCLayerSorter.h: 84 (CCLayerSorter): 85 * platform/graphics/chromium/cc/CCLayerTreeHost.cpp: 86 (WebCore::CCLayerTreeHost::finishCommitOnImplThread): 87 (WebCore::CCLayerTreeHost::didBecomeInvisibleOnImplThread): 88 (WebCore::CCLayerTreeHost::reserveTextures): 89 (WebCore::CCLayerTreeHost::paintLayerContents): 90 (WebCore::CCLayerTreeHost::updateCompositorResources): 91 * platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp: 92 (WebCore): 93 (WebCore::calculateDrawTransformsAndVisibilityInternal): 94 (WebCore::walkLayersAndCalculateVisibleLayerRects): 95 (WebCore::CCLayerTreeHostCommon::calculateDrawTransformsAndVisibility): 96 * platform/graphics/chromium/cc/CCLayerTreeHostCommon.h: 97 (CCLayerTreeHostCommon): 98 * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp: 99 (WebCore::CCLayerTreeHostImpl::CCLayerTreeHostImpl): 100 (WebCore::CCLayerTreeHostImpl::trackDamageForAllSurfaces): 101 (WebCore::CCLayerTreeHostImpl::calculateRenderPasses): 102 (WebCore::CCLayerTreeHostImpl::drawLayers): 103 (WebCore::CCLayerTreeHostImpl::setRootLayer): 104 * platform/graphics/chromium/cc/CCLayerTreeHostImpl.h: 105 (CCLayerTreeHostImpl): 106 (WebCore::CCLayerTreeHostImpl::releaseRootLayer): 107 (WebCore::CCLayerTreeHostImpl::scrollLayer): 108 * platform/graphics/chromium/cc/CCPluginLayerImpl.h: 109 (WebCore::CCPluginLayerImpl::create): 110 * platform/graphics/chromium/cc/CCRenderSurface.h: 111 (WebCore::CCRenderSurface::layerList): 112 (CCRenderSurface): 113 * platform/graphics/chromium/cc/CCSolidColorLayerImpl.h: 114 (WebCore::CCSolidColorLayerImpl::create): 115 * platform/graphics/chromium/cc/CCTiledLayerImpl.h: 116 (WebCore::CCTiledLayerImpl::create): 117 * platform/graphics/chromium/cc/CCVideoLayerImpl.h: 118 (WebCore::CCVideoLayerImpl::create): 119 1 120 2012-02-24 Andreas Kling <awesomekling@apple.com> 2 121 -
trunk/Source/WebCore/platform/graphics/chromium/CanvasLayerChromium.cpp
r105460 r108886 46 46 } 47 47 48 Pass RefPtr<CCLayerImpl> CanvasLayerChromium::createCCLayerImpl()48 PassOwnPtr<CCLayerImpl> CanvasLayerChromium::createCCLayerImpl() 49 49 { 50 50 return CCCanvasLayerImpl::create(m_layerId); -
trunk/Source/WebCore/platform/graphics/chromium/CanvasLayerChromium.h
r105460 r108886 42 42 class CanvasLayerChromium : public LayerChromium { 43 43 public: 44 virtual Pass RefPtr<CCLayerImpl> createCCLayerImpl();44 virtual PassOwnPtr<CCLayerImpl> createCCLayerImpl(); 45 45 46 46 protected: -
trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp
r108880 r108886 528 528 } 529 529 530 Pass RefPtr<CCLayerImpl> LayerChromium::createCCLayerImpl()530 PassOwnPtr<CCLayerImpl> LayerChromium::createCCLayerImpl() 531 531 { 532 532 return CCLayerImpl::create(m_layerId); -
trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h
r108880 r108886 45 45 46 46 #include <wtf/OwnPtr.h> 47 #include <wtf/PassOwnPtr.h> 47 48 #include <wtf/PassRefPtr.h> 48 49 #include <wtf/RefCounted.h> … … 257 258 258 259 // Constructs a CCLayerImpl of the correct runtime type for this LayerChromium type. 259 virtual Pass RefPtr<CCLayerImpl> createCCLayerImpl();260 virtual PassOwnPtr<CCLayerImpl> createCCLayerImpl(); 260 261 int m_layerId; 261 262 -
trunk/Source/WebCore/platform/graphics/chromium/PluginLayerChromium.cpp
r105460 r108886 64 64 } 65 65 66 Pass RefPtr<CCLayerImpl> PluginLayerChromium::createCCLayerImpl()66 PassOwnPtr<CCLayerImpl> PluginLayerChromium::createCCLayerImpl() 67 67 { 68 68 return CCPluginLayerImpl::create(m_layerId); -
trunk/Source/WebCore/platform/graphics/chromium/PluginLayerChromium.h
r105460 r108886 40 40 virtual void updateCompositorResources(GraphicsContext3D*, CCTextureUpdater&); 41 41 42 virtual Pass RefPtr<CCLayerImpl> createCCLayerImpl();42 virtual PassOwnPtr<CCLayerImpl> createCCLayerImpl(); 43 43 44 44 // Code path for plugins which supply their own texture ID. -
trunk/Source/WebCore/platform/graphics/chromium/SolidColorLayerChromium.cpp
r105634 r108886 34 34 namespace WebCore { 35 35 36 Pass RefPtr<CCLayerImpl> SolidColorLayerChromium::createCCLayerImpl()36 PassOwnPtr<CCLayerImpl> SolidColorLayerChromium::createCCLayerImpl() 37 37 { 38 38 return CCSolidColorLayerImpl::create(id()); -
trunk/Source/WebCore/platform/graphics/chromium/SolidColorLayerChromium.h
r105634 r108886 39 39 class SolidColorLayerChromium : public LayerChromium { 40 40 public: 41 virtual Pass RefPtr<CCLayerImpl> createCCLayerImpl();41 virtual PassOwnPtr<CCLayerImpl> createCCLayerImpl(); 42 42 static PassRefPtr<SolidColorLayerChromium> create(); 43 43 -
trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
r108431 r108886 98 98 } 99 99 100 Pass RefPtr<CCLayerImpl> TiledLayerChromium::createCCLayerImpl()100 PassOwnPtr<CCLayerImpl> TiledLayerChromium::createCCLayerImpl() 101 101 { 102 102 return CCTiledLayerImpl::create(id()); -
trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h
r107177 r108886 103 103 104 104 private: 105 virtual Pass RefPtr<CCLayerImpl> createCCLayerImpl();105 virtual PassOwnPtr<CCLayerImpl> createCCLayerImpl(); 106 106 107 107 void createTilerIfNeeded(); -
trunk/Source/WebCore/platform/graphics/chromium/TreeSynchronizer.cpp
r95901 r108886 34 34 namespace WebCore { 35 35 36 void TreeSynchronizer::addCCLayerImplsToMapRecursive(CCLayerImplMap& map, CCLayerImpl* ccLayerImpl)36 PassOwnPtr<CCLayerImpl> TreeSynchronizer::synchronizeTrees(LayerChromium* layerChromiumRoot, PassOwnPtr<CCLayerImpl> oldCCLayerImplRoot) 37 37 { 38 map.set(ccLayerImpl->id(), ccLayerImpl); 38 CCLayerImplMap map; 39 collectExistingCCLayerImplRecursive(map, oldCCLayerImplRoot); 39 40 40 const Vector<RefPtr<CCLayerImpl> >& children = ccLayerImpl->children(); 41 for (size_t i = 0; i < children.size(); ++i) 42 addCCLayerImplsToMapRecursive(map, children[i].get()); 43 44 if (CCLayerImpl* maskLayer = ccLayerImpl->maskLayer()) 45 addCCLayerImplsToMapRecursive(map, maskLayer); 46 47 if (CCLayerImpl* replicaLayer = ccLayerImpl->replicaLayer()) 48 addCCLayerImplsToMapRecursive(map, replicaLayer); 41 return synchronizeTreeRecursive(map, layerChromiumRoot); 49 42 } 50 43 51 PassRefPtr<CCLayerImpl> TreeSynchronizer::synchronizeTreeRecursive(LayerChromium* layer, CCLayerImplMap& map)44 void TreeSynchronizer::collectExistingCCLayerImplRecursive(CCLayerImplMap& map, PassOwnPtr<CCLayerImpl> popCCLayerImpl) 52 45 { 53 RefPtr<CCLayerImpl> ccLayerImpl; 54 CCLayerImplMap::iterator it = map.find(layer->id()); 55 if (it != map.end()) { 56 ccLayerImpl = it->second; // We already have an entry for this, we just need to reparent it. 57 ccLayerImpl->clearChildList(); 58 } else { 59 ccLayerImpl = layer->createCCLayerImpl(); 60 map.set(layer->id(), ccLayerImpl); // Add it to the map so other layers referencing this one can pick it up. 61 } 46 OwnPtr<CCLayerImpl> ccLayerImpl = popCCLayerImpl; 62 47 48 if (!ccLayerImpl) 49 return; 50 51 Vector<OwnPtr<CCLayerImpl> >& children = ccLayerImpl->m_children; 52 for (size_t i = 0; i < children.size(); ++i) 53 collectExistingCCLayerImplRecursive(map, children[i].release()); 54 55 collectExistingCCLayerImplRecursive(map, ccLayerImpl->m_maskLayer.release()); 56 collectExistingCCLayerImplRecursive(map, ccLayerImpl->m_replicaLayer.release()); 57 58 int id = ccLayerImpl->id(); 59 map.set(id, ccLayerImpl.release()); 60 } 61 62 PassOwnPtr<CCLayerImpl> TreeSynchronizer::reuseOrCreateCCLayerImpl(CCLayerImplMap& map, LayerChromium* layer) 63 { 64 OwnPtr<CCLayerImpl> ccLayerImpl = map.take(layer->id()); 65 66 if (!ccLayerImpl) 67 return layer->createCCLayerImpl(); 68 69 return ccLayerImpl.release(); 70 } 71 72 PassOwnPtr<CCLayerImpl> TreeSynchronizer::synchronizeTreeRecursive(CCLayerImplMap& map, LayerChromium* layer) 73 { 74 if (!layer) 75 return nullptr; 76 77 OwnPtr<CCLayerImpl> ccLayerImpl = reuseOrCreateCCLayerImpl(map, layer); 78 79 ccLayerImpl->clearChildList(); 63 80 const Vector<RefPtr<LayerChromium> >& children = layer->children(); 64 81 for (size_t i = 0; i < children.size(); ++i) 65 ccLayerImpl->addChild(synchronizeTreeRecursive( children[i].get(), map));82 ccLayerImpl->addChild(synchronizeTreeRecursive(map, children[i].get())); 66 83 67 if (LayerChromium* maskLayer = layer->maskLayer()) 68 ccLayerImpl->setMaskLayer(synchronizeTreeRecursive(maskLayer, map)); 69 else 70 ccLayerImpl->setMaskLayer(0); 71 72 if (LayerChromium* replicaLayer = layer->replicaLayer()) 73 ccLayerImpl->setReplicaLayer(synchronizeTreeRecursive(replicaLayer, map)); 74 else 75 ccLayerImpl->setReplicaLayer(0); 84 ccLayerImpl->setMaskLayer(synchronizeTreeRecursive(map, layer->maskLayer())); 85 ccLayerImpl->setReplicaLayer(synchronizeTreeRecursive(map, layer->replicaLayer())); 76 86 77 87 layer->pushPropertiesTo(ccLayerImpl.get()); … … 79 89 } 80 90 81 PassRefPtr<CCLayerImpl> TreeSynchronizer::synchronizeTrees(LayerChromium* layerChromiumRoot, PassRefPtr<CCLayerImpl> prpOldCCLayerImplRoot)82 {83 RefPtr<CCLayerImpl> oldCCLayerImplRoot = prpOldCCLayerImplRoot;84 // Build a map from layer IDs to CCLayerImpls so we can reuse layers from the old tree.85 CCLayerImplMap map;86 if (oldCCLayerImplRoot)87 addCCLayerImplsToMapRecursive(map, oldCCLayerImplRoot.get());88 89 // Recursively build the new layer tree.90 RefPtr<CCLayerImpl> newCCLayerImplRoot = synchronizeTreeRecursive(layerChromiumRoot, map);91 92 return newCCLayerImplRoot.release();93 }94 95 91 } // namespace WebCore -
trunk/Source/WebCore/platform/graphics/chromium/TreeSynchronizer.h
r95901 r108886 29 29 #include <wtf/HashMap.h> 30 30 #include <wtf/Noncopyable.h> 31 #include <wtf/PassRefPtr.h> 31 #include <wtf/OwnPtr.h> 32 #include <wtf/PassOwnPtr.h> 32 33 33 34 namespace WebCore { … … 41 42 // Accepts a LayerChromium tree and returns a reference to a CCLayerImpl tree that duplicates the structure 42 43 // of the LayerChromium tree, reusing the CCLayerImpls in the tree provided by oldCCLayerImplRoot if possible. 43 static Pass RefPtr<CCLayerImpl> synchronizeTrees(LayerChromium* layerRoot, PassRefPtr<CCLayerImpl> oldCCLayerImplRoot);44 static PassOwnPtr<CCLayerImpl> synchronizeTrees(LayerChromium* layerRoot, PassOwnPtr<CCLayerImpl> oldCCLayerImplRoot); 44 45 45 46 private: 46 47 TreeSynchronizer(); // Not instantiable. 47 48 48 typedef HashMap<int, RefPtr<CCLayerImpl> > CCLayerImplMap;49 typedef HashMap<int, OwnPtr<CCLayerImpl> > CCLayerImplMap; 49 50 50 51 // Declared as static member functions so they can access functions on LayerChromium as a friend class. 51 static void addCCLayerImplsToMapRecursive(CCLayerImplMap&, CCLayerImpl*); 52 static PassRefPtr<CCLayerImpl> synchronizeTreeRecursive(LayerChromium*, CCLayerImplMap&); 52 static PassOwnPtr<CCLayerImpl> reuseOrCreateCCLayerImpl(CCLayerImplMap&, LayerChromium*); 53 static void collectExistingCCLayerImplRecursive(CCLayerImplMap&, PassOwnPtr<CCLayerImpl>); 54 static PassOwnPtr<CCLayerImpl> synchronizeTreeRecursive(CCLayerImplMap&, LayerChromium*); 53 55 }; 54 56 -
trunk/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp
r108703 r108886 53 53 } 54 54 55 Pass RefPtr<CCLayerImpl> VideoLayerChromium::createCCLayerImpl()55 PassOwnPtr<CCLayerImpl> VideoLayerChromium::createCCLayerImpl() 56 56 { 57 57 return CCVideoLayerImpl::create(m_layerId, m_provider); -
trunk/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.h
r108703 r108886 49 49 virtual ~VideoLayerChromium(); 50 50 51 virtual Pass RefPtr<CCLayerImpl> createCCLayerImpl();51 virtual PassOwnPtr<CCLayerImpl> createCCLayerImpl(); 52 52 53 53 void contentChanged(); -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCCanvasLayerImpl.h
r105529 r108886 35 35 class CCCanvasLayerImpl : public CCLayerImpl { 36 36 public: 37 static Pass RefPtr<CCCanvasLayerImpl> create(int id)37 static PassOwnPtr<CCCanvasLayerImpl> create(int id) 38 38 { 39 return adopt Ref(new CCCanvasLayerImpl(id));39 return adoptPtr(new CCCanvasLayerImpl(id)); 40 40 } 41 41 virtual ~CCCanvasLayerImpl(); -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCDamageTracker.cpp
r107130 r108886 57 57 } 58 58 59 void CCDamageTracker::updateDamageTrackingState(const Vector< RefPtr<CCLayerImpl>>& layerList, int targetSurfaceLayerID, CCLayerImpl* targetSurfaceMaskLayer)59 void CCDamageTracker::updateDamageTrackingState(const Vector<CCLayerImpl*>& layerList, int targetSurfaceLayerID, CCLayerImpl* targetSurfaceMaskLayer) 60 60 { 61 61 // … … 131 131 // If the target surface already knows its entire region is damaged, we can return early. 132 132 // FIXME: this should go away, or will be cleaner, after refactoring into RenderPass/RenderSchedule. 133 CCLayerImpl* layer = layerList[0] .get();133 CCLayerImpl* layer = layerList[0]; 134 134 CCRenderSurface* targetSurface = layer->targetRenderSurface(); 135 135 … … 162 162 } 163 163 164 FloatRect CCDamageTracker::trackDamageFromActiveLayers(const Vector< RefPtr<CCLayerImpl>>& layerList, int targetSurfaceLayerID)164 FloatRect CCDamageTracker::trackDamageFromActiveLayers(const Vector<CCLayerImpl*>& layerList, int targetSurfaceLayerID) 165 165 { 166 166 FloatRect damageRect = FloatRect(); 167 167 168 168 for (unsigned layerIndex = 0; layerIndex < layerList.size(); ++layerIndex) { 169 CCLayerImpl* layer = layerList[layerIndex] .get();169 CCLayerImpl* layer = layerList[layerIndex]; 170 170 171 171 if (CCLayerTreeHostCommon::renderSurfaceContributesToTarget<CCLayerImpl>(layer, targetSurfaceLayerID)) -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCDamageTracker.h
r107130 r108886 45 45 46 46 void forceFullDamageNextUpdate() { m_forceFullDamageNextUpdate = true; } 47 void updateDamageTrackingState(const Vector< RefPtr<CCLayerImpl>>& layerList, int targetSurfaceLayerID, CCLayerImpl* targetSurfaceMaskLayer);47 void updateDamageTrackingState(const Vector<CCLayerImpl*>& layerList, int targetSurfaceLayerID, CCLayerImpl* targetSurfaceMaskLayer); 48 48 const FloatRect& currentDamageRect() { return m_currentDamageRect; } 49 49 … … 51 51 CCDamageTracker(); 52 52 53 FloatRect trackDamageFromActiveLayers(const Vector< RefPtr<CCLayerImpl>>& layerList, int targetSurfaceLayerID);53 FloatRect trackDamageFromActiveLayers(const Vector<CCLayerImpl*>& layerList, int targetSurfaceLayerID); 54 54 FloatRect trackDamageFromSurfaceMask(CCLayerImpl* targetSurfaceMaskLayer); 55 55 FloatRect trackDamageFromLeftoverRects(); -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp
r108698 r108886 43 43 CCLayerImpl::CCLayerImpl(int id) 44 44 : m_parent(0) 45 , m_maskLayerId(-1) 46 , m_replicaLayerId(-1) 45 47 , m_layerId(id) 46 48 , m_anchorPoint(0.5, 0.5) … … 74 76 } 75 77 76 void CCLayerImpl::addChild(Pass RefPtr<CCLayerImpl> child)78 void CCLayerImpl::addChild(PassOwnPtr<CCLayerImpl> child) 77 79 { 78 80 child->setParent(this); … … 84 86 if (!m_parent) 85 87 return; 86 for (size_t i = 0; i < m_parent->m_children.size(); ++i) { 87 if (m_parent->m_children[i].get() == this) { 88 m_parent->m_children.remove(i); 89 break; 88 89 CCLayerImpl* parent = m_parent; 90 m_parent = 0; 91 92 for (size_t i = 0; i < parent->m_children.size(); ++i) { 93 if (parent->m_children[i].get() == this) { 94 parent->m_children.remove(i); 95 return; 90 96 } 91 97 } 92 m_parent = 0;93 98 } 94 99 … … 245 250 } 246 251 247 void sortLayers(Vector< RefPtr<CCLayerImpl> >::iterator first, Vector<RefPtr<CCLayerImpl>>::iterator end, CCLayerSorter* layerSorter)252 void sortLayers(Vector<CCLayerImpl*>::iterator first, Vector<CCLayerImpl*>::iterator end, CCLayerSorter* layerSorter) 248 253 { 249 254 TRACE_EVENT("LayerRendererChromium::sortLayers", 0, 0); … … 320 325 } 321 326 322 void CCLayerImpl::setMaskLayer(PassRefPtr<CCLayerImpl> maskLayer) 323 { 324 if (m_maskLayer == maskLayer) 325 return; 326 327 void CCLayerImpl::setMaskLayer(PassOwnPtr<CCLayerImpl> maskLayer) 328 { 327 329 m_maskLayer = maskLayer; 328 noteLayerPropertyChangedForSubtree(); 329 } 330 331 void CCLayerImpl::setReplicaLayer(PassRefPtr<CCLayerImpl> replicaLayer) 332 { 333 if (m_replicaLayer == replicaLayer) 334 return; 335 330 331 int newLayerId = m_maskLayer ? m_maskLayer->id() : -1; 332 if (newLayerId == m_maskLayerId) 333 return; 334 335 m_maskLayerId = newLayerId; 336 noteLayerPropertyChangedForSubtree(); 337 } 338 339 void CCLayerImpl::setReplicaLayer(PassOwnPtr<CCLayerImpl> replicaLayer) 340 { 336 341 m_replicaLayer = replicaLayer; 342 343 int newLayerId = m_replicaLayer ? m_replicaLayer->id() : -1; 344 if (newLayerId == m_replicaLayerId) 345 return; 346 347 m_replicaLayerId = newLayerId; 337 348 noteLayerPropertyChangedForSubtree(); 338 349 } -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h
r108698 r108886 47 47 class LayerRendererChromium; 48 48 49 class CCLayerImpl : public RefCounted<CCLayerImpl>, publicCCLayerAnimationControllerImplClient {49 class CCLayerImpl : public CCLayerAnimationControllerImplClient { 50 50 public: 51 static Pass RefPtr<CCLayerImpl> create(int id)51 static PassOwnPtr<CCLayerImpl> create(int id) 52 52 { 53 return adopt Ref(new CCLayerImpl(id));53 return adoptPtr(new CCLayerImpl(id)); 54 54 } 55 55 … … 66 66 // Tree structure. 67 67 CCLayerImpl* parent() const { return m_parent; } 68 const Vector< RefPtr<CCLayerImpl> >& children() const { return m_children; }69 void addChild(Pass RefPtr<CCLayerImpl>);68 const Vector<OwnPtr<CCLayerImpl> >& children() const { return m_children; } 69 void addChild(PassOwnPtr<CCLayerImpl>); 70 70 void removeFromParent(); 71 71 void removeAllChildren(); 72 72 73 void setMaskLayer(Pass RefPtr<CCLayerImpl>);73 void setMaskLayer(PassOwnPtr<CCLayerImpl>); 74 74 CCLayerImpl* maskLayer() const { return m_maskLayer.get(); } 75 75 76 void setReplicaLayer(Pass RefPtr<CCLayerImpl>);76 void setReplicaLayer(PassOwnPtr<CCLayerImpl>); 77 77 CCLayerImpl* replicaLayer() const { return m_replicaLayer.get(); } 78 78 … … 237 237 // Properties internal to CCLayerImpl 238 238 CCLayerImpl* m_parent; 239 Vector<RefPtr<CCLayerImpl> > m_children; 240 RefPtr<CCLayerImpl> m_maskLayer; 241 RefPtr<CCLayerImpl> m_replicaLayer; 239 Vector<OwnPtr<CCLayerImpl> > m_children; 240 // m_maskLayer can be temporarily stolen during tree sync, we need this ID to confirm newly assigned layer is still the previous one 241 int m_maskLayerId; 242 OwnPtr<CCLayerImpl> m_maskLayer; 243 int m_replicaLayerId; // ditto 244 OwnPtr<CCLayerImpl> m_replicaLayer; 242 245 int m_layerId; 243 246 … … 325 328 }; 326 329 327 void sortLayers(Vector< RefPtr<CCLayerImpl> >::iterator first, Vector<RefPtr<CCLayerImpl>>::iterator end, CCLayerSorter*);330 void sortLayers(Vector<CCLayerImpl*>::iterator first, Vector<CCLayerImpl*>::iterator end, CCLayerSorter*); 328 331 329 332 } -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerIterator.cpp
r108678 r108886 36 36 namespace WebCore { 37 37 38 template <typename LayerType, typename RenderSurfaceType, typename ActionType>39 void CCLayerIteratorActions::BackToFront::begin(CCLayerIterator<LayerType, RenderSurfaceType, ActionType>& it)38 template <typename LayerType, typename LayerList, typename RenderSurfaceType, typename ActionType> 39 void CCLayerIteratorActions::BackToFront::begin(CCLayerIterator<LayerType, LayerList, RenderSurfaceType, ActionType>& it) 40 40 { 41 41 it.m_targetRenderSurfaceLayerIndex = 0; … … 45 45 } 46 46 47 template <typename LayerType, typename RenderSurfaceType, typename ActionType>48 void CCLayerIteratorActions::BackToFront::end(CCLayerIterator<LayerType, RenderSurfaceType, ActionType>& it)47 template <typename LayerType, typename LayerList, typename RenderSurfaceType, typename ActionType> 48 void CCLayerIteratorActions::BackToFront::end(CCLayerIterator<LayerType, LayerList, RenderSurfaceType, ActionType>& it) 49 49 { 50 50 it.m_targetRenderSurfaceLayerIndex = CCLayerIteratorValue::InvalidTargetRenderSurfaceLayerIndex; … … 52 52 } 53 53 54 template <typename LayerType, typename RenderSurfaceType, typename ActionType>55 void CCLayerIteratorActions::BackToFront::next(CCLayerIterator<LayerType, RenderSurfaceType, ActionType>& it)54 template <typename LayerType, typename LayerList, typename RenderSurfaceType, typename ActionType> 55 void CCLayerIteratorActions::BackToFront::next(CCLayerIterator<LayerType, LayerList, RenderSurfaceType, ActionType>& it) 56 56 { 57 57 // If the current layer has a RS, move to its layer list. Otherwise, visit the next layer in the current RS layer list. … … 86 86 } 87 87 88 template <typename LayerType, typename RenderSurfaceType, typename ActionType>89 void CCLayerIteratorActions::FrontToBack::begin(CCLayerIterator<LayerType, RenderSurfaceType, ActionType>& it)88 template <typename LayerType, typename LayerList, typename RenderSurfaceType, typename ActionType> 89 void CCLayerIteratorActions::FrontToBack::begin(CCLayerIterator<LayerType, LayerList, RenderSurfaceType, ActionType>& it) 90 90 { 91 91 it.m_targetRenderSurfaceLayerIndex = 0; … … 94 94 } 95 95 96 template <typename LayerType, typename RenderSurfaceType, typename ActionType>97 void CCLayerIteratorActions::FrontToBack::end(CCLayerIterator<LayerType, RenderSurfaceType, ActionType>& it)96 template <typename LayerType, typename LayerList, typename RenderSurfaceType, typename ActionType> 97 void CCLayerIteratorActions::FrontToBack::end(CCLayerIterator<LayerType, LayerList, RenderSurfaceType, ActionType>& it) 98 98 { 99 99 it.m_targetRenderSurfaceLayerIndex = CCLayerIteratorValue::InvalidTargetRenderSurfaceLayerIndex; … … 101 101 } 102 102 103 template <typename LayerType, typename RenderSurfaceType, typename ActionType>104 void CCLayerIteratorActions::FrontToBack::next(CCLayerIterator<LayerType, RenderSurfaceType, ActionType>& it)103 template <typename LayerType, typename LayerList, typename RenderSurfaceType, typename ActionType> 104 void CCLayerIteratorActions::FrontToBack::next(CCLayerIterator<LayerType, LayerList, RenderSurfaceType, ActionType>& it) 105 105 { 106 106 // Moves to the previous layer in the current RS layer list. Then we check if the … … 129 129 } 130 130 131 template <typename LayerType, typename RenderSurfaceType, typename ActionType>132 void CCLayerIteratorActions::FrontToBack::goToHighestInSubtree(CCLayerIterator<LayerType, RenderSurfaceType, ActionType>& it)131 template <typename LayerType, typename LayerList, typename RenderSurfaceType, typename ActionType> 132 void CCLayerIteratorActions::FrontToBack::goToHighestInSubtree(CCLayerIterator<LayerType, LayerList, RenderSurfaceType, ActionType>& it) 133 133 { 134 134 if (it.currentLayerRepresentsTargetRenderSurface()) … … 148 148 149 149 // Declare each of the above functions for LayerChromium and CCLayerImpl classes so that they are linked. 150 template void CCLayerIteratorActions::BackToFront::begin(CCLayerIterator<LayerChromium, RenderSurfaceChromium, BackToFront> &);151 template void CCLayerIteratorActions::BackToFront::end(CCLayerIterator<LayerChromium, RenderSurfaceChromium, BackToFront>&);152 template void CCLayerIteratorActions::BackToFront::next(CCLayerIterator<LayerChromium, RenderSurfaceChromium, BackToFront>&);150 template void CCLayerIteratorActions::BackToFront::begin(CCLayerIterator<LayerChromium, Vector<RefPtr<LayerChromium> >, RenderSurfaceChromium, BackToFront> &); 151 template void CCLayerIteratorActions::BackToFront::end(CCLayerIterator<LayerChromium, Vector<RefPtr<LayerChromium> >, RenderSurfaceChromium, BackToFront>&); 152 template void CCLayerIteratorActions::BackToFront::next(CCLayerIterator<LayerChromium, Vector<RefPtr<LayerChromium> >, RenderSurfaceChromium, BackToFront>&); 153 153 154 template void CCLayerIteratorActions::BackToFront::begin(CCLayerIterator<CCLayerImpl, CCRenderSurface, BackToFront>&);155 template void CCLayerIteratorActions::BackToFront::end(CCLayerIterator<CCLayerImpl, CCRenderSurface, BackToFront>&);156 template void CCLayerIteratorActions::BackToFront::next(CCLayerIterator<CCLayerImpl, CCRenderSurface, BackToFront>&);154 template void CCLayerIteratorActions::BackToFront::begin(CCLayerIterator<CCLayerImpl, Vector<CCLayerImpl*>, CCRenderSurface, BackToFront>&); 155 template void CCLayerIteratorActions::BackToFront::end(CCLayerIterator<CCLayerImpl, Vector<CCLayerImpl*>, CCRenderSurface, BackToFront>&); 156 template void CCLayerIteratorActions::BackToFront::next(CCLayerIterator<CCLayerImpl, Vector<CCLayerImpl*>, CCRenderSurface, BackToFront>&); 157 157 158 template void CCLayerIteratorActions::FrontToBack::next(CCLayerIterator<LayerChromium, RenderSurfaceChromium, FrontToBack>&);159 template void CCLayerIteratorActions::FrontToBack::end(CCLayerIterator<LayerChromium, RenderSurfaceChromium, FrontToBack>&);160 template void CCLayerIteratorActions::FrontToBack::begin(CCLayerIterator<LayerChromium, RenderSurfaceChromium, FrontToBack>&);161 template void CCLayerIteratorActions::FrontToBack::goToHighestInSubtree(CCLayerIterator<LayerChromium, RenderSurfaceChromium, FrontToBack>&);158 template void CCLayerIteratorActions::FrontToBack::next(CCLayerIterator<LayerChromium, Vector<RefPtr<LayerChromium> >, RenderSurfaceChromium, FrontToBack>&); 159 template void CCLayerIteratorActions::FrontToBack::end(CCLayerIterator<LayerChromium, Vector<RefPtr<LayerChromium> >, RenderSurfaceChromium, FrontToBack>&); 160 template void CCLayerIteratorActions::FrontToBack::begin(CCLayerIterator<LayerChromium, Vector<RefPtr<LayerChromium> >, RenderSurfaceChromium, FrontToBack>&); 161 template void CCLayerIteratorActions::FrontToBack::goToHighestInSubtree(CCLayerIterator<LayerChromium, Vector<RefPtr<LayerChromium> >, RenderSurfaceChromium, FrontToBack>&); 162 162 163 template void CCLayerIteratorActions::FrontToBack::next(CCLayerIterator<CCLayerImpl, CCRenderSurface, FrontToBack>&);164 template void CCLayerIteratorActions::FrontToBack::end(CCLayerIterator<CCLayerImpl, CCRenderSurface, FrontToBack>&);165 template void CCLayerIteratorActions::FrontToBack::begin(CCLayerIterator<CCLayerImpl, CCRenderSurface, FrontToBack>&);166 template void CCLayerIteratorActions::FrontToBack::goToHighestInSubtree(CCLayerIterator<CCLayerImpl, CCRenderSurface, FrontToBack>&);163 template void CCLayerIteratorActions::FrontToBack::next(CCLayerIterator<CCLayerImpl, Vector<CCLayerImpl*>, CCRenderSurface, FrontToBack>&); 164 template void CCLayerIteratorActions::FrontToBack::end(CCLayerIterator<CCLayerImpl, Vector<CCLayerImpl*>, CCRenderSurface, FrontToBack>&); 165 template void CCLayerIteratorActions::FrontToBack::begin(CCLayerIterator<CCLayerImpl, Vector<CCLayerImpl*>, CCRenderSurface, FrontToBack>&); 166 template void CCLayerIteratorActions::FrontToBack::goToHighestInSubtree(CCLayerIterator<CCLayerImpl, Vector<CCLayerImpl*>, CCRenderSurface, FrontToBack>&); 167 167 168 168 } // namespace WebCore -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerIterator.h
r108678 r108886 93 93 94 94 // An iterator class for walking over layers in the RenderSurface-Layer tree. 95 template <typename LayerType, typename RenderSurfaceType, typename IteratorActionType>95 template <typename LayerType, typename LayerList, typename RenderSurfaceType, typename IteratorActionType> 96 96 class CCLayerIterator { 97 typedef CCLayerIterator<LayerType, RenderSurfaceType, IteratorActionType> CCLayerIteratorType;97 typedef CCLayerIterator<LayerType, LayerList, RenderSurfaceType, IteratorActionType> CCLayerIteratorType; 98 98 99 99 public: 100 100 CCLayerIterator() : m_renderSurfaceLayerList(0) { } 101 101 102 static CCLayerIteratorType begin(const Vector<RefPtr<LayerType> >* renderSurfaceLayerList) { return CCLayerIteratorType(renderSurfaceLayerList, true); }103 static CCLayerIteratorType end(const Vector<RefPtr<LayerType> >* renderSurfaceLayerList) { return CCLayerIteratorType(renderSurfaceLayerList, false); }102 static CCLayerIteratorType begin(const LayerList* renderSurfaceLayerList) { return CCLayerIteratorType(renderSurfaceLayerList, true); } 103 static CCLayerIteratorType end(const LayerList* renderSurfaceLayerList) { return CCLayerIteratorType(renderSurfaceLayerList, false); } 104 104 105 105 CCLayerIteratorType& operator++() { m_actions.next(*this); return *this; } … … 118 118 bool representsItself() const { return !representsTargetRenderSurface() && !representsContributingRenderSurface(); } 119 119 120 LayerType* targetRenderSurfaceLayer() const { return (*m_renderSurfaceLayerList)[m_targetRenderSurfaceLayerIndex].get(); }120 LayerType* targetRenderSurfaceLayer() const { return getRawPtr((*m_renderSurfaceLayerList)[m_targetRenderSurfaceLayerIndex]); } 121 121 122 122 private: 123 CCLayerIterator(const Vector<RefPtr<LayerType> >* renderSurfaceLayerList, bool start)123 CCLayerIterator(const LayerList* renderSurfaceLayerList, bool start) 124 124 : m_renderSurfaceLayerList(renderSurfaceLayerList) 125 125 { … … 130 130 } 131 131 132 inline LayerType* currentLayer() const { return currentLayerRepresentsTargetRenderSurface() ? targetRenderSurfaceLayer() : targetRenderSurfaceChildren()[m_currentLayerIndex].get(); } 132 inline static LayerChromium* getRawPtr(const RefPtr<LayerChromium>& ptr) { return ptr.get(); } 133 inline static CCLayerImpl* getRawPtr(CCLayerImpl* ptr) { return ptr; } 134 135 inline LayerType* currentLayer() const { return currentLayerRepresentsTargetRenderSurface() ? targetRenderSurfaceLayer() : getRawPtr(targetRenderSurfaceChildren()[m_currentLayerIndex]); } 133 136 134 137 inline bool currentLayerRepresentsContributingRenderSurface() const { return CCLayerTreeHostCommon::renderSurfaceContributesToTarget<LayerType>(currentLayer(), targetRenderSurfaceLayer()->id()); } … … 136 139 137 140 inline RenderSurfaceType* targetRenderSurface() const { return targetRenderSurfaceLayer()->renderSurface(); } 138 inline const Vector<RefPtr<LayerType> >& targetRenderSurfaceChildren() const { return targetRenderSurface()->layerList(); }141 inline const LayerList& targetRenderSurfaceChildren() const { return targetRenderSurface()->layerList(); } 139 142 140 143 IteratorActionType m_actions; 141 const Vector<RefPtr<LayerType> >* m_renderSurfaceLayerList;144 const LayerList* m_renderSurfaceLayerList; 142 145 143 146 // The iterator's current position. … … 162 165 class BackToFront { 163 166 public: 164 template <typename LayerType, typename RenderSurfaceType, typename ActionType>165 void begin(CCLayerIterator<LayerType, RenderSurfaceType, ActionType>&);166 167 template <typename LayerType, typename RenderSurfaceType, typename ActionType>168 void end(CCLayerIterator<LayerType, RenderSurfaceType, ActionType>&);169 170 template <typename LayerType, typename RenderSurfaceType, typename ActionType>171 void next(CCLayerIterator<LayerType, RenderSurfaceType, ActionType>&);167 template <typename LayerType, typename LayerList, typename RenderSurfaceType, typename ActionType> 168 void begin(CCLayerIterator<LayerType, LayerList, RenderSurfaceType, ActionType>&); 169 170 template <typename LayerType, typename LayerList, typename RenderSurfaceType, typename ActionType> 171 void end(CCLayerIterator<LayerType, LayerList, RenderSurfaceType, ActionType>&); 172 173 template <typename LayerType, typename LayerList, typename RenderSurfaceType, typename ActionType> 174 void next(CCLayerIterator<LayerType, LayerList, RenderSurfaceType, ActionType>&); 172 175 173 176 private: … … 178 181 class FrontToBack { 179 182 public: 180 template <typename LayerType, typename RenderSurfaceType, typename ActionType>181 void begin(CCLayerIterator<LayerType, RenderSurfaceType, ActionType>&);182 183 template <typename LayerType, typename RenderSurfaceType, typename ActionType>184 void end(CCLayerIterator<LayerType, RenderSurfaceType, ActionType>&);185 186 template <typename LayerType, typename RenderSurfaceType, typename ActionType>187 void next(CCLayerIterator<LayerType, RenderSurfaceType, ActionType>&);183 template <typename LayerType, typename LayerList, typename RenderSurfaceType, typename ActionType> 184 void begin(CCLayerIterator<LayerType, LayerList, RenderSurfaceType, ActionType>&); 185 186 template <typename LayerType, typename LayerList, typename RenderSurfaceType, typename ActionType> 187 void end(CCLayerIterator<LayerType, LayerList, RenderSurfaceType, ActionType>&); 188 189 template <typename LayerType, typename LayerList, typename RenderSurfaceType, typename ActionType> 190 void next(CCLayerIterator<LayerType, LayerList, RenderSurfaceType, ActionType>&); 188 191 189 192 private: 190 template <typename LayerType, typename RenderSurfaceType, typename ActionType>191 void goToHighestInSubtree(CCLayerIterator<LayerType, RenderSurfaceType, ActionType>&);193 template <typename LayerType, typename LayerList, typename RenderSurfaceType, typename ActionType> 194 void goToHighestInSubtree(CCLayerIterator<LayerType, LayerList, RenderSurfaceType, ActionType>&); 192 195 }; 193 196 }; -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerSorter.cpp
r104002 r108886 296 296 float maxZ = -FLT_MAX; 297 297 for (LayerList::const_iterator it = first; it < last; it++) { 298 m_nodes.append(GraphNode( it->get()));298 m_nodes.append(GraphNode(*it)); 299 299 GraphNode& node = m_nodes.at(m_nodes.size() - 1); 300 300 CCRenderSurface* renderSurface = node.layer->renderSurface(); -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerSorter.h
r96337 r108886 40 40 CCLayerSorter(); 41 41 42 typedef Vector< RefPtr<CCLayerImpl>> LayerList;42 typedef Vector<CCLayerImpl*> LayerList; 43 43 44 44 void sort(LayerList::iterator first, LayerList::iterator last); -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
r108880 r108886 170 170 ASSERT(CCProxy::isImplThread()); 171 171 172 // Synchronize trees, if one exists at all...173 if (rootLayer()) { 174 hostImpl->setRootLayer(TreeSynchronizer::synchronizeTrees(rootLayer(), hostImpl->rootLayer()));175 // We may have added an animation during the tree sync. This will cause hostImpl to visit its controllers.172 hostImpl->setRootLayer(TreeSynchronizer::synchronizeTrees(rootLayer(), hostImpl->releaseRootLayer())); 173 174 // We may have added an animation during the tree sync. This will cause hostImpl to visit its controllers. 175 if (rootLayer()) 176 176 hostImpl->setNeedsAnimateLayers(); 177 } else178 hostImpl->setRootLayer(0);179 177 180 178 hostImpl->setSourceFrameNumber(frameNumber()); … … 338 336 // push over the tree changes. 339 337 if (m_proxy->layerRendererCapabilities().contextHasCachedFrontBuffer) { 340 hostImpl->setRootLayer(0); 341 return; 342 } 343 344 if (rootLayer()) { 345 hostImpl->setRootLayer(TreeSynchronizer::synchronizeTrees(rootLayer(), hostImpl->rootLayer())); 346 // We may have added an animation during the tree sync. This will cause hostImpl to visit its controllers. 338 hostImpl->setRootLayer(nullptr); 339 return; 340 } 341 342 hostImpl->setRootLayer(TreeSynchronizer::synchronizeTrees(rootLayer(), hostImpl->releaseRootLayer())); 343 344 // We may have added an animation during the tree sync. This will cause hostImpl to visit its controllers. 345 if (rootLayer()) 347 346 hostImpl->setNeedsAnimateLayers(); 348 } else349 hostImpl->setRootLayer(0);350 347 } 351 348 … … 441 438 { 442 439 // Use BackToFront since it's cheap and this isn't order-dependent. 443 typedef CCLayerIterator<LayerChromium, RenderSurfaceChromium, CCLayerIteratorActions::BackToFront> CCLayerIteratorType;440 typedef CCLayerIterator<LayerChromium, Vector<RefPtr<LayerChromium> >, RenderSurfaceChromium, CCLayerIteratorActions::BackToFront> CCLayerIteratorType; 444 441 445 442 CCLayerIteratorType end = CCLayerIteratorType::end(&m_updateList); … … 533 530 { 534 531 // Use FrontToBack to allow for testing occlusion and performing culling during the tree walk. 535 typedef CCLayerIterator<LayerChromium, RenderSurfaceChromium, CCLayerIteratorActions::FrontToBack> CCLayerIteratorType;532 typedef CCLayerIterator<LayerChromium, Vector<RefPtr<LayerChromium> >, RenderSurfaceChromium, CCLayerIteratorActions::FrontToBack> CCLayerIteratorType; 536 533 537 534 // The stack holds occluded regions for subtrees in the RenderSurface-Layer tree, so that when we leave a subtree we may … … 570 567 { 571 568 // Use BackToFront since it's cheap and this isn't order-dependent. 572 typedef CCLayerIterator<LayerChromium, RenderSurfaceChromium, CCLayerIteratorActions::BackToFront> CCLayerIteratorType;569 typedef CCLayerIterator<LayerChromium, Vector<RefPtr<LayerChromium> >, RenderSurfaceChromium, CCLayerIteratorActions::BackToFront> CCLayerIteratorType; 573 570 574 571 CCLayerIteratorType end = CCLayerIteratorType::end(&m_updateList); -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp
r108426 r108886 150 150 // Recursively walks the layer tree starting at the given node and computes all the 151 151 // necessary transformations, clipRects, render surfaces, etc. 152 template<typename LayerType, typename RenderSurfaceType, typename LayerSorter> 153 static bool calculateDrawTransformsAndVisibilityInternal(LayerType* layer, LayerType* rootLayer, const TransformationMatrix& parentMatrix, const TransformationMatrix& fullHierarchyMatrix, RenderSurfaceType* nearestAncestorThatMovesPixels, Vector<RefPtr<LayerType> >& renderSurfaceLayerList, Vector<RefPtr<LayerType> >& layerList, LayerSorter* layerSorter, int maxTextureSize) 154 { 155 typedef Vector<RefPtr<LayerType> > LayerList; 156 152 template<typename LayerType, typename LayerList, typename RenderSurfaceType, typename LayerSorter> 153 static bool calculateDrawTransformsAndVisibilityInternal(LayerType* layer, LayerType* rootLayer, const TransformationMatrix& parentMatrix, const TransformationMatrix& fullHierarchyMatrix, RenderSurfaceType* nearestAncestorThatMovesPixels, LayerList& renderSurfaceLayerList, LayerList& layerList, LayerSorter* layerSorter, int maxTextureSize) 154 { 157 155 // This function computes the new matrix transformations recursively for this 158 156 // layer and all its descendants. It also computes the appropriate render surfaces. … … 391 389 for (size_t i = 0; i < layer->children().size(); ++i) { 392 390 LayerType* child = layer->children()[i].get(); 393 bool drawsContent = calculateDrawTransformsAndVisibilityInternal<LayerType, RenderSurfaceType, LayerSorter>(child, rootLayer, sublayerMatrix, nextHierarchyMatrix, nearestAncestorThatMovesPixels, renderSurfaceLayerList, descendants, layerSorter, maxTextureSize);391 bool drawsContent = calculateDrawTransformsAndVisibilityInternal<LayerType, LayerList, RenderSurfaceType, LayerSorter>(child, rootLayer, sublayerMatrix, nextHierarchyMatrix, nearestAncestorThatMovesPixels, renderSurfaceLayerList, descendants, layerSorter, maxTextureSize); 394 392 395 393 if (drawsContent) { … … 496 494 // tree pass, revise calculateVisibleLayerRect() so that this can be done in a single 497 495 // pass inside calculateDrawTransformsAndVisibilityInternal<>(). 498 template<typename LayerType, typename RenderSurfaceType>499 static void walkLayersAndCalculateVisibleLayerRects(const Vector<RefPtr<LayerType> >& renderSurfaceLayerList)496 template<typename LayerType, typename LayerList, typename RenderSurfaceType> 497 static void walkLayersAndCalculateVisibleLayerRects(const LayerList& renderSurfaceLayerList) 500 498 { 501 499 // Use BackToFront since it's cheap and this isn't order-dependent. 502 typedef CCLayerIterator<LayerType, RenderSurfaceType, CCLayerIteratorActions::BackToFront> CCLayerIteratorType;500 typedef CCLayerIterator<LayerType, LayerList, RenderSurfaceType, CCLayerIteratorActions::BackToFront> CCLayerIteratorType; 503 501 504 502 CCLayerIteratorType end = CCLayerIteratorType::end(&renderSurfaceLayerList); … … 513 511 void CCLayerTreeHostCommon::calculateDrawTransformsAndVisibility(LayerChromium* layer, LayerChromium* rootLayer, const TransformationMatrix& parentMatrix, const TransformationMatrix& fullHierarchyMatrix, Vector<RefPtr<LayerChromium> >& renderSurfaceLayerList, Vector<RefPtr<LayerChromium> >& layerList, int maxTextureSize) 514 512 { 515 WebCore::calculateDrawTransformsAndVisibilityInternal<LayerChromium, RenderSurfaceChromium, void*>(layer, rootLayer, parentMatrix, fullHierarchyMatrix, 0, renderSurfaceLayerList, layerList, 0, maxTextureSize);516 walkLayersAndCalculateVisibleLayerRects<LayerChromium, RenderSurfaceChromium>(renderSurfaceLayerList);517 } 518 519 void CCLayerTreeHostCommon::calculateDrawTransformsAndVisibility(CCLayerImpl* layer, CCLayerImpl* rootLayer, const TransformationMatrix& parentMatrix, const TransformationMatrix& fullHierarchyMatrix, Vector< RefPtr<CCLayerImpl> >& renderSurfaceLayerList, Vector<RefPtr<CCLayerImpl>>& layerList, CCLayerSorter* layerSorter, int maxTextureSize)520 { 521 calculateDrawTransformsAndVisibilityInternal<CCLayerImpl, CCRenderSurface, CCLayerSorter>(layer, rootLayer, parentMatrix, fullHierarchyMatrix, 0, renderSurfaceLayerList, layerList, layerSorter, maxTextureSize);522 walkLayersAndCalculateVisibleLayerRects<CCLayerImpl, CCRenderSurface>(renderSurfaceLayerList);513 WebCore::calculateDrawTransformsAndVisibilityInternal<LayerChromium, Vector<RefPtr<LayerChromium> >, RenderSurfaceChromium, void>(layer, rootLayer, parentMatrix, fullHierarchyMatrix, 0, renderSurfaceLayerList, layerList, 0, maxTextureSize); 514 walkLayersAndCalculateVisibleLayerRects<LayerChromium, Vector<RefPtr<LayerChromium> >, RenderSurfaceChromium>(renderSurfaceLayerList); 515 } 516 517 void CCLayerTreeHostCommon::calculateDrawTransformsAndVisibility(CCLayerImpl* layer, CCLayerImpl* rootLayer, const TransformationMatrix& parentMatrix, const TransformationMatrix& fullHierarchyMatrix, Vector<CCLayerImpl*>& renderSurfaceLayerList, Vector<CCLayerImpl*>& layerList, CCLayerSorter* layerSorter, int maxTextureSize) 518 { 519 calculateDrawTransformsAndVisibilityInternal<CCLayerImpl, Vector<CCLayerImpl*>, CCRenderSurface, CCLayerSorter>(layer, rootLayer, parentMatrix, fullHierarchyMatrix, 0, renderSurfaceLayerList, layerList, layerSorter, maxTextureSize); 520 walkLayersAndCalculateVisibleLayerRects<CCLayerImpl, Vector<CCLayerImpl*>, CCRenderSurface>(renderSurfaceLayerList); 523 521 } 524 522 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.h
r101318 r108886 44 44 45 45 static void calculateDrawTransformsAndVisibility(LayerChromium*, LayerChromium* rootLayer, const TransformationMatrix& parentMatrix, const TransformationMatrix& fullHierarchyMatrix, Vector<RefPtr<LayerChromium> >& renderSurfaceLayerList, Vector<RefPtr<LayerChromium> >& layerList, int maxTextureSize); 46 static void calculateDrawTransformsAndVisibility(CCLayerImpl*, CCLayerImpl* rootLayer, const TransformationMatrix& parentMatrix, const TransformationMatrix& fullHierarchyMatrix, Vector< RefPtr<CCLayerImpl> >& renderSurfaceLayerList, Vector<RefPtr<CCLayerImpl>>& layerList, CCLayerSorter*, int maxTextureSize);46 static void calculateDrawTransformsAndVisibility(CCLayerImpl*, CCLayerImpl* rootLayer, const TransformationMatrix& parentMatrix, const TransformationMatrix& fullHierarchyMatrix, Vector<CCLayerImpl*>& renderSurfaceLayerList, Vector<CCLayerImpl*>& layerList, CCLayerSorter*, int maxTextureSize); 47 47 48 48 template<typename LayerType> static bool renderSurfaceContributesToTarget(LayerType*, int targetSurfaceLayerID); -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
r108764 r108886 51 51 , m_sourceFrameNumber(-1) 52 52 , m_frameNumber(0) 53 , m_scrollLayerImpl(0) 53 54 , m_settings(settings) 54 55 , m_visible(true) … … 135 136 136 137 for (int surfaceIndex = renderSurfaceLayerList.size() - 1; surfaceIndex >= 0 ; --surfaceIndex) { 137 CCLayerImpl* renderSurfaceLayer = renderSurfaceLayerList[surfaceIndex] .get();138 CCLayerImpl* renderSurfaceLayer = renderSurfaceLayerList[surfaceIndex]; 138 139 CCRenderSurface* renderSurface = renderSurfaceLayer->renderSurface(); 139 140 ASSERT(renderSurface); … … 199 200 200 201 for (int surfaceIndex = renderSurfaceLayerList.size() - 1; surfaceIndex >= 0 ; --surfaceIndex) { 201 CCLayerImpl* renderSurfaceLayer = renderSurfaceLayerList[surfaceIndex] .get();202 CCLayerImpl* renderSurfaceLayer = renderSurfaceLayerList[surfaceIndex]; 202 203 CCRenderSurface* renderSurface = renderSurfaceLayer->renderSurface(); 203 204 … … 211 212 const CCLayerList& layerList = renderSurface->layerList(); 212 213 for (unsigned layerIndex = 0; layerIndex < layerList.size(); ++layerIndex) { 213 CCLayerImpl* layer = layerList[layerIndex] .get();214 CCLayerImpl* layer = layerList[layerIndex]; 214 215 if (layer->visibleLayerRect().isEmpty()) 215 216 continue; … … 295 296 m_layerRenderer->drawRenderPass(passes[i].get()); 296 297 297 typedef CCLayerIterator<CCLayerImpl, CCRenderSurface, CCLayerIteratorActions::BackToFront> CCLayerIteratorType;298 typedef CCLayerIterator<CCLayerImpl, Vector<CCLayerImpl*>, CCRenderSurface, CCLayerIteratorActions::BackToFront> CCLayerIteratorType; 298 299 299 300 CCLayerIteratorType end = CCLayerIteratorType::end(&renderSurfaceLayerList); … … 364 365 } 365 366 366 void CCLayerTreeHostImpl::setRootLayer(Pass RefPtr<CCLayerImpl> layer)367 void CCLayerTreeHostImpl::setRootLayer(PassOwnPtr<CCLayerImpl> layer) 367 368 { 368 369 m_rootLayerImpl = layer; -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h
r108698 r108886 95 95 96 96 CCLayerImpl* rootLayer() const { return m_rootLayerImpl.get(); } 97 void setRootLayer(PassRefPtr<CCLayerImpl>); 97 void setRootLayer(PassOwnPtr<CCLayerImpl>); 98 PassOwnPtr<CCLayerImpl> releaseRootLayer() { return m_rootLayerImpl.release(); } 98 99 99 CCLayerImpl* scrollLayer() const { return m_scrollLayerImpl .get(); }100 CCLayerImpl* scrollLayer() const { return m_scrollLayerImpl; } 100 101 101 102 bool visible() const { return m_visible; } … … 137 138 138 139 private: 139 typedef Vector< RefPtr<CCLayerImpl>> CCLayerList;140 typedef Vector<CCLayerImpl*> CCLayerList; 140 141 141 142 void computeDoubleTapZoomDeltas(CCScrollAndScaleSet* scrollInfo); … … 154 155 155 156 OwnPtr<LayerRendererChromium> m_layerRenderer; 156 RefPtr<CCLayerImpl> m_rootLayerImpl;157 RefPtr<CCLayerImpl>m_scrollLayerImpl;157 OwnPtr<CCLayerImpl> m_rootLayerImpl; 158 CCLayerImpl* m_scrollLayerImpl; 158 159 CCSettings m_settings; 159 160 IntSize m_viewportSize; -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCPluginLayerImpl.h
r106607 r108886 36 36 class CCPluginLayerImpl : public CCLayerImpl { 37 37 public: 38 static Pass RefPtr<CCPluginLayerImpl> create(int id)38 static PassOwnPtr<CCPluginLayerImpl> create(int id) 39 39 { 40 return adopt Ref(new CCPluginLayerImpl(id));40 return adoptPtr(new CCPluginLayerImpl(id)); 41 41 } 42 42 virtual ~CCPluginLayerImpl(); -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.h
r108013 r108886 96 96 97 97 void clearLayerList() { m_layerList.clear(); } 98 Vector< RefPtr<CCLayerImpl>>& layerList() { return m_layerList; }98 Vector<CCLayerImpl*>& layerList() { return m_layerList; } 99 99 100 100 void setMaskLayer(CCLayerImpl* maskLayer) { m_maskLayer = maskLayer; } … … 134 134 FilterOperations m_filters; 135 135 IntRect m_clipRect; 136 Vector< RefPtr<CCLayerImpl>> m_layerList;136 Vector<CCLayerImpl*> m_layerList; 137 137 138 138 // The nearest ancestor target surface that will contain the contents of this surface, and that is going -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCSolidColorLayerImpl.h
r105634 r108886 36 36 class CCSolidColorLayerImpl : public CCLayerImpl { 37 37 public: 38 static Pass RefPtr<CCSolidColorLayerImpl> create(int id)38 static PassOwnPtr<CCSolidColorLayerImpl> create(int id) 39 39 { 40 return adopt Ref(new CCSolidColorLayerImpl(id));40 return adoptPtr(new CCSolidColorLayerImpl(id)); 41 41 } 42 42 virtual ~CCSolidColorLayerImpl(); -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.h
r106300 r108886 38 38 class CCTiledLayerImpl : public CCLayerImpl { 39 39 public: 40 static Pass RefPtr<CCTiledLayerImpl> create(int id)40 static PassOwnPtr<CCTiledLayerImpl> create(int id) 41 41 { 42 return adopt Ref(new CCTiledLayerImpl(id));42 return adoptPtr(new CCTiledLayerImpl(id)); 43 43 } 44 44 virtual ~CCTiledLayerImpl(); -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.h
r108675 r108886 44 44 , public VideoFrameProvider::Client { 45 45 public: 46 static Pass RefPtr<CCVideoLayerImpl> create(int id, VideoFrameProvider* provider)46 static PassOwnPtr<CCVideoLayerImpl> create(int id, VideoFrameProvider* provider) 47 47 { 48 return adopt Ref(new CCVideoLayerImpl(id, provider));48 return adoptPtr(new CCVideoLayerImpl(id, provider)); 49 49 } 50 50 virtual ~CCVideoLayerImpl(); -
trunk/Source/WebKit/chromium/ChangeLog
r108883 r108886 1 2012-02-24 Tien-Ren Chen <trchen@chromium.org> 2 3 [chromium] Replace RefPtr with OwnPtr for CCLayerImpl tree structure 4 https://bugs.webkit.org/show_bug.cgi?id=78404 5 6 Reviewed by James Robinson. 7 8 * tests/CCDamageTrackerTest.cpp: 9 (WebKitTests::executeCalculateDrawTransformsAndVisibility): 10 (WebKitTests::emulateDrawingOneFrame): 11 (WebKitTests::createTestTreeWithOneSurface): 12 (WebKitTests::createTestTreeWithTwoSurfaces): 13 (WebKitTests::createAndSetUpTestTreeWithOneSurface): 14 (WebKitTests::createAndSetUpTestTreeWithTwoSurfaces): 15 (WebKitTests::TEST_F): 16 * tests/CCLayerImplTest.cpp: 17 (WebCore::TEST): 18 * tests/CCLayerIteratorTest.cpp: 19 * tests/CCLayerSorterTest.cpp: 20 (WebCore::TEST): 21 * tests/CCLayerTreeHostCommonTest.cpp: 22 (WebCore::TEST): 23 * tests/CCLayerTreeHostImplTest.cpp: 24 (WebKit::CCLayerTreeHostImplTest::setupScrollAndContentsLayers): 25 (WebKit::TEST_F): 26 (WebKit::DidDrawCheckLayer::create): 27 (WebKit::BlendStateCheckLayer::create): 28 * tests/CCRenderSurfaceTest.cpp: 29 (WebCore::TEST): 30 * tests/CCSolidColorLayerImplTest.cpp: 31 (CCLayerTestCommon::TEST): 32 * tests/CCTiledLayerImplTest.cpp: 33 (CCLayerTestCommon::createLayer): 34 (CCLayerTestCommon::TEST): 35 (CCLayerTestCommon::getQuads): 36 * tests/Canvas2DLayerChromiumTest.cpp: 37 (WebCore::Canvas2DLayerChromiumTest::fullLifecycleTest): 38 * tests/TiledLayerChromiumTest.cpp: 39 (WTF::TEST): 40 * tests/TreeSynchronizerTest.cpp: 41 (WebKitTests::MockCCLayerImpl::create): 42 (WebKitTests::MockLayerChromium::createCCLayerImpl): 43 (WebKitTests::expectTreesAreIdentical): 44 (WebKitTests::TEST): 45 1 46 2012-02-08 James Robinson <jamesr@chromium.org> 2 47 -
trunk/Source/WebKit/chromium/tests/CCDamageTrackerTest.cpp
r107130 r108886 40 40 namespace { 41 41 42 void executeCalculateDrawTransformsAndVisibility(CCLayerImpl* root, Vector< RefPtr<CCLayerImpl>>& renderSurfaceLayerList)42 void executeCalculateDrawTransformsAndVisibility(CCLayerImpl* root, Vector<CCLayerImpl*>& renderSurfaceLayerList) 43 43 { 44 44 CCLayerSorter layerSorter; 45 45 TransformationMatrix identityMatrix; 46 Vector< RefPtr<CCLayerImpl>> dummyLayerList;46 Vector<CCLayerImpl*> dummyLayerList; 47 47 int dummyMaxTextureSize = 512; 48 48 … … 65 65 // 3. resetting all updateRects and propertyChanged flags for all layers and surfaces. 66 66 67 Vector< RefPtr<CCLayerImpl>> renderSurfaceLayerList;67 Vector<CCLayerImpl*> renderSurfaceLayerList; 68 68 executeCalculateDrawTransformsAndVisibility(root, renderSurfaceLayerList); 69 69 … … 77 77 } 78 78 79 Pass RefPtr<CCLayerImpl> createTestTreeWithOneSurface()80 { 81 RefPtr<CCLayerImpl> root = CCLayerImpl::create(1);82 RefPtr<CCLayerImpl> child = CCLayerImpl::create(2);79 PassOwnPtr<CCLayerImpl> createTestTreeWithOneSurface() 80 { 81 OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1); 82 OwnPtr<CCLayerImpl> child = CCLayerImpl::create(2); 83 83 84 84 root->setPosition(FloatPoint::zero()); … … 93 93 child->setBounds(IntSize(30, 30)); 94 94 child->setDrawsContent(true); 95 root->addChild(child );95 root->addChild(child.release()); 96 96 97 97 return root.release(); 98 98 } 99 99 100 Pass RefPtr<CCLayerImpl> createTestTreeWithTwoSurfaces()100 PassOwnPtr<CCLayerImpl> createTestTreeWithTwoSurfaces() 101 101 { 102 102 // This test tree has two render surfaces: one for the root, and one for … … 104 104 // children of its own. 105 105 106 RefPtr<CCLayerImpl> root = CCLayerImpl::create(1);107 RefPtr<CCLayerImpl> child1 = CCLayerImpl::create(2);108 RefPtr<CCLayerImpl> child2 = CCLayerImpl::create(3);109 RefPtr<CCLayerImpl> grandChild1 = CCLayerImpl::create(4);110 RefPtr<CCLayerImpl> grandChild2 = CCLayerImpl::create(5);106 OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1); 107 OwnPtr<CCLayerImpl> child1 = CCLayerImpl::create(2); 108 OwnPtr<CCLayerImpl> child2 = CCLayerImpl::create(3); 109 OwnPtr<CCLayerImpl> grandChild1 = CCLayerImpl::create(4); 110 OwnPtr<CCLayerImpl> grandChild2 = CCLayerImpl::create(5); 111 111 112 112 root->setPosition(FloatPoint::zero()); … … 138 138 grandChild2->setDrawsContent(true); 139 139 140 child1->addChild(grandChild1 );141 child1->addChild(grandChild2 );142 root->addChild(child1 );143 root->addChild(child2 );140 child1->addChild(grandChild1.release()); 141 child1->addChild(grandChild2.release()); 142 root->addChild(child1.release()); 143 root->addChild(child2.release()); 144 144 145 145 return root.release(); 146 146 } 147 147 148 Pass RefPtr<CCLayerImpl> createAndSetUpTestTreeWithOneSurface()149 { 150 RefPtr<CCLayerImpl> root = createTestTreeWithOneSurface();148 PassOwnPtr<CCLayerImpl> createAndSetUpTestTreeWithOneSurface() 149 { 150 OwnPtr<CCLayerImpl> root = createTestTreeWithOneSurface(); 151 151 152 152 // Setup includes going past the first frame which always damages everything, so … … 157 157 } 158 158 159 Pass RefPtr<CCLayerImpl> createAndSetUpTestTreeWithTwoSurfaces()160 { 161 RefPtr<CCLayerImpl> root = createTestTreeWithTwoSurfaces();159 PassOwnPtr<CCLayerImpl> createAndSetUpTestTreeWithTwoSurfaces() 160 { 161 OwnPtr<CCLayerImpl> root = createTestTreeWithTwoSurfaces(); 162 162 163 163 // Setup includes going past the first frame which always damages everything, so … … 179 179 // surfaces and layer lists. 180 180 181 RefPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();181 OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface(); 182 182 183 183 EXPECT_EQ(static_cast<size_t>(2), root->renderSurface()->layerList().size()); … … 194 194 // surfaces and layer lists. 195 195 196 RefPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();197 198 RefPtr<CCLayerImpl> child1 = root->children()[0];199 RefPtr<CCLayerImpl> child2 = root->children()[1];196 OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces(); 197 198 CCLayerImpl* child1 = root->children()[0].get(); 199 CCLayerImpl* child2 = root->children()[1].get(); 200 200 FloatRect childDamageRect = child1->renderSurface()->damageTracker()->currentDamageRect(); 201 201 FloatRect rootDamageRect = root->renderSurface()->damageTracker()->currentDamageRect(); … … 213 213 TEST_F(CCDamageTrackerTest, verifyDamageForUpdateRects) 214 214 { 215 RefPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();216 RefPtr<CCLayerImpl> child = root->children()[0];215 OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface(); 216 CCLayerImpl* child = root->children()[0].get(); 217 217 218 218 // CASE 1: Setting the update rect should cause the corresponding damage to the surface. … … 244 244 TEST_F(CCDamageTrackerTest, verifyDamageForPropertyChanges) 245 245 { 246 RefPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();247 RefPtr<CCLayerImpl> child = root->children()[0];246 OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface(); 247 CCLayerImpl* child = root->children()[0].get(); 248 248 249 249 // CASE 1: The layer's property changed flag takes priority over update rect. … … 285 285 // transformed layer. 286 286 287 RefPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();288 RefPtr<CCLayerImpl> child = root->children()[0];287 OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface(); 288 CCLayerImpl* child = root->children()[0].get(); 289 289 290 290 TransformationMatrix rotation; … … 318 318 TEST_F(CCDamageTrackerTest, verifyDamageForAddingAndRemovingLayer) 319 319 { 320 RefPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface(); 321 RefPtr<CCLayerImpl> child1 = root->children()[0]; 322 323 RefPtr<CCLayerImpl> child2 = CCLayerImpl::create(3); 324 child2->setPosition(FloatPoint(400, 380)); 325 child2->setAnchorPoint(FloatPoint::zero()); 326 child2->setBounds(IntSize(6, 8)); 327 child2->setDrawsContent(true); 320 OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface(); 321 CCLayerImpl* child1 = root->children()[0].get(); 322 323 { 324 OwnPtr<CCLayerImpl> child2 = CCLayerImpl::create(3); 325 child2->setPosition(FloatPoint(400, 380)); 326 child2->setAnchorPoint(FloatPoint::zero()); 327 child2->setBounds(IntSize(6, 8)); 328 child2->setDrawsContent(true); 329 root->addChild(child2.release()); 330 } 328 331 329 332 // CASE 1: Adding a new layer should cause the appropriate damage. 330 333 // 331 root->addChild(child2);332 334 emulateDrawingOneFrame(root.get()); 333 335 … … 354 356 TEST_F(CCDamageTrackerTest, verifyDamageForMultipleLayers) 355 357 { 356 RefPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface(); 357 RefPtr<CCLayerImpl> child1 = root->children()[0]; 358 359 RefPtr<CCLayerImpl> child2 = CCLayerImpl::create(3); 360 child2->setPosition(FloatPoint(400, 380)); 361 child2->setAnchorPoint(FloatPoint::zero()); 362 child2->setBounds(IntSize(6, 8)); 363 child2->setDrawsContent(true); 364 root->addChild(child2); 358 OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface(); 359 CCLayerImpl* child1 = root->children()[0].get(); 360 361 { 362 OwnPtr<CCLayerImpl> child2 = CCLayerImpl::create(3); 363 child2->setPosition(FloatPoint(400, 380)); 364 child2->setAnchorPoint(FloatPoint::zero()); 365 child2->setBounds(IntSize(6, 8)); 366 child2->setDrawsContent(true); 367 root->addChild(child2.release()); 368 } 369 CCLayerImpl* child2 = root->children()[1].get(); 365 370 366 371 // In this test we don't want the above tree manipulation to be considered part of the same frame. … … 379 384 TEST_F(CCDamageTrackerTest, verifyDamageForNestedSurfaces) 380 385 { 381 RefPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();382 RefPtr<CCLayerImpl> child1 = root->children()[0];383 RefPtr<CCLayerImpl> child2 = root->children()[1];384 RefPtr<CCLayerImpl> grandChild1 = root->children()[0]->children()[0];386 OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces(); 387 CCLayerImpl* child1 = root->children()[0].get(); 388 CCLayerImpl* child2 = root->children()[1].get(); 389 CCLayerImpl* grandChild1 = root->children()[0]->children()[0].get(); 385 390 FloatRect childDamageRect; 386 391 FloatRect rootDamageRect; … … 416 421 // surface should be marked dirty. 417 422 418 RefPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();419 RefPtr<CCLayerImpl> child1 = root->children()[0];420 RefPtr<CCLayerImpl> grandChild1 = root->children()[0]->children()[0];423 OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces(); 424 CCLayerImpl* child1 = root->children()[0].get(); 425 CCLayerImpl* grandChild1 = root->children()[0]->children()[0].get(); 421 426 FloatRect childDamageRect; 422 427 FloatRect rootDamageRect; … … 448 453 // root surface would be damaged appropriately. 449 454 450 RefPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces(); 451 RefPtr<CCLayerImpl> child1 = root->children()[0]; 452 RefPtr<CCLayerImpl> grandChild1 = root->children()[0]->children()[0]; 455 OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces(); 456 CCLayerImpl* child1 = root->children()[0].get(); 453 457 FloatRect childDamageRect; 454 458 FloatRect rootDamageRect; … … 470 474 TEST_F(CCDamageTrackerTest, verifyDamageForAddingAndRemovingRenderSurfaces) 471 475 { 472 RefPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();473 RefPtr<CCLayerImpl> child1 = root->children()[0];476 OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces(); 477 CCLayerImpl* child1 = root->children()[0].get(); 474 478 FloatRect childDamageRect; 475 479 FloatRect rootDamageRect; … … 511 515 TEST_F(CCDamageTrackerTest, verifyNoDamageWhenNothingChanged) 512 516 { 513 RefPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();514 RefPtr<CCLayerImpl> child1 = root->children()[0];517 OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces(); 518 CCLayerImpl* child1 = root->children()[0].get(); 515 519 FloatRect childDamageRect; 516 520 FloatRect rootDamageRect; … … 535 539 TEST_F(CCDamageTrackerTest, verifyNoDamageForUpdateRectThatDoesNotDrawContent) 536 540 { 537 RefPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();538 RefPtr<CCLayerImpl> child1 = root->children()[0];541 OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces(); 542 CCLayerImpl* child1 = root->children()[0].get(); 539 543 FloatRect childDamageRect; 540 544 FloatRect rootDamageRect; … … 552 556 TEST_F(CCDamageTrackerTest, verifyDamageForReplica) 553 557 { 554 RefPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();555 RefPtr<CCLayerImpl> child1 = root->children()[0];556 RefPtr<CCLayerImpl> grandChild1 = child1->children()[0];557 RefPtr<CCLayerImpl> grandChild2 = child1->children()[1];558 OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces(); 559 CCLayerImpl* child1 = root->children()[0].get(); 560 CCLayerImpl* grandChild1 = child1->children()[0].get(); 561 CCLayerImpl* grandChild2 = child1->children()[1].get(); 558 562 559 563 // Damage on a surface that has a reflection should cause the target surface to … … 564 568 // contentBounds of the surface. 565 569 grandChild2->setPosition(FloatPoint(180, 180)); 566 RefPtr<CCLayerImpl> grandChild3 = CCLayerImpl::create(6); 567 grandChild3->setPosition(FloatPoint(240, 240)); 568 grandChild3->setAnchorPoint(FloatPoint::zero()); 569 grandChild3->setBounds(IntSize(10, 10)); 570 grandChild3->setDrawsContent(true); 570 { 571 OwnPtr<CCLayerImpl> grandChild3 = CCLayerImpl::create(6); 572 grandChild3->setPosition(FloatPoint(240, 240)); 573 grandChild3->setAnchorPoint(FloatPoint::zero()); 574 grandChild3->setBounds(IntSize(10, 10)); 575 grandChild3->setDrawsContent(true); 576 child1->addChild(grandChild3.release()); 577 } 571 578 child1->setOpacity(0.5); 572 child1->addChild(grandChild3);573 579 emulateDrawingOneFrame(root.get()); 574 580 575 581 // CASE 1: adding a reflection about the left edge of grandChild1. 576 582 // 577 RefPtr<CCLayerImpl> grandChild1Replica = CCLayerImpl::create(7); 578 grandChild1Replica->setPosition(FloatPoint::zero()); 579 grandChild1Replica->setAnchorPoint(FloatPoint::zero()); 580 TransformationMatrix reflection; 581 reflection.scale3d(-1.0, 1.0, 1.0); 582 grandChild1Replica->setTransform(reflection); 583 grandChild1->setReplicaLayer(grandChild1Replica); 583 { 584 OwnPtr<CCLayerImpl> grandChild1Replica = CCLayerImpl::create(7); 585 grandChild1Replica->setPosition(FloatPoint::zero()); 586 grandChild1Replica->setAnchorPoint(FloatPoint::zero()); 587 TransformationMatrix reflection; 588 reflection.scale3d(-1.0, 1.0, 1.0); 589 grandChild1Replica->setTransform(reflection); 590 grandChild1->setReplicaLayer(grandChild1Replica.release()); 591 } 584 592 emulateDrawingOneFrame(root.get()); 585 593 … … 615 623 // CASE 3: removing the reflection should cause the entire region including reflection 616 624 // to damage the target surface. 617 grandChild1->setReplicaLayer( 0);625 grandChild1->setReplicaLayer(nullptr); 618 626 emulateDrawingOneFrame(root.get()); 619 627 ASSERT_EQ(oldContentRect.width(), child1->renderSurface()->contentRect().width()); … … 630 638 TEST_F(CCDamageTrackerTest, verifyDamageForMask) 631 639 { 632 RefPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();633 RefPtr<CCLayerImpl> child = root->children()[0];640 OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface(); 641 CCLayerImpl* child = root->children()[0].get(); 634 642 635 643 // In the current implementation of the damage tracker, changes to mask layers should … … 637 645 638 646 // Set up the mask layer. 639 RefPtr<CCLayerImpl> maskLayer = CCLayerImpl::create(3); 640 maskLayer->setPosition(child->position()); 641 maskLayer->setAnchorPoint(FloatPoint::zero()); 642 maskLayer->setBounds(child->bounds()); 643 child->setMaskLayer(maskLayer); 647 { 648 OwnPtr<CCLayerImpl> maskLayer = CCLayerImpl::create(3); 649 maskLayer->setPosition(child->position()); 650 maskLayer->setAnchorPoint(FloatPoint::zero()); 651 maskLayer->setBounds(child->bounds()); 652 child->setMaskLayer(maskLayer.release()); 653 } 654 CCLayerImpl* maskLayer = child->maskLayer(); 644 655 645 656 // Add opacity and a grandChild so that the render surface persists even after we remove the mask. 646 657 child->setOpacity(0.5); 647 RefPtr<CCLayerImpl> grandChild = CCLayerImpl::create(4); 648 grandChild->setPosition(FloatPoint(2.0, 2.0)); 649 grandChild->setAnchorPoint(FloatPoint::zero()); 650 grandChild->setBounds(IntSize(2, 2)); 651 grandChild->setDrawsContent(true); 652 child->addChild(grandChild); 658 { 659 OwnPtr<CCLayerImpl> grandChild = CCLayerImpl::create(4); 660 grandChild->setPosition(FloatPoint(2.0, 2.0)); 661 grandChild->setAnchorPoint(FloatPoint::zero()); 662 grandChild->setBounds(IntSize(2, 2)); 663 grandChild->setDrawsContent(true); 664 child->addChild(grandChild.release()); 665 } 653 666 emulateDrawingOneFrame(root.get()); 654 667 … … 686 699 687 700 // Then test mask removal. 688 child->setMaskLayer( 0);701 child->setMaskLayer(nullptr); 689 702 ASSERT_TRUE(child->layerPropertyChanged()); 690 703 emulateDrawingOneFrame(root.get()); … … 699 712 TEST_F(CCDamageTrackerTest, verifyDamageForReplicaMask) 700 713 { 701 RefPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();702 RefPtr<CCLayerImpl> child1 = root->children()[0];703 RefPtr<CCLayerImpl> grandChild1 = child1->children()[0];714 OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces(); 715 CCLayerImpl* child1 = root->children()[0].get(); 716 CCLayerImpl* grandChild1 = child1->children()[0].get(); 704 717 705 718 // Changes to a replica's mask should not damage the original surface, because it is … … 707 720 708 721 // Create a reflection about the left edge of grandChild1. 709 RefPtr<CCLayerImpl> grandChild1Replica = CCLayerImpl::create(6); 710 grandChild1Replica->setPosition(FloatPoint::zero()); 711 grandChild1Replica->setAnchorPoint(FloatPoint::zero()); 712 TransformationMatrix reflection; 713 reflection.scale3d(-1.0, 1.0, 1.0); 714 grandChild1Replica->setTransform(reflection); 715 grandChild1->setReplicaLayer(grandChild1Replica); 722 { 723 OwnPtr<CCLayerImpl> grandChild1Replica = CCLayerImpl::create(6); 724 grandChild1Replica->setPosition(FloatPoint::zero()); 725 grandChild1Replica->setAnchorPoint(FloatPoint::zero()); 726 TransformationMatrix reflection; 727 reflection.scale3d(-1.0, 1.0, 1.0); 728 grandChild1Replica->setTransform(reflection); 729 grandChild1->setReplicaLayer(grandChild1Replica.release()); 730 } 731 CCLayerImpl* grandChild1Replica = grandChild1->replicaLayer(); 716 732 717 733 // Set up the mask layer on the replica layer 718 RefPtr<CCLayerImpl> replicaMaskLayer = CCLayerImpl::create(7); 719 replicaMaskLayer->setPosition(FloatPoint::zero()); 720 replicaMaskLayer->setAnchorPoint(FloatPoint::zero()); 721 replicaMaskLayer->setBounds(grandChild1->bounds()); 722 grandChild1Replica->setMaskLayer(replicaMaskLayer); 734 { 735 OwnPtr<CCLayerImpl> replicaMaskLayer = CCLayerImpl::create(7); 736 replicaMaskLayer->setPosition(FloatPoint::zero()); 737 replicaMaskLayer->setAnchorPoint(FloatPoint::zero()); 738 replicaMaskLayer->setBounds(grandChild1->bounds()); 739 grandChild1Replica->setMaskLayer(replicaMaskLayer.release()); 740 } 741 CCLayerImpl* replicaMaskLayer = grandChild1Replica->maskLayer(); 723 742 724 743 emulateDrawingOneFrame(root.get()); … … 739 758 // CASE 2: removing the replica mask damages only the reflected region on the target surface. 740 759 // 741 grandChild1Replica->setMaskLayer( 0);760 grandChild1Replica->setMaskLayer(nullptr); 742 761 emulateDrawingOneFrame(root.get()); 743 762 … … 751 770 TEST_F(CCDamageTrackerTest, verifyDamageWhenReset) 752 771 { 753 RefPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();754 RefPtr<CCLayerImpl> child = root->children()[0];772 OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface(); 773 CCLayerImpl* child = root->children()[0].get(); 755 774 756 775 // Case 1: This test ensures that when the tracker is forced to have full damage, that -
trunk/Source/WebKit/chromium/tests/CCLayerImplTest.cpp
r107763 r108886 66 66 67 67 // Create a simple CCLayerImpl tree: 68 RefPtr<CCLayerImpl> root = CCLayerImpl::create(1); 69 RefPtr<CCLayerImpl> child = CCLayerImpl::create(2); 70 RefPtr<CCLayerImpl> grandChild = CCLayerImpl::create(3); 71 root->addChild(child); 72 child->addChild(grandChild); 73 74 RefPtr<CCLayerImpl> dummyMask = CCLayerImpl::create(4); 75 RefPtr<CCLayerImpl> dummyReplica = CCLayerImpl::create(5); 68 OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1); 69 root->addChild(CCLayerImpl::create(2)); 70 CCLayerImpl* child = root->children()[0].get(); 71 child->addChild(CCLayerImpl::create(3)); 72 CCLayerImpl* grandChild = child->children()[0].get(); 76 73 77 74 // Adding children is an internal operation and should not mark layers as changed. … … 96 93 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setAnchorPointZ(arbitraryNumber)); 97 94 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setFilters(arbitraryFilters)); 98 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setMaskLayer( dummyMask));95 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setMaskLayer(CCLayerImpl::create(4))); 99 96 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setMasksToBounds(true)); 100 97 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setOpaque(true)); 101 98 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setOpacity(arbitraryNumber)); 102 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setReplicaLayer( dummyReplica));99 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setReplicaLayer(CCLayerImpl::create(5))); 103 100 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setPosition(arbitraryFloatPoint)); 104 101 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setPreserves3D(true)); … … 135 132 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setAnchorPoint(arbitraryFloatPoint)); 136 133 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setAnchorPointZ(arbitraryNumber)); 137 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setMaskLayer(dummyMask));138 134 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setMasksToBounds(true)); 139 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setReplicaLayer(dummyReplica));140 135 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setPosition(arbitraryFloatPoint)); 141 136 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setPreserves3D(true)); -
trunk/Source/WebKit/chromium/tests/CCLayerIteratorTest.cpp
r105460 r108886 68 68 EXPECT_EQ(itself, layer->m_countRepresentingItself); 69 69 70 typedef CCLayerIterator<LayerChromium, RenderSurfaceChromium, CCLayerIteratorActions::FrontToBack> FrontToBack;71 typedef CCLayerIterator<LayerChromium, RenderSurfaceChromium, CCLayerIteratorActions::BackToFront> BackToFront;70 typedef CCLayerIterator<LayerChromium, Vector<RefPtr<LayerChromium> >, RenderSurfaceChromium, CCLayerIteratorActions::FrontToBack> FrontToBack; 71 typedef CCLayerIterator<LayerChromium, Vector<RefPtr<LayerChromium> >, RenderSurfaceChromium, CCLayerIteratorActions::BackToFront> BackToFront; 72 72 73 73 void resetCounts(Vector<RefPtr<LayerChromium> >& renderSurfaceLayerList) … … 138 138 Vector<RefPtr<LayerChromium> > renderSurfaceLayerList; 139 139 Vector<RefPtr<LayerChromium> > layerList; 140 renderSurfaceLayerList.append(rootLayer );140 renderSurfaceLayerList.append(rootLayer.get()); 141 141 CCLayerTreeHostCommon::calculateDrawTransformsAndVisibility(rootLayer.get(), rootLayer.get(), 142 142 TransformationMatrix(), TransformationMatrix(), … … 185 185 Vector<RefPtr<LayerChromium> > renderSurfaceLayerList; 186 186 Vector<RefPtr<LayerChromium> > layerList; 187 renderSurfaceLayerList.append(rootLayer );187 renderSurfaceLayerList.append(rootLayer.get()); 188 188 CCLayerTreeHostCommon::calculateDrawTransformsAndVisibility(rootLayer.get(), rootLayer.get(), 189 189 TransformationMatrix(), TransformationMatrix(), … … 244 244 Vector<RefPtr<LayerChromium> > renderSurfaceLayerList; 245 245 Vector<RefPtr<LayerChromium> > layerList; 246 renderSurfaceLayerList.append(rootLayer );246 renderSurfaceLayerList.append(rootLayer.get()); 247 247 CCLayerTreeHostCommon::calculateDrawTransformsAndVisibility(rootLayer.get(), rootLayer.get(), 248 248 TransformationMatrix(), TransformationMatrix(), -
trunk/Source/WebKit/chromium/tests/CCLayerSorterTest.cpp
r104002 r108886 175 175 // - 3 and 4 should be re-sorted so they are in front of 1, 2, and 5. 176 176 177 RefPtr<CCLayerImpl> layer1 = CCLayerImpl::create(1);178 RefPtr<CCLayerImpl> layer2 = CCLayerImpl::create(2);179 RefPtr<CCLayerImpl> layer3 = CCLayerImpl::create(3);180 RefPtr<CCLayerImpl> layer4 = CCLayerImpl::create(4);181 RefPtr<CCLayerImpl> layer5 = CCLayerImpl::create(5);177 OwnPtr<CCLayerImpl> layer1 = CCLayerImpl::create(1); 178 OwnPtr<CCLayerImpl> layer2 = CCLayerImpl::create(2); 179 OwnPtr<CCLayerImpl> layer3 = CCLayerImpl::create(3); 180 OwnPtr<CCLayerImpl> layer4 = CCLayerImpl::create(4); 181 OwnPtr<CCLayerImpl> layer5 = CCLayerImpl::create(5); 182 182 183 183 TransformationMatrix BehindMatrix; … … 206 206 layer5->setDrawsContent(true); 207 207 208 Vector< RefPtr<CCLayerImpl>> layerList;209 layerList.append(layer1 );210 layerList.append(layer2 );211 layerList.append(layer3 );212 layerList.append(layer4 );213 layerList.append(layer5 );208 Vector<CCLayerImpl*> layerList; 209 layerList.append(layer1.get()); 210 layerList.append(layer2.get()); 211 layerList.append(layer3.get()); 212 layerList.append(layer4.get()); 213 layerList.append(layer5.get()); 214 214 215 215 ASSERT_EQ(static_cast<size_t>(5), layerList.size()); -
trunk/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp
r108521 r108886 574 574 // FIXME: when we fix this "root-layer special case" behavior in CCLayerTreeHost, we will have to fix it here, too. 575 575 parent->setClipRect(IntRect(IntPoint::zero(), parent->bounds())); 576 renderSurfaceLayerList.append(parent );576 renderSurfaceLayerList.append(parent.get()); 577 577 578 578 CCLayerTreeHostCommon::calculateDrawTransformsAndVisibility(parent.get(), parent.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize); -
trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp
r108833 r108886 79 79 void setupScrollAndContentsLayers(const IntSize& contentSize) 80 80 { 81 RefPtr<CCLayerImpl> root = CCLayerImpl::create(0);81 OwnPtr<CCLayerImpl> root = CCLayerImpl::create(0); 82 82 root->setScrollable(true); 83 83 root->setScrollPosition(IntPoint(0, 0)); 84 84 root->setMaxScrollPosition(contentSize); 85 RefPtr<CCLayerImpl> contents = CCLayerImpl::create(1);85 OwnPtr<CCLayerImpl> contents = CCLayerImpl::create(1); 86 86 contents->setDrawsContent(true); 87 87 contents->setBounds(contentSize); 88 88 contents->setContentBounds(contentSize); 89 root->addChild(contents );90 m_hostImpl->setRootLayer(root );89 root->addChild(contents.release()); 90 m_hostImpl->setRootLayer(root.release()); 91 91 } 92 92 … … 113 113 TEST_F(CCLayerTreeHostImplTest, scrollDeltaTreeButNoChanges) 114 114 { 115 RefPtr<CCLayerImpl> root = CCLayerImpl::create(0); 116 root->addChild(CCLayerImpl::create(1)); 117 root->addChild(CCLayerImpl::create(2)); 118 root->children()[1]->addChild(CCLayerImpl::create(3)); 119 root->children()[1]->addChild(CCLayerImpl::create(4)); 120 root->children()[1]->children()[0]->addChild(CCLayerImpl::create(5)); 121 m_hostImpl->setRootLayer(root); 122 123 expectClearedScrollDeltasRecursive(root.get()); 115 { 116 OwnPtr<CCLayerImpl> root = CCLayerImpl::create(0); 117 root->addChild(CCLayerImpl::create(1)); 118 root->addChild(CCLayerImpl::create(2)); 119 root->children()[1]->addChild(CCLayerImpl::create(3)); 120 root->children()[1]->addChild(CCLayerImpl::create(4)); 121 root->children()[1]->children()[0]->addChild(CCLayerImpl::create(5)); 122 m_hostImpl->setRootLayer(root.release()); 123 } 124 CCLayerImpl* root = m_hostImpl->rootLayer(); 125 126 expectClearedScrollDeltasRecursive(root); 124 127 125 128 OwnPtr<CCScrollAndScaleSet> scrollInfo; … … 127 130 scrollInfo = m_hostImpl->processScrollDeltas(); 128 131 ASSERT_EQ(scrollInfo->scrolls.size(), 0u); 129 expectClearedScrollDeltasRecursive(root .get());132 expectClearedScrollDeltasRecursive(root); 130 133 131 134 scrollInfo = m_hostImpl->processScrollDeltas(); 132 135 ASSERT_EQ(scrollInfo->scrolls.size(), 0u); 133 expectClearedScrollDeltasRecursive(root .get());136 expectClearedScrollDeltasRecursive(root); 134 137 } 135 138 … … 138 141 IntPoint scrollPosition(20, 30); 139 142 IntSize scrollDelta(11, -15); 140 RefPtr<CCLayerImpl> root = CCLayerImpl::create(10); 141 root->setScrollPosition(scrollPosition); 142 root->setScrollable(true); 143 root->setMaxScrollPosition(IntSize(100, 100)); 144 root->scrollBy(scrollDelta); 145 m_hostImpl->setRootLayer(root); 143 { 144 OwnPtr<CCLayerImpl> root = CCLayerImpl::create(10); 145 root->setScrollPosition(scrollPosition); 146 root->setScrollable(true); 147 root->setMaxScrollPosition(IntSize(100, 100)); 148 root->scrollBy(scrollDelta); 149 m_hostImpl->setRootLayer(root.release()); 150 } 151 CCLayerImpl* root = m_hostImpl->rootLayer(); 146 152 147 153 OwnPtr<CCScrollAndScaleSet> scrollInfo; … … 166 172 TEST_F(CCLayerTreeHostImplTest, scrollRootCallsCommitAndRedraw) 167 173 { 168 RefPtr<CCLayerImpl> root = CCLayerImpl::create(0); 169 root->setScrollable(true); 170 root->setScrollPosition(IntPoint(0, 0)); 171 root->setMaxScrollPosition(IntSize(100, 100)); 172 m_hostImpl->setRootLayer(root); 174 { 175 OwnPtr<CCLayerImpl> root = CCLayerImpl::create(0); 176 root->setScrollable(true); 177 root->setScrollPosition(IntPoint(0, 0)); 178 root->setMaxScrollPosition(IntSize(100, 100)); 179 m_hostImpl->setRootLayer(root.release()); 180 } 181 173 182 EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(0, 0), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted); 174 183 m_hostImpl->scrollBy(IntSize(0, 10)); … … 180 189 TEST_F(CCLayerTreeHostImplTest, wheelEventHandlers) 181 190 { 182 RefPtr<CCLayerImpl> root = CCLayerImpl::create(0); 183 root->setScrollable(true); 184 root->setScrollPosition(IntPoint(0, 0)); 185 root->setMaxScrollPosition(IntSize(100, 100)); 186 m_hostImpl->setRootLayer(root); 191 { 192 OwnPtr<CCLayerImpl> root = CCLayerImpl::create(0); 193 root->setScrollable(true); 194 root->setScrollPosition(IntPoint(0, 0)); 195 root->setMaxScrollPosition(IntSize(100, 100)); 196 m_hostImpl->setRootLayer(root.release()); 197 } 198 CCLayerImpl* root = m_hostImpl->rootLayer(); 199 187 200 root->setHaveWheelEventHandlers(true); 188 201 // With registered event handlers, wheel scrolls have to go to the main thread. … … 322 335 class DidDrawCheckLayer : public CCLayerImpl { 323 336 public: 324 static Pass RefPtr<DidDrawCheckLayer> create(int id) { return adoptRef(new DidDrawCheckLayer(id)); }337 static PassOwnPtr<DidDrawCheckLayer> create(int id) { return adoptPtr(new DidDrawCheckLayer(id)); } 325 338 326 339 virtual void didDraw() … … 360 373 m_hostImpl->setViewportSize(IntSize(0, 0)); 361 374 362 RefPtr<DidDrawCheckLayer> root = DidDrawCheckLayer::create(0);363 m_hostImpl->setRootLayer(root);375 m_hostImpl->setRootLayer(DidDrawCheckLayer::create(0)); 376 DidDrawCheckLayer* root = static_cast<DidDrawCheckLayer*>(m_hostImpl->rootLayer()); 364 377 365 378 EXPECT_FALSE(root->willDrawCalled()); … … 393 406 m_hostImpl->setViewportSize(IntSize(10, 10)); 394 407 395 RefPtr<DidDrawCheckLayer> root = DidDrawCheckLayer::create(0);396 m_hostImpl->setRootLayer(root);397 398 RefPtr<DidDrawCheckLayer> layer1 = DidDrawCheckLayer::create(1);399 root->addChild(layer1);400 401 RefPtr<DidDrawCheckLayer> layer2 = DidDrawCheckLayer::create(2);402 layer1->addChild(layer2);408 m_hostImpl->setRootLayer(DidDrawCheckLayer::create(0)); 409 DidDrawCheckLayer* root = static_cast<DidDrawCheckLayer*>(m_hostImpl->rootLayer()); 410 411 root->addChild(DidDrawCheckLayer::create(1)); 412 DidDrawCheckLayer* layer1 = static_cast<DidDrawCheckLayer*>(root->children()[0].get()); 413 414 layer1->addChild(DidDrawCheckLayer::create(2)); 415 DidDrawCheckLayer* layer2 = static_cast<DidDrawCheckLayer*>(layer1->children()[0].get()); 403 416 404 417 layer1->setOpacity(0.3); … … 443 456 class BlendStateCheckLayer : public CCLayerImpl { 444 457 public: 445 static Pass RefPtr<BlendStateCheckLayer> create(int id) { return adoptRef(new BlendStateCheckLayer(id)); }458 static PassOwnPtr<BlendStateCheckLayer> create(int id) { return adoptPtr(new BlendStateCheckLayer(id)); } 446 459 447 460 virtual void appendQuads(CCQuadList& quadList, const CCSharedQuadState* sharedQuadState) … … 492 505 m_hostImpl->setViewportSize(IntSize(10, 10)); 493 506 494 RefPtr<CCLayerImpl> root = CCLayerImpl::create(0); 495 root->setAnchorPoint(FloatPoint(0, 0)); 496 root->setBounds(IntSize(10, 10)); 497 root->setDrawsContent(false); 498 m_hostImpl->setRootLayer(root); 499 500 RefPtr<BlendStateCheckLayer> layer1 = BlendStateCheckLayer::create(1); 501 root->addChild(layer1); 507 { 508 OwnPtr<CCLayerImpl> root = CCLayerImpl::create(0); 509 root->setAnchorPoint(FloatPoint(0, 0)); 510 root->setBounds(IntSize(10, 10)); 511 root->setDrawsContent(false); 512 m_hostImpl->setRootLayer(root.release()); 513 } 514 CCLayerImpl* root = m_hostImpl->rootLayer(); 515 516 root->addChild(BlendStateCheckLayer::create(1)); 517 BlendStateCheckLayer* layer1 = static_cast<BlendStateCheckLayer*>(root->children()[0].get()); 502 518 503 519 // Opaque layer, drawn without blending. … … 538 554 EXPECT_TRUE(layer1->quadsAppended()); 539 555 540 RefPtr<BlendStateCheckLayer> layer2 = BlendStateCheckLayer::create(2);541 layer1->addChild(layer2);556 layer1->addChild(BlendStateCheckLayer::create(2)); 557 BlendStateCheckLayer* layer2 = static_cast<BlendStateCheckLayer*>(layer1->children()[0].get()); 542 558 543 559 // 2 opaque layers, drawn without blending. … … 657 673 m_hostImpl->setViewportSize(IntSize(10, 10)); 658 674 659 RefPtr<CCLayerImpl> root = adoptRef(new FakeDrawableCCLayerImpl(1));675 CCLayerImpl* root = new FakeDrawableCCLayerImpl(1); 660 676 root->setAnchorPoint(FloatPoint(0, 0)); 661 677 root->setBounds(IntSize(10, 10)); 662 678 root->setDrawsContent(true); 663 m_hostImpl->setRootLayer( root);679 m_hostImpl->setRootLayer(adoptPtr(root)); 664 680 EXPECT_FALSE(reshapeTracker->reshapeCalled()); 665 681 … … 704 720 layerTreeHostImpl->setViewportSize(IntSize(500, 500)); 705 721 706 RefPtr<CCLayerImpl> root = adoptRef(new FakeDrawableCCLayerImpl(1));707 RefPtr<CCLayerImpl> child = adoptRef(new FakeDrawableCCLayerImpl(2));722 CCLayerImpl* root = new FakeDrawableCCLayerImpl(1); 723 CCLayerImpl* child = new FakeDrawableCCLayerImpl(2); 708 724 child->setPosition(FloatPoint(12, 13)); 709 725 child->setAnchorPoint(FloatPoint(0, 0)); … … 713 729 root->setBounds(IntSize(500, 500)); 714 730 root->setDrawsContent(true); 715 root->addChild( child);716 layerTreeHostImpl->setRootLayer( root);731 root->addChild(adoptPtr(child)); 732 layerTreeHostImpl->setRootLayer(adoptPtr(root)); 717 733 718 734 // First frame, the entire screen should get swapped. -
trunk/Source/WebKit/chromium/tests/CCRenderSurfaceTest.cpp
r101318 r108886 55 55 DebugScopedSetImplThread setImplThread; 56 56 57 RefPtr<CCLayerImpl> owningLayer = CCLayerImpl::create(0);57 OwnPtr<CCLayerImpl> owningLayer = CCLayerImpl::create(0); 58 58 owningLayer->createRenderSurface(); 59 59 ASSERT_TRUE(owningLayer->renderSurface()); … … 75 75 EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE(renderSurface->setContentRect(testRect)); 76 76 77 RefPtr<CCLayerImpl> dummyMask = CCLayerImpl::create(1);77 OwnPtr<CCLayerImpl> dummyMask = CCLayerImpl::create(1); 78 78 TransformationMatrix dummyMatrix; 79 79 dummyMatrix.translate(1.0, 2.0); -
trunk/Source/WebKit/chromium/tests/CCSolidColorLayerImplTest.cpp
r105634 r108886 47 47 IntRect visibleLayerRect = IntRect(IntPoint(), layerSize); 48 48 49 RefPtr<CCSolidColorLayerImpl> layer = CCSolidColorLayerImpl::create(0);49 OwnPtr<CCSolidColorLayerImpl> layer = CCSolidColorLayerImpl::create(0); 50 50 layer->setVisibleLayerRect(visibleLayerRect); 51 51 layer->setBounds(layerSize); … … 67 67 IntRect visibleLayerRect = IntRect(IntPoint(), layerSize); 68 68 69 RefPtr<CCSolidColorLayerImpl> layer = CCSolidColorLayerImpl::create(0);69 OwnPtr<CCSolidColorLayerImpl> layer = CCSolidColorLayerImpl::create(0); 70 70 layer->setVisibleLayerRect(visibleLayerRect); 71 71 layer->setBounds(layerSize); -
trunk/Source/WebKit/chromium/tests/CCTiledLayerImplTest.cpp
r106300 r108886 40 40 // Create a default tiled layer with textures for all tiles and a default 41 41 // visibility of the entire layer size. 42 static Pass RefPtr<CCTiledLayerImpl> createLayer(const IntSize& tileSize, const IntSize& layerSize, CCLayerTilingData::BorderTexelOption borderTexels)43 { 44 RefPtr<CCTiledLayerImpl> layer = CCTiledLayerImpl::create(0);42 static PassOwnPtr<CCTiledLayerImpl> createLayer(const IntSize& tileSize, const IntSize& layerSize, CCLayerTilingData::BorderTexelOption borderTexels) 43 { 44 OwnPtr<CCTiledLayerImpl> layer = CCTiledLayerImpl::create(0); 45 45 OwnPtr<CCLayerTilingData> tiler = CCLayerTilingData::create(tileSize, borderTexels); 46 46 tiler->setBounds(layerSize); … … 69 69 // Verify default layer does creates quads 70 70 { 71 RefPtr<CCTiledLayerImpl> layer = createLayer(tileSize, layerSize, CCLayerTilingData::NoBorderTexels);71 OwnPtr<CCTiledLayerImpl> layer = createLayer(tileSize, layerSize, CCLayerTilingData::NoBorderTexels); 72 72 CCQuadList quads; 73 73 OwnPtr<CCSharedQuadState> sharedQuadState = layer->createSharedQuadState(); … … 79 79 // Layer with empty visible layer rect produces no quads 80 80 { 81 RefPtr<CCTiledLayerImpl> layer = createLayer(tileSize, layerSize, CCLayerTilingData::NoBorderTexels);81 OwnPtr<CCTiledLayerImpl> layer = createLayer(tileSize, layerSize, CCLayerTilingData::NoBorderTexels); 82 82 layer->setVisibleLayerRect(IntRect()); 83 83 … … 90 90 // Layer with non-intersecting visible layer rect produces no quads 91 91 { 92 RefPtr<CCTiledLayerImpl> layer = createLayer(tileSize, layerSize, CCLayerTilingData::NoBorderTexels);92 OwnPtr<CCTiledLayerImpl> layer = createLayer(tileSize, layerSize, CCLayerTilingData::NoBorderTexels); 93 93 94 94 IntRect outsideBounds(IntPoint(-100, -100), IntSize(50, 50)); … … 103 103 // Layer with skips draw produces no quads 104 104 { 105 RefPtr<CCTiledLayerImpl> layer = createLayer(tileSize, layerSize, CCLayerTilingData::NoBorderTexels);105 OwnPtr<CCTiledLayerImpl> layer = createLayer(tileSize, layerSize, CCLayerTilingData::NoBorderTexels); 106 106 layer->setSkipsDraw(true); 107 107 … … 122 122 const IntSize layerSize(tileSize.width() * numTilesX, tileSize.height() * numTilesY); 123 123 124 RefPtr<CCTiledLayerImpl> layer = createLayer(tileSize, layerSize, CCLayerTilingData::NoBorderTexels);124 OwnPtr<CCTiledLayerImpl> layer = createLayer(tileSize, layerSize, CCLayerTilingData::NoBorderTexels); 125 125 OwnPtr<CCSharedQuadState> sharedQuadState = layer->createSharedQuadState(); 126 126 … … 151 151 static PassOwnPtr<CCSharedQuadState> getQuads(CCQuadList& quads, IntSize tileSize, const IntSize& layerSize, CCLayerTilingData::BorderTexelOption borderTexelOption, const IntRect& visibleLayerRect) 152 152 { 153 RefPtr<CCTiledLayerImpl> layer = createLayer(tileSize, layerSize, borderTexelOption);153 OwnPtr<CCTiledLayerImpl> layer = createLayer(tileSize, layerSize, borderTexelOption); 154 154 layer->setVisibleLayerRect(visibleLayerRect); 155 155 layer->setBounds(layerSize); … … 261 261 const unsigned numTiles = numTilesX * numTilesY; 262 262 const IntSize layerSize(tileSize.width() * numTilesX, tileSize.height() * numTilesY); 263 RefPtr<CCTiledLayerImpl> layer = createLayer(tileSize, layerSize, CCLayerTilingData::NoBorderTexels);263 OwnPtr<CCTiledLayerImpl> layer = createLayer(tileSize, layerSize, CCLayerTilingData::NoBorderTexels); 264 264 layer->setBackgroundColor(Color::gray); 265 265 layer->setBackgroundCoversViewport(true); -
trunk/Source/WebKit/chromium/tests/Canvas2DLayerChromiumTest.cpp
r108706 r108886 140 140 DebugScopedSetImplThread scopedImplThread; 141 141 142 RefPtr<CCLayerImpl> layerImpl = canvas->createCCLayerImpl();142 OwnPtr<CCLayerImpl> layerImpl = canvas->createCCLayerImpl(); 143 143 EXPECT_EQ(0u, static_cast<CCCanvasLayerImpl*>(layerImpl.get())->textureId()); 144 144 -
trunk/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp
r108431 r108886 232 232 RefPtr<FakeTiledLayerChromium> layer = adoptRef(new FakeTiledLayerChromium(textureManager.get())); 233 233 DebugScopedSetImplThread implThread; 234 RefPtr<FakeCCTiledLayerImpl> layerImpl = adoptRef(new FakeCCTiledLayerImpl(0));234 OwnPtr<FakeCCTiledLayerImpl> layerImpl = adoptPtr(new FakeCCTiledLayerImpl(0)); 235 235 236 236 FakeTextureAllocator textureAllocator; … … 267 267 RefPtr<FakeTiledLayerChromium> layer = adoptRef(new FakeTiledLayerChromium(textureManager.get())); 268 268 DebugScopedSetImplThread implThread; 269 RefPtr<FakeCCTiledLayerImpl> layerImpl = adoptRef(new FakeCCTiledLayerImpl(0));269 OwnPtr<FakeCCTiledLayerImpl> layerImpl = adoptPtr(new FakeCCTiledLayerImpl(0)); 270 270 271 271 FakeTextureAllocator textureAllocator; … … 333 333 RefPtr<FakeTiledLayerChromium> layer = adoptRef(new FakeTiledLayerChromium(textureManager.get())); 334 334 DebugScopedSetImplThread implThread; 335 RefPtr<FakeCCTiledLayerImpl> layerImpl = adoptRef(new FakeCCTiledLayerImpl(0));335 OwnPtr<FakeCCTiledLayerImpl> layerImpl = adoptPtr(new FakeCCTiledLayerImpl(0)); 336 336 337 337 FakeTextureAllocator textureAllocator; … … 369 369 RefPtr<FakeTiledLayerChromium> layer = adoptRef(new FakeTiledLayerChromium(textureManager.get())); 370 370 DebugScopedSetImplThread implThread; 371 RefPtr<FakeCCTiledLayerImpl> layerImpl = adoptRef(new FakeCCTiledLayerImpl(0));371 OwnPtr<FakeCCTiledLayerImpl> layerImpl = adoptPtr(new FakeCCTiledLayerImpl(0)); 372 372 373 373 FakeTextureAllocator textureAllocator; … … 449 449 RefPtr<FakeTiledLayerChromium> layer = adoptRef(new FakeTiledLayerChromium(textureManager.get())); 450 450 DebugScopedSetImplThread implThread; 451 RefPtr<FakeCCTiledLayerImpl> layerImpl = adoptRef(new FakeCCTiledLayerImpl(0));451 OwnPtr<FakeCCTiledLayerImpl> layerImpl = adoptPtr(new FakeCCTiledLayerImpl(0)); 452 452 453 453 FakeTextureAllocator textureAllocator; -
trunk/Source/WebKit/chromium/tests/TreeSynchronizerTest.cpp
r108581 r108886 42 42 class MockCCLayerImpl : public CCLayerImpl { 43 43 public: 44 static Pass RefPtr<MockCCLayerImpl> create(int layerId)45 { 46 return adopt Ref(new MockCCLayerImpl(layerId));44 static PassOwnPtr<MockCCLayerImpl> create(int layerId) 45 { 46 return adoptPtr(new MockCCLayerImpl(layerId)); 47 47 } 48 48 virtual ~MockCCLayerImpl() … … 73 73 virtual ~MockLayerChromium() { } 74 74 75 virtual Pass RefPtr<CCLayerImpl> createCCLayerImpl()75 virtual PassOwnPtr<CCLayerImpl> createCCLayerImpl() 76 76 { 77 77 return MockCCLayerImpl::create(m_layerId); … … 135 135 136 136 const Vector<RefPtr<LayerChromium> >& layerChildren = layer->children(); 137 const Vector< RefPtr<CCLayerImpl> >& ccLayerChildren = ccLayer->children();137 const Vector<OwnPtr<CCLayerImpl> >& ccLayerChildren = ccLayer->children(); 138 138 139 139 ASSERT_EQ(layerChildren.size(), ccLayerChildren.size()); … … 151 151 layerTreeRoot->addChild(LayerChromium::create()); 152 152 153 RefPtr<CCLayerImpl> ccLayerTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(), 0);153 OwnPtr<CCLayerImpl> ccLayerTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(), nullptr); 154 154 155 155 expectTreesAreIdentical(layerTreeRoot.get(), ccLayerTreeRoot.get()); … … 166 166 layerTreeRoot->addChild(MockLayerChromium::create(&ccLayerDestructionList)); 167 167 168 RefPtr<CCLayerImpl> ccLayerTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(), 0);168 OwnPtr<CCLayerImpl> ccLayerTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(), nullptr); 169 169 expectTreesAreIdentical(layerTreeRoot.get(), ccLayerTreeRoot.get()); 170 170 … … 200 200 layerTreeRoot->children()[1]->setBounds(secondChildBounds); 201 201 202 RefPtr<CCLayerImpl> ccLayerTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(), 0);202 OwnPtr<CCLayerImpl> ccLayerTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(), nullptr); 203 203 expectTreesAreIdentical(layerTreeRoot.get(), ccLayerTreeRoot.get()); 204 204 … … 237 237 RefPtr<LayerChromium> layerD = layerB->children()[1].get(); 238 238 239 RefPtr<CCLayerImpl> ccLayerTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(), 0);239 OwnPtr<CCLayerImpl> ccLayerTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(), nullptr); 240 240 expectTreesAreIdentical(layerTreeRoot.get(), ccLayerTreeRoot.get()); 241 241 … … 275 275 int oldTreeSecondChildLayerId = oldLayerTreeRoot->children()[1]->id(); 276 276 277 RefPtr<CCLayerImpl> ccLayerTreeRoot = TreeSynchronizer::synchronizeTrees(oldLayerTreeRoot.get(), 0);277 OwnPtr<CCLayerImpl> ccLayerTreeRoot = TreeSynchronizer::synchronizeTrees(oldLayerTreeRoot.get(), nullptr); 278 278 expectTreesAreIdentical(oldLayerTreeRoot.get(), ccLayerTreeRoot.get()); 279 279 … … 315 315 layerTreeRoot->children()[2]->setReplicaLayer(replicaLayerWithMask.get()); 316 316 317 RefPtr<CCLayerImpl> ccLayerTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(), 0);317 OwnPtr<CCLayerImpl> ccLayerTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(), nullptr); 318 318 319 319 expectTreesAreIdentical(layerTreeRoot.get(), ccLayerTreeRoot.get()); … … 321 321 // Remove the mask layer. 322 322 layerTreeRoot->children()[0]->setMaskLayer(0); 323 ccLayerTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(), ccLayerTreeRoot. get());323 ccLayerTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(), ccLayerTreeRoot.release()); 324 324 expectTreesAreIdentical(layerTreeRoot.get(), ccLayerTreeRoot.get()); 325 325 326 326 // Remove the replica layer. 327 327 layerTreeRoot->children()[1]->setReplicaLayer(0); 328 ccLayerTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(), ccLayerTreeRoot. get());328 ccLayerTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(), ccLayerTreeRoot.release()); 329 329 expectTreesAreIdentical(layerTreeRoot.get(), ccLayerTreeRoot.get()); 330 330 331 331 // Remove the replica mask. 332 332 replicaLayerWithMask->setMaskLayer(0); 333 ccLayerTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(), ccLayerTreeRoot. get());333 ccLayerTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(), ccLayerTreeRoot.release()); 334 334 expectTreesAreIdentical(layerTreeRoot.get(), ccLayerTreeRoot.get()); 335 335 } … … 344 344 EXPECT_FALSE(static_cast<FakeLayerAnimationController*>(layerTreeRoot->layerAnimationController())->synchronizedAnimations()); 345 345 346 RefPtr<CCLayerImpl> ccLayerTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(), 0);347 ccLayerTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(), ccLayerTreeRoot. get());346 OwnPtr<CCLayerImpl> ccLayerTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(), nullptr); 347 ccLayerTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(), ccLayerTreeRoot.release()); 348 348 349 349 EXPECT_TRUE(static_cast<FakeLayerAnimationController*>(layerTreeRoot->layerAnimationController())->synchronizedAnimations());
Note: See TracChangeset
for help on using the changeset viewer.