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

Side by Side Diff: Source/core/layout/compositing/CompositingLayerAssigner.cpp

Issue 1162383003: C++11: Replace 0 with nullptr where applicable in layout code. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add one more file. Created 5 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2014 Google Inc. All rights reserved. 3 * Copyright (C) 2014 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 203
204 // Issue a paint invalidation, since |layer| may have been added to an a lready-existing squashing layer. 204 // Issue a paint invalidation, since |layer| may have been added to an a lready-existing squashing layer.
205 TRACE_LAYER_INVALIDATION(layer, InspectorLayerInvalidationTrackingEvent: :AddedToSquashingLayer); 205 TRACE_LAYER_INVALIDATION(layer, InspectorLayerInvalidationTrackingEvent: :AddedToSquashingLayer);
206 layersNeedingPaintInvalidation.append(layer); 206 layersNeedingPaintInvalidation.append(layer);
207 m_layersChanged = true; 207 m_layersChanged = true;
208 } else if (compositedLayerUpdate == RemoveFromSquashingLayer) { 208 } else if (compositedLayerUpdate == RemoveFromSquashingLayer) {
209 if (layer->groupedMapping()) { 209 if (layer->groupedMapping()) {
210 // Before removing |layer| from an already-existing squashing layer that may have other content, issue a paint invalidation. 210 // Before removing |layer| from an already-existing squashing layer that may have other content, issue a paint invalidation.
211 m_compositor->paintInvalidationOnCompositingChange(layer); 211 m_compositor->paintInvalidationOnCompositingChange(layer);
212 layer->groupedMapping()->setNeedsGraphicsLayerUpdate(GraphicsLayerUp dateSubtree); 212 layer->groupedMapping()->setNeedsGraphicsLayerUpdate(GraphicsLayerUp dateSubtree);
213 layer->setGroupedMapping(0); 213 layer->setGroupedMapping(nullptr);
214 } 214 }
215 215
216 // If we need to issue paint invalidations, do so now that we've removed it from a squashed layer. 216 // If we need to issue paint invalidations, do so now that we've removed it from a squashed layer.
217 TRACE_LAYER_INVALIDATION(layer, InspectorLayerInvalidationTrackingEvent: :RemovedFromSquashingLayer); 217 TRACE_LAYER_INVALIDATION(layer, InspectorLayerInvalidationTrackingEvent: :RemovedFromSquashingLayer);
218 layersNeedingPaintInvalidation.append(layer); 218 layersNeedingPaintInvalidation.append(layer);
219 m_layersChanged = true; 219 m_layersChanged = true;
220 220
221 layer->setLostGroupedMapping(false); 221 layer->setLostGroupedMapping(false);
222 } 222 }
223 } 223 }
(...skipping 10 matching lines...) Expand all
234 m_compositor->updateDirectCompositingReasons(reflectionLayer); 234 m_compositor->updateDirectCompositingReasons(reflectionLayer);
235 235
236 // FIXME: Why do we updateGraphicsLayerConfiguration here instead of in the GraphicsLayerUpdater? 236 // FIXME: Why do we updateGraphicsLayerConfiguration here instead of in the GraphicsLayerUpdater?
237 if (reflectionLayer->hasCompositedDeprecatedPaintLayerMapping()) 237 if (reflectionLayer->hasCompositedDeprecatedPaintLayerMapping())
238 reflectionLayer->compositedDeprecatedPaintLayerMapping()->updateGraphics LayerConfiguration(); 238 reflectionLayer->compositedDeprecatedPaintLayerMapping()->updateGraphics LayerConfiguration();
239 } 239 }
240 240
241 static ScrollingCoordinator* scrollingCoordinatorFromLayer(DeprecatedPaintLayer& layer) 241 static ScrollingCoordinator* scrollingCoordinatorFromLayer(DeprecatedPaintLayer& layer)
242 { 242 {
243 Page* page = layer.layoutObject()->frame()->page(); 243 Page* page = layer.layoutObject()->frame()->page();
244 if (!page) 244 return (!page) ? nullptr : page->scrollingCoordinator();
245 return 0;
246
247 return page->scrollingCoordinator();
248 } 245 }
249 246
250 void CompositingLayerAssigner::assignLayersToBackingsInternal(DeprecatedPaintLay er* layer, SquashingState& squashingState, Vector<DeprecatedPaintLayer*>& layers NeedingPaintInvalidation) 247 void CompositingLayerAssigner::assignLayersToBackingsInternal(DeprecatedPaintLay er* layer, SquashingState& squashingState, Vector<DeprecatedPaintLayer*>& layers NeedingPaintInvalidation)
251 { 248 {
252 if (requiresSquashing(layer->compositingReasons())) { 249 if (requiresSquashing(layer->compositingReasons())) {
253 CompositingReasons reasonsPreventingSquashing = getReasonsPreventingSqua shing(layer, squashingState); 250 CompositingReasons reasonsPreventingSquashing = getReasonsPreventingSqua shing(layer, squashingState);
254 if (reasonsPreventingSquashing) 251 if (reasonsPreventingSquashing)
255 layer->setCompositingReasons(layer->compositingReasons() | reasonsPr eventingSquashing); 252 layer->setCompositingReasons(layer->compositingReasons() | reasonsPr eventingSquashing);
256 } 253 }
257 254
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 // At this point, if the layer is to be separately composited, then its back ing becomes the most recent in paint-order. 288 // At this point, if the layer is to be separately composited, then its back ing becomes the most recent in paint-order.
292 if (layer->compositingState() == PaintsIntoOwnBacking) { 289 if (layer->compositingState() == PaintsIntoOwnBacking) {
293 ASSERT(!requiresSquashing(layer->compositingReasons())); 290 ASSERT(!requiresSquashing(layer->compositingReasons()));
294 squashingState.updateSquashingStateForNewMapping(layer->compositedDeprec atedPaintLayerMapping(), layer->hasCompositedDeprecatedPaintLayerMapping()); 291 squashingState.updateSquashingStateForNewMapping(layer->compositedDeprec atedPaintLayerMapping(), layer->hasCompositedDeprecatedPaintLayerMapping());
295 } 292 }
296 293
297 if (layer->scrollParent()) 294 if (layer->scrollParent())
298 layer->scrollParent()->scrollableArea()->setTopmostScrollChild(layer); 295 layer->scrollParent()->scrollableArea()->setTopmostScrollChild(layer);
299 296
300 if (layer->needsCompositedScrolling()) 297 if (layer->needsCompositedScrolling())
301 layer->scrollableArea()->setTopmostScrollChild(0); 298 layer->scrollableArea()->setTopmostScrollChild(nullptr);
302 299
303 DeprecatedPaintLayerStackingNodeIterator iterator(*layer->stackingNode(), No rmalFlowChildren | PositiveZOrderChildren); 300 DeprecatedPaintLayerStackingNodeIterator iterator(*layer->stackingNode(), No rmalFlowChildren | PositiveZOrderChildren);
304 while (DeprecatedPaintLayerStackingNode* curNode = iterator.next()) 301 while (DeprecatedPaintLayerStackingNode* curNode = iterator.next())
305 assignLayersToBackingsInternal(curNode->layer(), squashingState, layersN eedingPaintInvalidation); 302 assignLayersToBackingsInternal(curNode->layer(), squashingState, layersN eedingPaintInvalidation);
306 303
307 if (squashingState.hasMostRecentMapping && &squashingState.mostRecentMapping ->owningLayer() == layer) 304 if (squashingState.hasMostRecentMapping && &squashingState.mostRecentMapping ->owningLayer() == layer)
308 squashingState.haveAssignedBackingsToEntireSquashingLayerSubtree = true; 305 squashingState.haveAssignedBackingsToEntireSquashingLayerSubtree = true;
309 } 306 }
310 307
311 } 308 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698