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

Side by Side Diff: Source/core/rendering/RenderLayer.cpp

Issue 457473002: Remove the CompositedLayerMappingPtr smart ptr. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 3287 matching lines...) Expand 10 before | Expand all | Expand 10 after
3298 return PaintsIntoOwnBacking; 3298 return PaintsIntoOwnBacking;
3299 } 3299 }
3300 3300
3301 bool RenderLayer::isAllowedToQueryCompositingState() const 3301 bool RenderLayer::isAllowedToQueryCompositingState() const
3302 { 3302 {
3303 if (gCompositingQueryMode == CompositingQueriesAreAllowed) 3303 if (gCompositingQueryMode == CompositingQueriesAreAllowed)
3304 return true; 3304 return true;
3305 return renderer()->document().lifecycle().state() >= DocumentLifecycle::InCo mpositingUpdate; 3305 return renderer()->document().lifecycle().state() >= DocumentLifecycle::InCo mpositingUpdate;
3306 } 3306 }
3307 3307
3308 CompositedLayerMappingPtr RenderLayer::compositedLayerMapping() const 3308 CompositedLayerMapping* RenderLayer::compositedLayerMapping() const
3309 { 3309 {
3310 ASSERT(isAllowedToQueryCompositingState()); 3310 ASSERT(isAllowedToQueryCompositingState());
3311 return m_compositedLayerMapping.get(); 3311 return m_compositedLayerMapping.get();
3312 } 3312 }
3313 3313
3314 GraphicsLayer* RenderLayer::graphicsLayerBacking() const 3314 GraphicsLayer* RenderLayer::graphicsLayerBacking() const
3315 { 3315 {
3316 switch (compositingState()) { 3316 switch (compositingState()) {
3317 case NotComposited: 3317 case NotComposited:
3318 return 0; 3318 return 0;
3319 case PaintsIntoGroupedBacking: 3319 case PaintsIntoGroupedBacking:
3320 return groupedMapping()->squashingLayer(); 3320 return groupedMapping()->squashingLayer();
3321 default: 3321 default:
3322 return compositedLayerMapping()->mainGraphicsLayer(); 3322 return compositedLayerMapping()->mainGraphicsLayer();
3323 } 3323 }
3324 } 3324 }
3325 3325
3326 GraphicsLayer* RenderLayer::graphicsLayerBackingForScrolling() const 3326 GraphicsLayer* RenderLayer::graphicsLayerBackingForScrolling() const
3327 { 3327 {
3328 switch (compositingState()) { 3328 switch (compositingState()) {
3329 case NotComposited: 3329 case NotComposited:
3330 return 0; 3330 return 0;
3331 case PaintsIntoGroupedBacking: 3331 case PaintsIntoGroupedBacking:
3332 return groupedMapping()->squashingLayer(); 3332 return groupedMapping()->squashingLayer();
3333 default: 3333 default:
3334 return compositedLayerMapping()->scrollingContentsLayer() ? compositedLa yerMapping()->scrollingContentsLayer() : compositedLayerMapping()->mainGraphicsL ayer(); 3334 return compositedLayerMapping()->scrollingContentsLayer() ? compositedLa yerMapping()->scrollingContentsLayer() : compositedLayerMapping()->mainGraphicsL ayer();
3335 } 3335 }
3336 } 3336 }
3337 3337
3338 CompositedLayerMappingPtr RenderLayer::ensureCompositedLayerMapping() 3338 CompositedLayerMapping* RenderLayer::ensureCompositedLayerMapping()
3339 { 3339 {
3340 if (!m_compositedLayerMapping) { 3340 if (!m_compositedLayerMapping) {
3341 m_compositedLayerMapping = adoptPtr(new CompositedLayerMapping(*this)); 3341 m_compositedLayerMapping = adoptPtr(new CompositedLayerMapping(*this));
3342 m_compositedLayerMapping->setNeedsGraphicsLayerUpdate(GraphicsLayerUpdat eSubtree); 3342 m_compositedLayerMapping->setNeedsGraphicsLayerUpdate(GraphicsLayerUpdat eSubtree);
3343 3343
3344 updateOrRemoveFilterEffectRenderer(); 3344 updateOrRemoveFilterEffectRenderer();
3345 3345
3346 if (RuntimeEnabledFeatures::cssCompositingEnabled()) 3346 if (RuntimeEnabledFeatures::cssCompositingEnabled())
3347 compositedLayerMapping()->setBlendMode(m_blendInfo.blendMode()); 3347 compositedLayerMapping()->setBlendMode(m_blendInfo.blendMode());
3348 } 3348 }
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
3793 } 3793 }
3794 } 3794 }
3795 3795
3796 void showLayerTree(const blink::RenderObject* renderer) 3796 void showLayerTree(const blink::RenderObject* renderer)
3797 { 3797 {
3798 if (!renderer) 3798 if (!renderer)
3799 return; 3799 return;
3800 showLayerTree(renderer->enclosingLayer()); 3800 showLayerTree(renderer->enclosingLayer());
3801 } 3801 }
3802 #endif 3802 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698