| OLD | NEW |
| 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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 | 460 |
| 461 #if ENABLE(ASSERT) | 461 #if ENABLE(ASSERT) |
| 462 LayerListMutationDetector mutationChecker(m_paintLayer.stackingNode()); | 462 LayerListMutationDetector mutationChecker(m_paintLayer.stackingNode()); |
| 463 #endif | 463 #endif |
| 464 | 464 |
| 465 PaintLayerStackingNodeIterator iterator(*m_paintLayer.stackingNode(), childr
enToVisit); | 465 PaintLayerStackingNodeIterator iterator(*m_paintLayer.stackingNode(), childr
enToVisit); |
| 466 PaintLayerStackingNode* child = iterator.next(); | 466 PaintLayerStackingNode* child = iterator.next(); |
| 467 if (!child) | 467 if (!child) |
| 468 return result; | 468 return result; |
| 469 | 469 |
| 470 DisplayItem::Type subsequenceType; | |
| 471 if (childrenToVisit == NegativeZOrderChildren) { | |
| 472 subsequenceType = DisplayItem::SubsequenceNegativeZOrder; | |
| 473 } else { | |
| 474 ASSERT(childrenToVisit == (NormalFlowChildren | PositiveZOrderChildren))
; | |
| 475 subsequenceType = DisplayItem::SubsequenceNormalFlowAndPositiveZOrder; | |
| 476 } | |
| 477 | |
| 478 Optional<SubsequenceRecorder> subsequenceRecorder; | 470 Optional<SubsequenceRecorder> subsequenceRecorder; |
| 479 if (!paintingInfo.disableSubsequenceCache | 471 if (!paintingInfo.disableSubsequenceCache |
| 480 && !context->printing() | 472 && !context->printing() |
| 481 && m_paintLayer.stackingNode()->isStackingContext() | 473 && m_paintLayer.stackingNode()->isStackingContext() |
| 482 && !(paintingInfo.globalPaintFlags() & GlobalPaintFlattenCompositingLaye
rs) | 474 && !(paintingInfo.globalPaintFlags() & GlobalPaintFlattenCompositingLaye
rs) |
| 483 && !(paintFlags & (PaintLayerPaintingReflection | PaintLayerPaintingRoot
BackgroundOnly | PaintLayerPaintingOverlayScrollbars))) { | 475 && !(paintFlags & (PaintLayerPaintingReflection | PaintLayerPaintingRoot
BackgroundOnly | PaintLayerPaintingOverlayScrollbars))) { |
| 476 ASSERT(childrenToVisit == NegativeZOrderChildren || childrenToVisit == (
NormalFlowChildren | PositiveZOrderChildren)); |
| 477 DisplayItemClientWrapper displayItemClient(childrenToVisit == NegativeZO
rderChildren ? m_paintLayer.displayItemClientForNegativeZOrderChildren() : m_pai
ntLayer.displayItemClientForNormalAndPositiveZOrderChildren()); |
| 484 if (!m_paintLayer.needsRepaint() | 478 if (!m_paintLayer.needsRepaint() |
| 485 && paintingInfo.scrollOffsetAccumulation == m_paintLayer.previousScr
ollOffsetAccumulationForPainting() | 479 && paintingInfo.scrollOffsetAccumulation == m_paintLayer.previousScr
ollOffsetAccumulationForPainting() |
| 486 && SubsequenceRecorder::useCachedSubsequenceIfPossible(*context, m_p
aintLayer, subsequenceType)) | 480 && SubsequenceRecorder::useCachedSubsequenceIfPossible(*context, dis
playItemClient)) { |
| 487 return result; | 481 return result; |
| 488 subsequenceRecorder.emplace(*context, m_paintLayer, subsequenceType); | 482 } |
| 483 subsequenceRecorder.emplace(*context, displayItemClient); |
| 489 } | 484 } |
| 490 | 485 |
| 491 IntSize scrollOffsetAccumulationForChildren = paintingInfo.scrollOffsetAccum
ulation; | 486 IntSize scrollOffsetAccumulationForChildren = paintingInfo.scrollOffsetAccum
ulation; |
| 492 if (m_paintLayer.layoutObject()->hasOverflowClip()) | 487 if (m_paintLayer.layoutObject()->hasOverflowClip()) |
| 493 scrollOffsetAccumulationForChildren += m_paintLayer.layoutBox()->scrolle
dContentOffset(); | 488 scrollOffsetAccumulationForChildren += m_paintLayer.layoutBox()->scrolle
dContentOffset(); |
| 494 | 489 |
| 495 bool disableChildSubsequenceCache = !RuntimeEnabledFeatures::slimmingPaintV2
Enabled() | 490 bool disableChildSubsequenceCache = !RuntimeEnabledFeatures::slimmingPaintV2
Enabled() |
| 496 && (m_paintLayer.layoutObject()->hasOverflowClip() || m_paintLayer.layou
tObject()->hasClip()); | 491 && (m_paintLayer.layoutObject()->hasOverflowClip() || m_paintLayer.layou
tObject()->hasClip()); |
| 497 | 492 |
| 498 for (; child; child = iterator.next()) { | 493 for (; child; child = iterator.next()) { |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 if (!m_paintLayer.containsDirtyOverlayScrollbars()) | 689 if (!m_paintLayer.containsDirtyOverlayScrollbars()) |
| 695 return; | 690 return; |
| 696 | 691 |
| 697 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe
ct(damageRect)), paintFlags, LayoutSize(), paintingRoot); | 692 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe
ct(damageRect)), paintFlags, LayoutSize(), paintingRoot); |
| 698 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); | 693 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); |
| 699 | 694 |
| 700 m_paintLayer.setContainsDirtyOverlayScrollbars(false); | 695 m_paintLayer.setContainsDirtyOverlayScrollbars(false); |
| 701 } | 696 } |
| 702 | 697 |
| 703 } // namespace blink | 698 } // namespace blink |
| OLD | NEW |