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

Side by Side Diff: cc/CCLayerImpl.cpp

Issue 11099040: [cc] Store CCLayerImpls as scoped_ptrs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix cc unit tests Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/CCLayerImpl.h ('k') | cc/CCLayerImplTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 6
7 #if USE(ACCELERATED_COMPOSITING) 7 #if USE(ACCELERATED_COMPOSITING)
8 8
9 #include "CCLayerImpl.h" 9 #include "CCLayerImpl.h"
10 10
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 } 66 }
67 67
68 CCLayerImpl::~CCLayerImpl() 68 CCLayerImpl::~CCLayerImpl()
69 { 69 {
70 ASSERT(CCProxy::isImplThread()); 70 ASSERT(CCProxy::isImplThread());
71 #ifndef NDEBUG 71 #ifndef NDEBUG
72 ASSERT(!m_betweenWillDrawAndDidDraw); 72 ASSERT(!m_betweenWillDrawAndDidDraw);
73 #endif 73 #endif
74 } 74 }
75 75
76 void CCLayerImpl::addChild(PassOwnPtr<CCLayerImpl> child) 76 void CCLayerImpl::addChild(scoped_ptr<CCLayerImpl> child)
77 { 77 {
78 child->setParent(this); 78 child->setParent(this);
79 m_children.append(child); 79 m_children.append(child.Pass());
80 } 80 }
81 81
82 void CCLayerImpl::removeFromParent() 82 void CCLayerImpl::removeFromParent()
83 { 83 {
84 if (!m_parent) 84 if (!m_parent)
85 return; 85 return;
86 86
87 CCLayerImpl* parent = m_parent; 87 CCLayerImpl* parent = m_parent;
88 m_parent = 0; 88 m_parent = 0;
89 89
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 return; 406 return;
407 407
408 m_bounds = bounds; 408 m_bounds = bounds;
409 409
410 if (masksToBounds()) 410 if (masksToBounds())
411 noteLayerPropertyChangedForSubtree(); 411 noteLayerPropertyChangedForSubtree();
412 else 412 else
413 m_layerPropertyChanged = true; 413 m_layerPropertyChanged = true;
414 } 414 }
415 415
416 void CCLayerImpl::setMaskLayer(PassOwnPtr<CCLayerImpl> maskLayer) 416 void CCLayerImpl::setMaskLayer(scoped_ptr<CCLayerImpl> maskLayer)
417 { 417 {
418 m_maskLayer = maskLayer; 418 m_maskLayer = maskLayer.Pass();
419 419
420 int newLayerId = m_maskLayer ? m_maskLayer->id() : -1; 420 int newLayerId = m_maskLayer ? m_maskLayer->id() : -1;
421 if (newLayerId == m_maskLayerId) 421 if (newLayerId == m_maskLayerId)
422 return; 422 return;
423 423
424 m_maskLayerId = newLayerId; 424 m_maskLayerId = newLayerId;
425 noteLayerPropertyChangedForSubtree(); 425 noteLayerPropertyChangedForSubtree();
426 } 426 }
427 427
428 void CCLayerImpl::setReplicaLayer(PassOwnPtr<CCLayerImpl> replicaLayer) 428 void CCLayerImpl::setReplicaLayer(scoped_ptr<CCLayerImpl> replicaLayer)
429 { 429 {
430 m_replicaLayer = replicaLayer; 430 m_replicaLayer = replicaLayer.Pass();
431 431
432 int newLayerId = m_replicaLayer ? m_replicaLayer->id() : -1; 432 int newLayerId = m_replicaLayer ? m_replicaLayer->id() : -1;
433 if (newLayerId == m_replicaLayerId) 433 if (newLayerId == m_replicaLayerId)
434 return; 434 return;
435 435
436 m_replicaLayerId = newLayerId; 436 m_replicaLayerId = newLayerId;
437 noteLayerPropertyChangedForSubtree(); 437 noteLayerPropertyChangedForSubtree();
438 } 438 }
439 439
440 void CCLayerImpl::setDrawsContent(bool drawsContent) 440 void CCLayerImpl::setDrawsContent(bool drawsContent)
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 if (!m_scrollbarAnimationController) 676 if (!m_scrollbarAnimationController)
677 m_scrollbarAnimationController = CCScrollbarAnimationController::create( this); 677 m_scrollbarAnimationController = CCScrollbarAnimationController::create( this);
678 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); 678 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer);
679 m_scrollbarAnimationController->updateScrollOffset(this); 679 m_scrollbarAnimationController->updateScrollOffset(this);
680 } 680 }
681 681
682 } 682 }
683 683
684 684
685 #endif // USE(ACCELERATED_COMPOSITING) 685 #endif // USE(ACCELERATED_COMPOSITING)
OLDNEW
« no previous file with comments | « cc/CCLayerImpl.h ('k') | cc/CCLayerImplTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698