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 "core/paint/PaintLayerPainter.h" | 5 #include "core/paint/PaintLayerPainter.h" |
6 | 6 |
7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 bool selectionOnly = localPaintingInfo.getGlobalPaintFlags() & GlobalPaintSe
lectionOnly; | 341 bool selectionOnly = localPaintingInfo.getGlobalPaintFlags() & GlobalPaintSe
lectionOnly; |
342 | 342 |
343 { // Begin block for the lifetime of any filter. | 343 { // Begin block for the lifetime of any filter. |
344 FilterPainter filterPainter(m_paintLayer, context, offsetFromRoot, layer
Fragments.isEmpty() ? ClipRect() : layerFragments[0].backgroundRect, localPainti
ngInfo, paintFlags, | 344 FilterPainter filterPainter(m_paintLayer, context, offsetFromRoot, layer
Fragments.isEmpty() ? ClipRect() : layerFragments[0].backgroundRect, localPainti
ngInfo, paintFlags, |
345 rootRelativeBounds, rootRelativeBoundsComputed); | 345 rootRelativeBounds, rootRelativeBoundsComputed); |
346 | 346 |
347 Optional<ScopedPaintChunkProperties> scopedPaintChunkProperties; | 347 Optional<ScopedPaintChunkProperties> scopedPaintChunkProperties; |
348 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 348 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
349 ObjectPaintProperties* objectPaintProperties = m_paintLayer.layoutOb
ject()->objectPaintProperties(); | 349 ObjectPaintProperties* objectPaintProperties = m_paintLayer.layoutOb
ject()->objectPaintProperties(); |
350 ASSERT(objectPaintProperties && objectPaintProperties->localBorderBo
xProperties()); | 350 ASSERT(objectPaintProperties && objectPaintProperties->localBorderBo
xProperties()); |
351 PaintChunkProperties properties(context.paintController().currentPai
ntChunkProperties()); | 351 PaintChunkProperties properties(context.getPaintController().current
PaintChunkProperties()); |
352 auto& localBorderBoxProperties = *objectPaintProperties->localBorder
BoxProperties(); | 352 auto& localBorderBoxProperties = *objectPaintProperties->localBorder
BoxProperties(); |
353 properties.transform = localBorderBoxProperties.transform; | 353 properties.transform = localBorderBoxProperties.transform; |
354 properties.clip = localBorderBoxProperties.clip; | 354 properties.clip = localBorderBoxProperties.clip; |
355 properties.effect = localBorderBoxProperties.effect; | 355 properties.effect = localBorderBoxProperties.effect; |
356 properties.backfaceHidden = m_paintLayer.layoutObject()->hasHiddenBa
ckface(); | 356 properties.backfaceHidden = m_paintLayer.layoutObject()->hasHiddenBa
ckface(); |
357 scopedPaintChunkProperties.emplace(context.paintController(), proper
ties); | 357 scopedPaintChunkProperties.emplace(context.getPaintController(), pro
perties); |
358 } | 358 } |
359 | 359 |
360 bool shouldPaintBackground = isPaintingCompositedBackground && shouldPai
ntContent && !selectionOnly; | 360 bool shouldPaintBackground = isPaintingCompositedBackground && shouldPai
ntContent && !selectionOnly; |
361 bool shouldPaintNegZOrderList = (isPaintingScrollingContent && isPaintin
gOverflowContents) || (!isPaintingScrollingContent && isPaintingCompositedBackgr
ound); | 361 bool shouldPaintNegZOrderList = (isPaintingScrollingContent && isPaintin
gOverflowContents) || (!isPaintingScrollingContent && isPaintingCompositedBackgr
ound); |
362 bool shouldPaintOwnContents = isPaintingCompositedForeground && shouldPa
intContent; | 362 bool shouldPaintOwnContents = isPaintingCompositedForeground && shouldPa
intContent; |
363 bool shouldPaintNormalFlowAndPosZOrderLists = isPaintingCompositedForegr
ound; | 363 bool shouldPaintNormalFlowAndPosZOrderLists = isPaintingCompositedForegr
ound; |
364 bool shouldPaintOverlayScrollbars = isPaintingOverlayScrollbars; | 364 bool shouldPaintOverlayScrollbars = isPaintingOverlayScrollbars; |
365 | 365 |
366 if (shouldPaintBackground) { | 366 if (shouldPaintBackground) { |
367 paintBackgroundForFragments(layerFragments, context, paintingInfo.pa
intDirtyRect, | 367 paintBackgroundForFragments(layerFragments, context, paintingInfo.pa
intDirtyRect, |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 DisableCompositingQueryAsserts disabler; | 581 DisableCompositingQueryAsserts disabler; |
582 | 582 |
583 return m_paintLayer.compositingState() == NotComposited | 583 return m_paintLayer.compositingState() == NotComposited |
584 || (globalPaintFlags & GlobalPaintFlattenCompositingLayers) | 584 || (globalPaintFlags & GlobalPaintFlattenCompositingLayers) |
585 || ((paintFlags & PaintLayerPaintingReflection) && !m_paintLayer.has3DTr
ansform()) | 585 || ((paintFlags & PaintLayerPaintingReflection) && !m_paintLayer.has3DTr
ansform()) |
586 || paintForFixedRootBackground(&m_paintLayer, paintFlags); | 586 || paintForFixedRootBackground(&m_paintLayer, paintFlags); |
587 } | 587 } |
588 | 588 |
589 void PaintLayerPainter::paintOverflowControlsForFragments(const PaintLayerFragme
nts& layerFragments, GraphicsContext& context, const PaintLayerPaintingInfo& loc
alPaintingInfo, PaintLayerFlags paintFlags) | 589 void PaintLayerPainter::paintOverflowControlsForFragments(const PaintLayerFragme
nts& layerFragments, GraphicsContext& context, const PaintLayerPaintingInfo& loc
alPaintingInfo, PaintLayerFlags paintFlags) |
590 { | 590 { |
591 PaintLayerScrollableArea* scrollableArea = m_paintLayer.scrollableArea(); | 591 PaintLayerScrollableArea* scrollableArea = m_paintLayer.getScrollableArea(); |
592 if (!scrollableArea) | 592 if (!scrollableArea) |
593 return; | 593 return; |
594 | 594 |
595 bool needsScope = layerFragments.size() > 1; | 595 bool needsScope = layerFragments.size() > 1; |
596 for (auto& fragment : layerFragments) { | 596 for (auto& fragment : layerFragments) { |
597 Optional<ScopeRecorder> scopeRecorder; | 597 Optional<ScopeRecorder> scopeRecorder; |
598 if (needsScope) | 598 if (needsScope) |
599 scopeRecorder.emplace(context); | 599 scopeRecorder.emplace(context); |
600 | 600 |
601 // We need to apply the same clips and transforms that | 601 // We need to apply the same clips and transforms that |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 if (!m_paintLayer.containsDirtyOverlayScrollbars()) | 767 if (!m_paintLayer.containsDirtyOverlayScrollbars()) |
768 return; | 768 return; |
769 | 769 |
770 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe
ct(damageRect)), paintFlags, LayoutSize()); | 770 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe
ct(damageRect)), paintFlags, LayoutSize()); |
771 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); | 771 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); |
772 | 772 |
773 m_paintLayer.setContainsDirtyOverlayScrollbars(false); | 773 m_paintLayer.setContainsDirtyOverlayScrollbars(false); |
774 } | 774 } |
775 | 775 |
776 } // namespace blink | 776 } // namespace blink |
OLD | NEW |