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

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

Issue 2745563004: Reduce copying of local data structures in GeometryMapper and PaintLayerClipper. (Closed)
Patch Set: none Created 3 years, 9 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "core/paint/PaintLayerPainter.h" 5 #include "core/paint/PaintLayerPainter.h"
6 6
7 #include "core/frame/LocalFrame.h" 7 #include "core/frame/LocalFrame.h"
8 #include "core/layout/LayoutView.h" 8 #include "core/layout/LayoutView.h"
9 #include "core/paint/ClipPathClipper.h" 9 #include "core/paint/ClipPathClipper.h"
10 #include "core/paint/FilterPainter.h" 10 #include "core/paint/FilterPainter.h"
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 if (parentLayer) { 743 if (parentLayer) {
744 // Calculate the clip rectangle that the ancestors establish. 744 // Calculate the clip rectangle that the ancestors establish.
745 ClipRectsContext clipRectsContext( 745 ClipRectsContext clipRectsContext(
746 paintingInfo.rootLayer, 746 paintingInfo.rootLayer,
747 (paintFlags & PaintLayerUncachedClipRects) ? UncachedClipRects 747 (paintFlags & PaintLayerUncachedClipRects) ? UncachedClipRects
748 : PaintingClipRects, 748 : PaintingClipRects,
749 IgnoreOverlayScrollbarSize); 749 IgnoreOverlayScrollbarSize);
750 if (shouldRespectOverflowClip(paintFlags, m_paintLayer.layoutObject()) == 750 if (shouldRespectOverflowClip(paintFlags, m_paintLayer.layoutObject()) ==
751 IgnoreOverflowClip) 751 IgnoreOverflowClip)
752 clipRectsContext.setIgnoreOverflowClip(); 752 clipRectsContext.setIgnoreOverflowClip();
753 ancestorBackgroundClipRect = m_paintLayer.clipper(geometryMapperOption) 753 m_paintLayer.clipper(geometryMapperOption)
754 .backgroundClipRect(clipRectsContext); 754 .calculateBackgroundClipRect(clipRectsContext,
755 ancestorBackgroundClipRect);
755 } 756 }
756 } 757 }
757 758
758 PaintResult result = FullyPainted; 759 PaintResult result = FullyPainted;
759 for (const auto& fragment : layerFragments) { 760 for (const auto& fragment : layerFragments) {
760 Optional<LayerClipRecorder> clipRecorder; 761 Optional<LayerClipRecorder> clipRecorder;
761 if (parentLayer && !RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { 762 if (parentLayer && !RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
762 ClipRect clipRectForFragment(ancestorBackgroundClipRect); 763 ClipRect clipRectForFragment(ancestorBackgroundClipRect);
763 // A fixed-position object is repeated on every page instead of paginated, 764 // A fixed-position object is repeated on every page instead of paginated,
764 // so we should apply the original ancestor clip rect. 765 // so we should apply the original ancestor clip rect.
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
1208 context, layoutObject, PaintPhaseClippingMask)) 1209 context, layoutObject, PaintPhaseClippingMask))
1209 return; 1210 return;
1210 1211
1211 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect()); 1212 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect());
1212 LayoutObjectDrawingRecorder drawingRecorder( 1213 LayoutObjectDrawingRecorder drawingRecorder(
1213 context, layoutObject, PaintPhaseClippingMask, snappedClipRect); 1214 context, layoutObject, PaintPhaseClippingMask, snappedClipRect);
1214 context.fillRect(snappedClipRect, Color::black); 1215 context.fillRect(snappedClipRect, Color::black);
1215 } 1216 }
1216 1217
1217 } // namespace blink 1218 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698