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

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

Issue 1424933004: Changes in PaintLayer and PaintLayerPainter for synchronized painting (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
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 if (m_paintLayer.compositingState() != NotComposited) { 65 if (m_paintLayer.compositingState() != NotComposited) {
66 if (paintingInfo.globalPaintFlags() & GlobalPaintFlattenCompositingLayer s) { 66 if (paintingInfo.globalPaintFlags() & GlobalPaintFlattenCompositingLayer s) {
67 // FIXME: ok, but what about GlobalPaintFlattenCompositingLayers? Th at's for printing and drag-image. 67 // FIXME: ok, but what about GlobalPaintFlattenCompositingLayers? Th at's for printing and drag-image.
68 // FIXME: why isn't the code here global, as opposed to being set on each paintLayer() call? 68 // FIXME: why isn't the code here global, as opposed to being set on each paintLayer() call?
69 paintFlags |= PaintLayerUncachedClipRects; 69 paintFlags |= PaintLayerUncachedClipRects;
70 } 70 }
71 } 71 }
72 72
73 // Non self-painting layers without self-painting descendants don't need to be painted as their 73 // Non self-painting layers without self-painting descendants don't need to be painted as their
74 // layoutObject() should properly paint itself. 74 // layoutObject() should properly paint itself.
75 if (!m_paintLayer.isSelfPaintingLayer() && !m_paintLayer.hasSelfPaintingLaye rDescendant()) { 75 if (!m_paintLayer.isSelfPaintingLayer() && !m_paintLayer.hasSelfPaintingLaye rDescendant())
76 ASSERT(!m_paintLayer.needsRepaint() || !RuntimeEnabledFeatures::slimming PaintV2Enabled());
77 return FullyPainted; 76 return FullyPainted;
78 }
79 77
80 if (shouldSuppressPaintingLayer(&m_paintLayer)) 78 if (shouldSuppressPaintingLayer(&m_paintLayer))
81 return FullyPainted; 79 return FullyPainted;
82 80
83 // TODO(skyostil): Unify this early-out logic with subsequence caching. 81 // TODO(skyostil): Unify this early-out logic with subsequence caching.
84 if (m_paintLayer.layoutObject()->isLayoutPart() && toLayoutPart(m_paintLayer .layoutObject())->isThrottledFrameView()) 82 if (m_paintLayer.layoutObject()->isLayoutPart() && toLayoutPart(m_paintLayer .layoutObject())->isThrottledFrameView())
85 return FullyPainted; 83 return FullyPainted;
86 84
87 // If this layer is totally invisible then there is nothing to paint. 85 // If this layer is totally invisible then there is nothing to paint.
88 if (!m_paintLayer.layoutObject()->opacity() && !m_paintLayer.layoutObject()- >hasBackdropFilter()) 86 if (!m_paintLayer.layoutObject()->opacity() && !m_paintLayer.layoutObject()- >hasBackdropFilter())
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 DisplayItem::Type subsequenceType; 470 DisplayItem::Type subsequenceType;
473 if (childrenToVisit == NegativeZOrderChildren) { 471 if (childrenToVisit == NegativeZOrderChildren) {
474 subsequenceType = DisplayItem::SubsequenceNegativeZOrder; 472 subsequenceType = DisplayItem::SubsequenceNegativeZOrder;
475 } else { 473 } else {
476 ASSERT(childrenToVisit == (NormalFlowChildren | PositiveZOrderChildren)) ; 474 ASSERT(childrenToVisit == (NormalFlowChildren | PositiveZOrderChildren)) ;
477 subsequenceType = DisplayItem::SubsequenceNormalFlowAndPositiveZOrder; 475 subsequenceType = DisplayItem::SubsequenceNormalFlowAndPositiveZOrder;
478 } 476 }
479 477
480 Optional<SubsequenceRecorder> subsequenceRecorder; 478 Optional<SubsequenceRecorder> subsequenceRecorder;
481 if (!paintingInfo.disableSubsequenceCache 479 if (!paintingInfo.disableSubsequenceCache
480 && !context->printing()
481 && m_paintLayer.isSelfPaintingLayer()
482 && !(paintingInfo.globalPaintFlags() & GlobalPaintFlattenCompositingLaye rs) 482 && !(paintingInfo.globalPaintFlags() & GlobalPaintFlattenCompositingLaye rs)
483 && !(paintFlags & PaintLayerPaintingReflection) 483 && !(paintFlags & (PaintLayerPaintingReflection | PaintLayerPaintingRoot BackgroundOnly | PaintLayerPaintingOverlayScrollbars))) {
484 && !(paintFlags & PaintLayerPaintingRootBackgroundOnly)) {
485 if (!m_paintLayer.needsRepaint() 484 if (!m_paintLayer.needsRepaint()
486 && paintingInfo.scrollOffsetAccumulation == m_paintLayer.previousScr ollOffsetAccumulationForPainting() 485 && paintingInfo.scrollOffsetAccumulation == m_paintLayer.previousScr ollOffsetAccumulationForPainting()
487 && SubsequenceRecorder::useCachedSubsequenceIfPossible(*context, m_p aintLayer, subsequenceType)) 486 && SubsequenceRecorder::useCachedSubsequenceIfPossible(*context, m_p aintLayer, subsequenceType))
488 return result; 487 return result;
489 subsequenceRecorder.emplace(*context, m_paintLayer, subsequenceType); 488 subsequenceRecorder.emplace(*context, m_paintLayer, subsequenceType);
490 } 489 }
491 490
492 IntSize scrollOffsetAccumulationForChildren = paintingInfo.scrollOffsetAccum ulation; 491 IntSize scrollOffsetAccumulationForChildren = paintingInfo.scrollOffsetAccum ulation;
493 if (m_paintLayer.layoutObject()->hasOverflowClip()) 492 if (m_paintLayer.layoutObject()->hasOverflowClip())
494 scrollOffsetAccumulationForChildren += m_paintLayer.layoutBox()->scrolle dContentOffset(); 493 scrollOffsetAccumulationForChildren += m_paintLayer.layoutBox()->scrolle dContentOffset();
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 if (!m_paintLayer.containsDirtyOverlayScrollbars()) 694 if (!m_paintLayer.containsDirtyOverlayScrollbars())
696 return; 695 return;
697 696
698 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe ct(damageRect)), paintFlags, LayoutSize(), paintingRoot); 697 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe ct(damageRect)), paintFlags, LayoutSize(), paintingRoot);
699 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); 698 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars);
700 699
701 m_paintLayer.setContainsDirtyOverlayScrollbars(false); 700 m_paintLayer.setContainsDirtyOverlayScrollbars(false);
702 } 701 }
703 702
704 } // namespace blink 703 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698