| 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 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 LayoutSize adjustedSubPixelAccumulation = paintingInfo.subPixelAccumulation
+ (delta - roundedDelta); | 518 LayoutSize adjustedSubPixelAccumulation = paintingInfo.subPixelAccumulation
+ (delta - roundedDelta); |
| 519 | 519 |
| 520 // TODO(jbroman): Put the real transform origin here, instead of using a | 520 // TODO(jbroman): Put the real transform origin here, instead of using a |
| 521 // matrix with the origin baked in. | 521 // matrix with the origin baked in. |
| 522 FloatPoint3D transformOrigin; | 522 FloatPoint3D transformOrigin; |
| 523 Transform3DRecorder transform3DRecorder(context, *m_paintLayer.layoutObject(
), DisplayItem::Transform3DElementTransform, transform, transformOrigin); | 523 Transform3DRecorder transform3DRecorder(context, *m_paintLayer.layoutObject(
), DisplayItem::Transform3DElementTransform, transform, transformOrigin); |
| 524 | 524 |
| 525 // Now do a paint with the root layer shifted to be us. | 525 // Now do a paint with the root layer shifted to be us. |
| 526 PaintLayerPaintingInfo transformedPaintingInfo(&m_paintLayer, LayoutRect(enc
losingIntRect(transform.inverse().mapRect(paintingInfo.paintDirtyRect))), painti
ngInfo.globalPaintFlags(), | 526 PaintLayerPaintingInfo transformedPaintingInfo(&m_paintLayer, LayoutRect(enc
losingIntRect(transform.inverse().mapRect(paintingInfo.paintDirtyRect))), painti
ngInfo.globalPaintFlags(), |
| 527 adjustedSubPixelAccumulation); | 527 adjustedSubPixelAccumulation); |
| 528 if (paintingInfo.ancestorHasNonIdentityAndNonTranslateTransform || !transfor
m.isIdentityOrTranslation()) |
| 529 transformedPaintingInfo.ancestorHasNonIdentityAndNonTranslateTransform =
true; |
| 528 transformedPaintingInfo.ancestorHasClipPathClipping = paintingInfo.ancestorH
asClipPathClipping; | 530 transformedPaintingInfo.ancestorHasClipPathClipping = paintingInfo.ancestorH
asClipPathClipping; |
| 529 return paintLayerContentsAndReflection(context, transformedPaintingInfo, pai
ntFlags, ForceSingleFragment); | 531 return paintLayerContentsAndReflection(context, transformedPaintingInfo, pai
ntFlags, ForceSingleFragment); |
| 530 } | 532 } |
| 531 | 533 |
| 532 PaintLayerPainter::PaintResult PaintLayerPainter::paintChildren(unsigned childre
nToVisit, GraphicsContext& context, const PaintLayerPaintingInfo& paintingInfo,
PaintLayerFlags paintFlags) | 534 PaintLayerPainter::PaintResult PaintLayerPainter::paintChildren(unsigned childre
nToVisit, GraphicsContext& context, const PaintLayerPaintingInfo& paintingInfo,
PaintLayerFlags paintFlags) |
| 533 { | 535 { |
| 534 PaintResult result = FullyPainted; | 536 PaintResult result = FullyPainted; |
| 535 if (!m_paintLayer.hasSelfPaintingLayerDescendant()) | 537 if (!m_paintLayer.hasSelfPaintingLayerDescendant()) |
| 536 return result; | 538 return result; |
| 537 | 539 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 // for this layer seperately, with the scroll offset accumulated fro
m the root layer to the parent of this | 659 // for this layer seperately, with the scroll offset accumulated fro
m the root layer to the parent of this |
| 658 // layer, to get the same result as ScrollRecorder in BlockPainter. | 660 // layer, to get the same result as ScrollRecorder in BlockPainter. |
| 659 paintOffset += paintingInfo.scrollOffsetAccumulation; | 661 paintOffset += paintingInfo.scrollOffsetAccumulation; |
| 660 | 662 |
| 661 newCullRect.move(paintingInfo.scrollOffsetAccumulation); | 663 newCullRect.move(paintingInfo.scrollOffsetAccumulation); |
| 662 scrollRecorder.emplace(context, *m_paintLayer.layoutObject(), phase,
paintingInfo.scrollOffsetAccumulation); | 664 scrollRecorder.emplace(context, *m_paintLayer.layoutObject(), phase,
paintingInfo.scrollOffsetAccumulation); |
| 663 } | 665 } |
| 664 } | 666 } |
| 665 PaintInfo paintInfo(context, pixelSnappedIntRect(newCullRect), phase, | 667 PaintInfo paintInfo(context, pixelSnappedIntRect(newCullRect), phase, |
| 666 paintingInfo.globalPaintFlags(), paintFlags, paintingInfo.rootLayer->lay
outObject()); | 668 paintingInfo.globalPaintFlags(), paintFlags, paintingInfo.rootLayer->lay
outObject()); |
| 669 Optional<PaintInvalidationState> paintInvalidationState; |
| 670 if (RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()) { |
| 671 unsigned flags = 0; |
| 672 if (clipState == HasClipped || paintingInfo.clipToDirtyRect) |
| 673 flags |= PaintInvalidationState::HasClip; |
| 674 if (paintingInfo.ancestorHasNonIdentityAndNonTranslateTransform) |
| 675 flags |= PaintInvalidationState::HasNonIdentityAndNonTranslateTransf
orm; |
| 676 paintInvalidationState.emplace(*paintingInfo.rootLayer->layoutObject(),
clipRect.rect(), flags); |
| 677 paintInfo.paintInvalidationState = &*paintInvalidationState; |
| 678 } |
| 667 | 679 |
| 668 m_paintLayer.layoutObject()->paint(paintInfo, paintOffset); | 680 m_paintLayer.layoutObject()->paint(paintInfo, paintOffset); |
| 669 } | 681 } |
| 670 | 682 |
| 671 void PaintLayerPainter::paintBackgroundForFragments(const PaintLayerFragments& l
ayerFragments, | 683 void PaintLayerPainter::paintBackgroundForFragments(const PaintLayerFragments& l
ayerFragments, |
| 672 GraphicsContext& context, const LayoutRect& transparencyPaintDirtyRect, | 684 GraphicsContext& context, const LayoutRect& transparencyPaintDirtyRect, |
| 673 const PaintLayerPaintingInfo& localPaintingInfo, PaintLayerFlags paintFlags) | 685 const PaintLayerPaintingInfo& localPaintingInfo, PaintLayerFlags paintFlags) |
| 674 { | 686 { |
| 675 bool needsScope = layerFragments.size() > 1; | 687 bool needsScope = layerFragments.size() > 1; |
| 676 for (auto& fragment : layerFragments) { | 688 for (auto& fragment : layerFragments) { |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 767 if (!m_paintLayer.containsDirtyOverlayScrollbars()) | 779 if (!m_paintLayer.containsDirtyOverlayScrollbars()) |
| 768 return; | 780 return; |
| 769 | 781 |
| 770 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe
ct(damageRect)), paintFlags, LayoutSize()); | 782 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe
ct(damageRect)), paintFlags, LayoutSize()); |
| 771 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); | 783 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); |
| 772 | 784 |
| 773 m_paintLayer.setContainsDirtyOverlayScrollbars(false); | 785 m_paintLayer.setContainsDirtyOverlayScrollbars(false); |
| 774 } | 786 } |
| 775 | 787 |
| 776 } // namespace blink | 788 } // namespace blink |
| OLD | NEW |