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

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 2610253004: Migrate WTF::Vector::append() to ::push_back() [part 9 of N] (Closed)
Patch Set: rebase Created 3 years, 11 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, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 layers[i].offsetFromLayoutObject != newOffsetFromLayoutObject) { 886 layers[i].offsetFromLayoutObject != newOffsetFromLayoutObject) {
887 // It is ok to issue paint invalidation here, because all of the geometry 887 // It is ok to issue paint invalidation here, because all of the geometry
888 // needed to correctly invalidate paint is computed by this point. 888 // needed to correctly invalidate paint is computed by this point.
889 DisablePaintInvalidationStateAsserts disabler; 889 DisablePaintInvalidationStateAsserts disabler;
890 ObjectPaintInvalidator(*layers[i].paintLayer->layoutObject()) 890 ObjectPaintInvalidator(*layers[i].paintLayer->layoutObject())
891 .invalidatePaintIncludingNonCompositingDescendants(); 891 .invalidatePaintIncludingNonCompositingDescendants();
892 892
893 TRACE_LAYER_INVALIDATION(layers[i].paintLayer, 893 TRACE_LAYER_INVALIDATION(layers[i].paintLayer,
894 InspectorLayerInvalidationTrackingEvent:: 894 InspectorLayerInvalidationTrackingEvent::
895 SquashingLayerGeometryWasUpdated); 895 SquashingLayerGeometryWasUpdated);
896 layersNeedingPaintInvalidation.append(layers[i].paintLayer); 896 layersNeedingPaintInvalidation.push_back(layers[i].paintLayer);
897 } 897 }
898 layers[i].offsetFromLayoutObject = newOffsetFromLayoutObject; 898 layers[i].offsetFromLayoutObject = newOffsetFromLayoutObject;
899 layers[i].offsetFromLayoutObjectSet = true; 899 layers[i].offsetFromLayoutObjectSet = true;
900 900
901 layers[i].paintLayer->setSubpixelAccumulation(subpixelAccumulation); 901 layers[i].paintLayer->setSubpixelAccumulation(subpixelAccumulation);
902 } 902 }
903 903
904 squashingLayer->setPosition(squashLayerBounds.location()); 904 squashingLayer->setPosition(squashLayerBounds.location());
905 squashingLayer->setSize(FloatSize(squashLayerBounds.size())); 905 squashingLayer->setSize(FloatSize(squashLayerBounds.size()));
906 906
(...skipping 2427 matching lines...) Expand 10 before | Expand all | Expand 10 after
3334 3334
3335 // If the layer which was previously at |nextSquashedLayerIndex| is not 3335 // If the layer which was previously at |nextSquashedLayerIndex| is not
3336 // earlier in the grouped mapping, invalidate its current backing now, since 3336 // earlier in the grouped mapping, invalidate its current backing now, since
3337 // it will move later or be removed from the squashing layer. 3337 // it will move later or be removed from the squashing layer.
3338 invalidateLayerIfNoPrecedingEntry(nextSquashedLayerIndex); 3338 invalidateLayerIfNoPrecedingEntry(nextSquashedLayerIndex);
3339 3339
3340 m_squashedLayers.insert(nextSquashedLayerIndex, paintInfo); 3340 m_squashedLayers.insert(nextSquashedLayerIndex, paintInfo);
3341 } else { 3341 } else {
3342 // Must invalidate before adding the squashed layer to the mapping. 3342 // Must invalidate before adding the squashed layer to the mapping.
3343 compositor()->paintInvalidationOnCompositingChange(squashedLayer); 3343 compositor()->paintInvalidationOnCompositingChange(squashedLayer);
3344 m_squashedLayers.append(paintInfo); 3344 m_squashedLayers.push_back(paintInfo);
3345 } 3345 }
3346 squashedLayer->setGroupedMapping( 3346 squashedLayer->setGroupedMapping(
3347 this, PaintLayer::InvalidateLayerAndRemoveFromMapping); 3347 this, PaintLayer::InvalidateLayerAndRemoveFromMapping);
3348 3348
3349 return true; 3349 return true;
3350 } 3350 }
3351 3351
3352 void CompositedLayerMapping::removeLayerFromSquashingGraphicsLayer( 3352 void CompositedLayerMapping::removeLayerFromSquashingGraphicsLayer(
3353 const PaintLayer* layer) { 3353 const PaintLayer* layer) {
3354 size_t layerIndex = 0; 3354 size_t layerIndex = 0;
(...skipping 28 matching lines...) Expand all
3383 Vector<PaintLayer*>& layersNeedingPaintInvalidation) { 3383 Vector<PaintLayer*>& layersNeedingPaintInvalidation) {
3384 if (nextSquashedLayerIndex < m_squashedLayers.size()) { 3384 if (nextSquashedLayerIndex < m_squashedLayers.size()) {
3385 // Any additional squashed Layers in the array no longer belong here, but 3385 // Any additional squashed Layers in the array no longer belong here, but
3386 // they might have been added already at an earlier index. Clear pointers on 3386 // they might have been added already at an earlier index. Clear pointers on
3387 // those that do not appear in the valid set before removing all the extra 3387 // those that do not appear in the valid set before removing all the extra
3388 // entries. 3388 // entries.
3389 for (size_t i = nextSquashedLayerIndex; i < m_squashedLayers.size(); ++i) { 3389 for (size_t i = nextSquashedLayerIndex; i < m_squashedLayers.size(); ++i) {
3390 if (invalidateLayerIfNoPrecedingEntry(i)) 3390 if (invalidateLayerIfNoPrecedingEntry(i))
3391 m_squashedLayers[i].paintLayer->setGroupedMapping( 3391 m_squashedLayers[i].paintLayer->setGroupedMapping(
3392 nullptr, PaintLayer::DoNotInvalidateLayerAndRemoveFromMapping); 3392 nullptr, PaintLayer::DoNotInvalidateLayerAndRemoveFromMapping);
3393 layersNeedingPaintInvalidation.append(m_squashedLayers[i].paintLayer); 3393 layersNeedingPaintInvalidation.push_back(m_squashedLayers[i].paintLayer);
3394 } 3394 }
3395 3395
3396 m_squashedLayers.remove(nextSquashedLayerIndex, 3396 m_squashedLayers.remove(nextSquashedLayerIndex,
3397 m_squashedLayers.size() - nextSquashedLayerIndex); 3397 m_squashedLayers.size() - nextSquashedLayerIndex);
3398 } 3398 }
3399 } 3399 }
3400 3400
3401 String CompositedLayerMapping::debugName( 3401 String CompositedLayerMapping::debugName(
3402 const GraphicsLayer* graphicsLayer) const { 3402 const GraphicsLayer* graphicsLayer) const {
3403 String name; 3403 String name;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
3444 } else if (graphicsLayer == m_decorationOutlineLayer.get()) { 3444 } else if (graphicsLayer == m_decorationOutlineLayer.get()) {
3445 name = "Decoration Layer"; 3445 name = "Decoration Layer";
3446 } else { 3446 } else {
3447 ASSERT_NOT_REACHED(); 3447 ASSERT_NOT_REACHED();
3448 } 3448 }
3449 3449
3450 return name; 3450 return name;
3451 } 3451 }
3452 3452
3453 } // namespace blink 3453 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698