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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayer.cpp

Issue 2617783002: Migrate WTF::Vector::append() to ::push_back() [part 12 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) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
6 * 6 *
7 * Other contributors: 7 * Other contributors:
8 * Robert O'Callahan <roc+@cs.cmu.edu> 8 * Robert O'Callahan <roc+@cs.cmu.edu>
9 * David Baron <dbaron@fas.harvard.edu> 9 * David Baron <dbaron@fas.harvard.edu>
10 * Christian Biesinger <cbiesinger@web.de> 10 * Christian Biesinger <cbiesinger@web.de>
(...skipping 1528 matching lines...) Expand 10 before | Expand all | Expand 10 after
1539 const LayoutSize& subPixelAccumulation) { 1539 const LayoutSize& subPixelAccumulation) {
1540 PaintLayerFragment fragment; 1540 PaintLayerFragment fragment;
1541 ClipRectsContext clipRectsContext(rootLayer, clipRectsCacheSlot, 1541 ClipRectsContext clipRectsContext(rootLayer, clipRectsCacheSlot,
1542 overlayScrollbarClipBehavior, 1542 overlayScrollbarClipBehavior,
1543 subPixelAccumulation); 1543 subPixelAccumulation);
1544 if (respectOverflowClip == IgnoreOverflowClip) 1544 if (respectOverflowClip == IgnoreOverflowClip)
1545 clipRectsContext.setIgnoreOverflowClip(); 1545 clipRectsContext.setIgnoreOverflowClip();
1546 clipper().calculateRects(clipRectsContext, dirtyRect, fragment.layerBounds, 1546 clipper().calculateRects(clipRectsContext, dirtyRect, fragment.layerBounds,
1547 fragment.backgroundRect, fragment.foregroundRect, 1547 fragment.backgroundRect, fragment.foregroundRect,
1548 offsetFromRoot); 1548 offsetFromRoot);
1549 fragments.append(fragment); 1549 fragments.push_back(fragment);
1550 } 1550 }
1551 1551
1552 bool PaintLayer::shouldFragmentCompositedBounds( 1552 bool PaintLayer::shouldFragmentCompositedBounds(
1553 const PaintLayer* compositingLayer) const { 1553 const PaintLayer* compositingLayer) const {
1554 // Composited layers may not be fragmented. 1554 // Composited layers may not be fragmented.
1555 return enclosingPaginationLayer() && 1555 return enclosingPaginationLayer() &&
1556 !compositingLayer->enclosingPaginationLayer(); 1556 !compositingLayer->enclosingPaginationLayer();
1557 } 1557 }
1558 1558
1559 void PaintLayer::collectFragments( 1559 void PaintLayer::collectFragments(
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
1685 1685
1686 // Now intersect with our pagination clip. This will typically mean we're 1686 // Now intersect with our pagination clip. This will typically mean we're
1687 // just intersecting the dirty rect with the column clip, so the column clip 1687 // just intersecting the dirty rect with the column clip, so the column clip
1688 // ends up being all we apply. 1688 // ends up being all we apply.
1689 fragment.intersect(fragment.paginationClip); 1689 fragment.intersect(fragment.paginationClip);
1690 1690
1691 // TODO(mstensho): Don't add empty fragments. We've always done that in some 1691 // TODO(mstensho): Don't add empty fragments. We've always done that in some
1692 // cases, but there should be no reason to do so. Either filter them out 1692 // cases, but there should be no reason to do so. Either filter them out
1693 // here, or, even better: pass a better clip rectangle to the fragmentainer 1693 // here, or, even better: pass a better clip rectangle to the fragmentainer
1694 // iterator, so that we won't end up with empty fragments here. 1694 // iterator, so that we won't end up with empty fragments here.
1695 fragments.append(fragment); 1695 fragments.push_back(fragment);
1696 } 1696 }
1697 } 1697 }
1698 1698
1699 static inline LayoutRect frameVisibleRect(LayoutObject* layoutObject) { 1699 static inline LayoutRect frameVisibleRect(LayoutObject* layoutObject) {
1700 FrameView* frameView = layoutObject->document().view(); 1700 FrameView* frameView = layoutObject->document().view();
1701 if (!frameView) 1701 if (!frameView)
1702 return LayoutRect(); 1702 return LayoutRect();
1703 1703
1704 return LayoutRect(frameView->visibleContentRect()); 1704 return LayoutRect(frameView->visibleContentRect());
1705 } 1705 }
(...skipping 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after
2976 return scrollableArea->scrollsOverflow(); 2976 return scrollableArea->scrollsOverflow();
2977 2977
2978 return false; 2978 return false;
2979 } 2979 }
2980 2980
2981 FilterOperations PaintLayer::addReflectionToFilterOperations( 2981 FilterOperations PaintLayer::addReflectionToFilterOperations(
2982 const ComputedStyle& style) const { 2982 const ComputedStyle& style) const {
2983 FilterOperations filterOperations = style.filter(); 2983 FilterOperations filterOperations = style.filter();
2984 if (layoutObject()->hasReflection() && layoutObject()->isBox()) { 2984 if (layoutObject()->hasReflection() && layoutObject()->isBox()) {
2985 BoxReflection reflection = boxReflectionForPaintLayer(*this, style); 2985 BoxReflection reflection = boxReflectionForPaintLayer(*this, style);
2986 filterOperations.operations().append( 2986 filterOperations.operations().push_back(
2987 BoxReflectFilterOperation::create(reflection)); 2987 BoxReflectFilterOperation::create(reflection));
2988 } 2988 }
2989 return filterOperations; 2989 return filterOperations;
2990 } 2990 }
2991 2991
2992 CompositorFilterOperations 2992 CompositorFilterOperations
2993 PaintLayer::createCompositorFilterOperationsForFilter( 2993 PaintLayer::createCompositorFilterOperationsForFilter(
2994 const ComputedStyle& style) { 2994 const ComputedStyle& style) {
2995 FloatRect zoomedReferenceBox; 2995 FloatRect zoomedReferenceBox;
2996 if (style.filter().hasReferenceFilter()) 2996 if (style.filter().hasReferenceFilter())
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
3102 Vector<LayoutRect> rect; 3102 Vector<LayoutRect> rect;
3103 3103
3104 if (layoutBox() && layoutBox()->scrollsOverflow()) { 3104 if (layoutBox() && layoutBox()->scrollsOverflow()) {
3105 // For scrolling layers, rects are taken to be in the space of the 3105 // For scrolling layers, rects are taken to be in the space of the
3106 // contents. We need to include the bounding box of the layer in the 3106 // contents. We need to include the bounding box of the layer in the
3107 // space of its parent (eg. for border / scroll bars) and if it's 3107 // space of its parent (eg. for border / scroll bars) and if it's
3108 // composited then the entire contents as well as they may be on another 3108 // composited then the entire contents as well as they may be on another
3109 // composited layer. Skip reporting contents for non-composited layers as 3109 // composited layer. Skip reporting contents for non-composited layers as
3110 // they'll get projected to the same layer as the bounding box. 3110 // they'll get projected to the same layer as the bounding box.
3111 if (compositingState() != NotComposited) 3111 if (compositingState() != NotComposited)
3112 rect.append(m_scrollableArea->overflowRect()); 3112 rect.push_back(m_scrollableArea->overflowRect());
3113 3113
3114 rects.set(this, rect); 3114 rects.set(this, rect);
3115 if (const PaintLayer* parentLayer = parent()) { 3115 if (const PaintLayer* parentLayer = parent()) {
3116 LayerHitTestRects::iterator iter = rects.find(parentLayer); 3116 LayerHitTestRects::iterator iter = rects.find(parentLayer);
3117 if (iter == rects.end()) { 3117 if (iter == rects.end()) {
3118 rects.add(parentLayer, Vector<LayoutRect>()) 3118 rects.add(parentLayer, Vector<LayoutRect>())
3119 .storedValue->value.append(physicalBoundingBox(parentLayer)); 3119 .storedValue->value.push_back(physicalBoundingBox(parentLayer));
3120 } else { 3120 } else {
3121 iter->value.append(physicalBoundingBox(parentLayer)); 3121 iter->value.push_back(physicalBoundingBox(parentLayer));
3122 } 3122 }
3123 } 3123 }
3124 } else { 3124 } else {
3125 rect.append(logicalBoundingBox()); 3125 rect.push_back(logicalBoundingBox());
3126 rects.set(this, rect); 3126 rects.set(this, rect);
3127 } 3127 }
3128 } 3128 }
3129 } 3129 }
3130 3130
3131 void PaintLayer::setNeedsRepaint() { 3131 void PaintLayer::setNeedsRepaint() {
3132 setNeedsRepaintInternal(); 3132 setNeedsRepaintInternal();
3133 3133
3134 // Do this unconditionally to ensure container chain is marked when 3134 // Do this unconditionally to ensure container chain is marked when
3135 // compositing status of the layer changes. 3135 // compositing status of the layer changes.
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
3223 } 3223 }
3224 3224
3225 void showLayerTree(const blink::LayoutObject* layoutObject) { 3225 void showLayerTree(const blink::LayoutObject* layoutObject) {
3226 if (!layoutObject) { 3226 if (!layoutObject) {
3227 LOG(INFO) << "Cannot showLayerTree. Root is (nil)"; 3227 LOG(INFO) << "Cannot showLayerTree. Root is (nil)";
3228 return; 3228 return;
3229 } 3229 }
3230 showLayerTree(layoutObject->enclosingLayer()); 3230 showLayerTree(layoutObject->enclosingLayer());
3231 } 3231 }
3232 #endif 3232 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintInvalidator.cpp ('k') | third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698