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

Side by Side Diff: cc/CCLayerImpl.cpp

Issue 11076013: [cc] Store CCLayerImpls as scoped_ptrs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 } 67 }
68 68
69 CCLayerImpl::~CCLayerImpl() 69 CCLayerImpl::~CCLayerImpl()
70 { 70 {
71 ASSERT(CCProxy::isImplThread()); 71 ASSERT(CCProxy::isImplThread());
72 #ifndef NDEBUG 72 #ifndef NDEBUG
73 ASSERT(!m_betweenWillDrawAndDidDraw); 73 ASSERT(!m_betweenWillDrawAndDidDraw);
74 #endif 74 #endif
75 } 75 }
76 76
77 void CCLayerImpl::addChild(PassOwnPtr<CCLayerImpl> child) 77 void CCLayerImpl::addChild(scoped_ptr<CCLayerImpl> child)
78 { 78 {
79 child->setParent(this); 79 child->setParent(this);
80 m_children.append(child); 80 m_children.append(child.Pass());
81 } 81 }
82 82
83 void CCLayerImpl::removeFromParent() 83 void CCLayerImpl::removeFromParent()
84 { 84 {
85 if (!m_parent) 85 if (!m_parent)
86 return; 86 return;
87 87
88 CCLayerImpl* parent = m_parent; 88 CCLayerImpl* parent = m_parent;
89 m_parent = 0; 89 m_parent = 0;
90 90
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 return; 404 return;
405 405
406 m_bounds = bounds; 406 m_bounds = bounds;
407 407
408 if (masksToBounds()) 408 if (masksToBounds())
409 noteLayerPropertyChangedForSubtree(); 409 noteLayerPropertyChangedForSubtree();
410 else 410 else
411 m_layerPropertyChanged = true; 411 m_layerPropertyChanged = true;
412 } 412 }
413 413
414 void CCLayerImpl::setMaskLayer(PassOwnPtr<CCLayerImpl> maskLayer) 414 void CCLayerImpl::setMaskLayer(scoped_ptr<CCLayerImpl> maskLayer)
415 { 415 {
416 m_maskLayer = maskLayer; 416 m_maskLayer = maskLayer.Pass();
417 417
418 int newLayerId = m_maskLayer ? m_maskLayer->id() : -1; 418 int newLayerId = m_maskLayer ? m_maskLayer->id() : -1;
419 if (newLayerId == m_maskLayerId) 419 if (newLayerId == m_maskLayerId)
420 return; 420 return;
421 421
422 m_maskLayerId = newLayerId; 422 m_maskLayerId = newLayerId;
423 noteLayerPropertyChangedForSubtree(); 423 noteLayerPropertyChangedForSubtree();
424 } 424 }
425 425
426 void CCLayerImpl::setReplicaLayer(PassOwnPtr<CCLayerImpl> replicaLayer) 426 void CCLayerImpl::setReplicaLayer(scoped_ptr<CCLayerImpl> replicaLayer)
427 { 427 {
428 m_replicaLayer = replicaLayer; 428 m_replicaLayer = replicaLayer.Pass();
429 429
430 int newLayerId = m_replicaLayer ? m_replicaLayer->id() : -1; 430 int newLayerId = m_replicaLayer ? m_replicaLayer->id() : -1;
431 if (newLayerId == m_replicaLayerId) 431 if (newLayerId == m_replicaLayerId)
432 return; 432 return;
433 433
434 m_replicaLayerId = newLayerId; 434 m_replicaLayerId = newLayerId;
435 noteLayerPropertyChangedForSubtree(); 435 noteLayerPropertyChangedForSubtree();
436 } 436 }
437 437
438 void CCLayerImpl::setDrawsContent(bool drawsContent) 438 void CCLayerImpl::setDrawsContent(bool drawsContent)
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 if (!m_scrollbarAnimationController) 674 if (!m_scrollbarAnimationController)
675 m_scrollbarAnimationController = CCScrollbarAnimationController::create( this); 675 m_scrollbarAnimationController = CCScrollbarAnimationController::create( this);
676 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); 676 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer);
677 m_scrollbarAnimationController->updateScrollOffset(this); 677 m_scrollbarAnimationController->updateScrollOffset(this);
678 } 678 }
679 679
680 } 680 }
681 681
682 682
683 #endif // USE(ACCELERATED_COMPOSITING) 683 #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