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

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

Issue 1452313004: Don't use cached subsequence when clip changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 "config.h" 5 #include "config.h"
6 #include "core/paint/PaintLayerPainter.h" 6 #include "core/paint/PaintLayerPainter.h"
7 7
8 #include "core/frame/Settings.h" 8 #include "core/frame/Settings.h"
9 #include "core/layout/ClipPathOperation.h" 9 #include "core/layout/ClipPathOperation.h"
10 #include "core/layout/LayoutBlock.h" 10 #include "core/layout/LayoutBlock.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 return result; 214 return result;
215 215
216 // TODO(skyostil): Unify this early-out logic with subsequence caching. 216 // TODO(skyostil): Unify this early-out logic with subsequence caching.
217 if (m_paintLayer.layoutObject()->isLayoutPart() && toLayoutPart(m_paintLayer .layoutObject())->isThrottledFrameView()) 217 if (m_paintLayer.layoutObject()->isLayoutPart() && toLayoutPart(m_paintLayer .layoutObject())->isThrottledFrameView())
218 return FullyPainted; 218 return FullyPainted;
219 219
220 // Ensure our lists are up-to-date. 220 // Ensure our lists are up-to-date.
221 m_paintLayer.stackingNode()->updateLayerListsIfNeeded(); 221 m_paintLayer.stackingNode()->updateLayerListsIfNeeded();
222 222
223 Optional<SubsequenceRecorder> subsequenceRecorder; 223 Optional<SubsequenceRecorder> subsequenceRecorder;
224 if (!paintingInfoArg.disableSubsequenceCache 224 if (!context->printing()
225 && !context->printing()
226 && !(paintingInfoArg.globalPaintFlags() & GlobalPaintFlattenCompositingL ayers) 225 && !(paintingInfoArg.globalPaintFlags() & GlobalPaintFlattenCompositingL ayers)
227 && !(paintFlags & (PaintLayerPaintingReflection | PaintLayerPaintingRoot BackgroundOnly | PaintLayerPaintingOverlayScrollbars)) 226 && !(paintFlags & (PaintLayerPaintingReflection | PaintLayerPaintingRoot BackgroundOnly | PaintLayerPaintingOverlayScrollbars))
228 && m_paintLayer.stackingNode()->isStackingContext() 227 && m_paintLayer.stackingNode()->isStackingContext()
229 && PaintLayerStackingNodeIterator(*m_paintLayer.stackingNode(), AllChild ren).next()) { 228 && PaintLayerStackingNodeIterator(*m_paintLayer.stackingNode(), AllChild ren).next()) {
230 if (!m_paintLayer.needsRepaint() 229 if (!m_paintLayer.needsRepaint()
231 && paintingInfoArg.scrollOffsetAccumulation == m_paintLayer.previous ScrollOffsetAccumulationForPainting() 230 && paintingInfoArg.scrollOffsetAccumulation == m_paintLayer.previous ScrollOffsetAccumulationForPainting()
232 && SubsequenceRecorder::useCachedSubsequenceIfPossible(*context, m_p aintLayer)) 231 && SubsequenceRecorder::useCachedSubsequenceIfPossible(*context, m_p aintLayer))
233 return result; 232 return result;
234 subsequenceRecorder.emplace(*context, m_paintLayer); 233 subsequenceRecorder.emplace(*context, m_paintLayer);
235 } 234 }
236 235
237 PaintLayerPaintingInfo paintingInfo = paintingInfoArg; 236 PaintLayerPaintingInfo paintingInfo = paintingInfoArg;
238 237
239 // This is a workaround of ancestor clip change issue (crbug.com/533717).
240 // TODO(wangxianzhu):
241 // - spv1: This disables subsequence cache for all descendants of LayoutView with root-layer-scrolls because
242 // LayoutView has overflow clip. Should find another workaround method wor king with root-layer-scrolls
243 // if it ships before slimming paint v2. crbug.com/552030.
244 // - spv2: Ensure subsequence cache works with ancestor clip change. crbug.c om/536138.
245 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled() && m_paintLayer.layout Object()->hasClipOrOverflowClip())
246 paintingInfo.disableSubsequenceCache = true;
247
248 LayoutPoint offsetFromRoot; 238 LayoutPoint offsetFromRoot;
249 m_paintLayer.convertToLayerCoords(paintingInfo.rootLayer, offsetFromRoot); 239 m_paintLayer.convertToLayerCoords(paintingInfo.rootLayer, offsetFromRoot);
250 240
251 if (m_paintLayer.compositingState() == PaintsIntoOwnBacking) 241 if (m_paintLayer.compositingState() == PaintsIntoOwnBacking)
252 offsetFromRoot.move(m_paintLayer.subpixelAccumulation()); 242 offsetFromRoot.move(m_paintLayer.subpixelAccumulation());
253 else 243 else
254 offsetFromRoot.move(paintingInfo.subPixelAccumulation); 244 offsetFromRoot.move(paintingInfo.subPixelAccumulation);
255 245
256 LayoutRect bounds = m_paintLayer.physicalBoundingBox(offsetFromRoot); 246 LayoutRect bounds = m_paintLayer.physicalBoundingBox(offsetFromRoot);
257 if (!paintingInfo.paintDirtyRect.contains(bounds)) 247 if (!paintingInfo.paintDirtyRect.contains(bounds))
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 if (!m_paintLayer.containsDirtyOverlayScrollbars()) 698 if (!m_paintLayer.containsDirtyOverlayScrollbars())
709 return; 699 return;
710 700
711 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe ct(damageRect)), paintFlags, LayoutSize(), paintingRoot); 701 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe ct(damageRect)), paintFlags, LayoutSize(), paintingRoot);
712 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); 702 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars);
713 703
714 m_paintLayer.setContainsDirtyOverlayScrollbars(false); 704 m_paintLayer.setContainsDirtyOverlayScrollbars(false);
715 } 705 }
716 706
717 } // namespace blink 707 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698