Chromium Code Reviews| 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/LayerPainter.h" | 6 #include "core/paint/LayerPainter.h" |
| 7 | 7 |
| 8 #include "core/frame/Settings.h" | 8 #include "core/frame/Settings.h" |
| 9 #include "core/page/Page.h" | 9 #include "core/page/Page.h" |
| 10 #include "core/rendering/ClipPathOperation.h" | 10 #include "core/rendering/ClipPathOperation.h" |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 255 LayerPaintingInfo localPaintingInfo(paintingInfo); | 255 LayerPaintingInfo localPaintingInfo(paintingInfo); |
| 256 bool haveFilterEffect = m_renderLayer.filterRenderer() && m_renderLayer.pain tsWithFilters(); | 256 bool haveFilterEffect = m_renderLayer.filterRenderer() && m_renderLayer.pain tsWithFilters(); |
| 257 | 257 |
| 258 LayerFragments layerFragments; | 258 LayerFragments layerFragments; |
| 259 if (shouldPaintContent || shouldPaintOutline || isPaintingOverlayScrollbars) { | 259 if (shouldPaintContent || shouldPaintOutline || isPaintingOverlayScrollbars) { |
| 260 // Collect the fragments. This will compute the clip rectangles and pain t offsets for each layer fragment, as well as whether or not the content of each | 260 // Collect the fragments. This will compute the clip rectangles and pain t offsets for each layer fragment, as well as whether or not the content of each |
| 261 // fragment should paint. | 261 // fragment should paint. |
| 262 m_renderLayer.collectFragments(layerFragments, localPaintingInfo.rootLay er, localPaintingInfo.paintDirtyRect, | 262 m_renderLayer.collectFragments(layerFragments, localPaintingInfo.rootLay er, localPaintingInfo.paintDirtyRect, |
| 263 (paintFlags & PaintLayerUncachedClipRects) ? UncachedClipRects : Pai ntingClipRects, IgnoreOverlayScrollbarSize, | 263 (paintFlags & PaintLayerUncachedClipRects) ? UncachedClipRects : Pai ntingClipRects, IgnoreOverlayScrollbarSize, |
| 264 shouldRespectOverflowClip(paintFlags, m_renderLayer.renderer()), &of fsetFromRoot, localPaintingInfo.subPixelAccumulation); | 264 shouldRespectOverflowClip(paintFlags, m_renderLayer.renderer()), &of fsetFromRoot, localPaintingInfo.subPixelAccumulation); |
| 265 updatePaintingInfoForFragments(layerFragments, localPaintingInfo, paintF lags, shouldPaintContent, &offsetFromRoot); | |
| 266 } | 265 } |
| 267 | 266 |
| 268 if (haveFilterEffect) { | 267 if (haveFilterEffect) { |
| 269 ASSERT(m_renderLayer.filterInfo()); | 268 ASSERT(m_renderLayer.filterInfo()); |
| 270 | 269 |
| 271 if (!rootRelativeBoundsComputed) | 270 if (!rootRelativeBoundsComputed) |
| 272 rootRelativeBounds = m_renderLayer.physicalBoundingBoxIncludingRefle ctionAndStackingChildren(paintingInfo.rootLayer, offsetFromRoot); | 271 rootRelativeBounds = m_renderLayer.physicalBoundingBoxIncludingRefle ctionAndStackingChildren(paintingInfo.rootLayer, offsetFromRoot); |
| 273 | 272 |
| 274 // Do transparency and clipping before starting filter processing. | 273 // Do transparency and clipping before starting filter processing. |
| 275 if (haveTransparency) { | 274 if (haveTransparency) { |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 413 } | 412 } |
| 414 } | 413 } |
| 415 | 414 |
| 416 void LayerPainter::restoreClip(GraphicsContext* context, const LayoutRect& paint DirtyRect, const ClipRect& clipRect) | 415 void LayerPainter::restoreClip(GraphicsContext* context, const LayoutRect& paint DirtyRect, const ClipRect& clipRect) |
| 417 { | 416 { |
| 418 if (clipRect.rect() == paintDirtyRect && !clipRect.hasRadius()) | 417 if (clipRect.rect() == paintDirtyRect && !clipRect.hasRadius()) |
| 419 return; | 418 return; |
| 420 context->restore(); | 419 context->restore(); |
| 421 } | 420 } |
| 422 | 421 |
| 423 void LayerPainter::updatePaintingInfoForFragments(LayerFragments& fragments, con st LayerPaintingInfo& localPaintingInfo, PaintLayerFlags localPaintFlags, | |
| 424 bool shouldPaintContent, const LayoutPoint* offsetFromRoot) | |
| 425 { | |
| 426 ASSERT(offsetFromRoot); | |
| 427 for (size_t i = 0; i < fragments.size(); ++i) { | |
| 428 LayerFragment& fragment = fragments.at(i); | |
| 429 fragment.shouldPaintContent = shouldPaintContent; | |
| 430 if (&m_renderLayer != localPaintingInfo.rootLayer || !(localPaintFlags & PaintLayerPaintingOverflowContents)) { | |
| 431 LayoutPoint newOffsetFromRoot = *offsetFromRoot + fragment.paginatio nOffset; | |
| 432 fragment.shouldPaintContent &= m_renderLayer.intersectsDamageRect(fr agment.layerBounds, fragment.backgroundRect.rect(), localPaintingInfo.rootLayer, &newOffsetFromRoot); | |
|
chrishtr
2014/10/17 19:05:59
For the case of only one fragment (i.e. non-column
mstensho (USE GERRIT)
2014/10/17 20:06:50
Oops, I was a bit quick there. I got confused by t
mstensho (USE GERRIT)
2014/10/20 08:16:02
Done. I had a hard time doing something pretty her
| |
| 433 } | |
| 434 } | |
| 435 } | |
| 436 | |
| 437 void LayerPainter::paintLayerByApplyingTransform(GraphicsContext* context, const LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags, const LayoutPoint& translationOffset) | 422 void LayerPainter::paintLayerByApplyingTransform(GraphicsContext* context, const LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags, const LayoutPoint& translationOffset) |
| 438 { | 423 { |
| 439 // This involves subtracting out the position of the layer in our current co ordinate space, but preserving | 424 // This involves subtracting out the position of the layer in our current co ordinate space, but preserving |
| 440 // the accumulated error for sub-pixel layout. | 425 // the accumulated error for sub-pixel layout. |
| 441 LayoutPoint delta; | 426 LayoutPoint delta; |
| 442 m_renderLayer.convertToLayerCoords(paintingInfo.rootLayer, delta); | 427 m_renderLayer.convertToLayerCoords(paintingInfo.rootLayer, delta); |
| 443 delta.moveBy(translationOffset); | 428 delta.moveBy(translationOffset); |
| 444 TransformationMatrix transform(m_renderLayer.renderableTransform(paintingInf o.paintBehavior)); | 429 TransformationMatrix transform(m_renderLayer.renderableTransform(paintingInf o.paintBehavior)); |
| 445 IntPoint roundedDelta = roundedIntPoint(delta); | 430 IntPoint roundedDelta = roundedIntPoint(delta); |
| 446 transform.translateRight(roundedDelta.x(), roundedDelta.y()); | 431 transform.translateRight(roundedDelta.x(), roundedDelta.y()); |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 659 currLogicalTopOffset -= blockDelta; | 644 currLogicalTopOffset -= blockDelta; |
| 660 } | 645 } |
| 661 } | 646 } |
| 662 | 647 |
| 663 void LayerPainter::paintBackgroundForFragments(const LayerFragments& layerFragme nts, GraphicsContext* context, | 648 void LayerPainter::paintBackgroundForFragments(const LayerFragments& layerFragme nts, GraphicsContext* context, |
| 664 const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, const L ayerPaintingInfo& localPaintingInfo, PaintBehavior paintBehavior, | 649 const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, const L ayerPaintingInfo& localPaintingInfo, PaintBehavior paintBehavior, |
| 665 RenderObject* paintingRootForRenderer, PaintLayerFlags paintFlags) | 650 RenderObject* paintingRootForRenderer, PaintLayerFlags paintFlags) |
| 666 { | 651 { |
| 667 for (size_t i = 0; i < layerFragments.size(); ++i) { | 652 for (size_t i = 0; i < layerFragments.size(); ++i) { |
| 668 const LayerFragment& fragment = layerFragments.at(i); | 653 const LayerFragment& fragment = layerFragments.at(i); |
| 669 if (!fragment.shouldPaintContent) | |
| 670 continue; | |
| 671 | 654 |
| 672 // Begin transparency layers lazily now that we know we have to paint so mething. | 655 // Begin transparency layers lazily now that we know we have to paint so mething. |
| 673 if (haveTransparency || m_renderLayer.paintsWithBlendMode()) | 656 if (haveTransparency || m_renderLayer.paintsWithBlendMode()) |
| 674 beginTransparencyLayers(context, localPaintingInfo.rootLayer, transp arencyPaintDirtyRect, localPaintingInfo.subPixelAccumulation, localPaintingInfo. paintBehavior); | 657 beginTransparencyLayers(context, localPaintingInfo.rootLayer, transp arencyPaintDirtyRect, localPaintingInfo.subPixelAccumulation, localPaintingInfo. paintBehavior); |
| 675 | 658 |
| 676 if (localPaintingInfo.clipToDirtyRect) { | 659 if (localPaintingInfo.clipToDirtyRect) { |
| 677 // Paint our background first, before painting any child layers. | 660 // Paint our background first, before painting any child layers. |
| 678 // Establish the clip used to paint our background. | 661 // Establish the clip used to paint our background. |
| 679 clipToRect(localPaintingInfo, context, fragment.backgroundRect, pain tFlags, DoNotIncludeSelfForBorderRadius); // Background painting will handle cli pping to self. | 662 clipToRect(localPaintingInfo, context, fragment.backgroundRect, pain tFlags, DoNotIncludeSelfForBorderRadius); // Background painting will handle cli pping to self. |
| 680 } | 663 } |
| 681 | 664 |
| 682 // Paint the background. | 665 // Paint the background. |
| 683 // FIXME: Eventually we will collect the region from the fragment itself instead of just from the paint info. | 666 // FIXME: Eventually we will collect the region from the fragment itself instead of just from the paint info. |
| 684 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.backgroundRect .rect()), PaintPhaseBlockBackground, paintBehavior, paintingRootForRenderer, 0, localPaintingInfo.rootLayer->renderer()); | 667 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.backgroundRect .rect()), PaintPhaseBlockBackground, paintBehavior, paintingRootForRenderer, 0, localPaintingInfo.rootLayer->renderer()); |
| 685 m_renderLayer.renderer()->paint(paintInfo, toPoint(fragment.layerBounds. location() - m_renderLayer.renderBoxLocation() + subPixelAccumulationIfNeeded(lo calPaintingInfo.subPixelAccumulation, m_renderLayer.compositingState()))); | 668 m_renderLayer.renderer()->paint(paintInfo, toPoint(fragment.layerBounds. location() - m_renderLayer.renderBoxLocation() + subPixelAccumulationIfNeeded(lo calPaintingInfo.subPixelAccumulation, m_renderLayer.compositingState()))); |
| 686 | 669 |
| 687 if (localPaintingInfo.clipToDirtyRect) | 670 if (localPaintingInfo.clipToDirtyRect) |
| 688 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.back groundRect); | 671 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.back groundRect); |
| 689 } | 672 } |
| 690 } | 673 } |
| 691 | 674 |
| 692 void LayerPainter::paintForegroundForFragments(const LayerFragments& layerFragme nts, GraphicsContext* context, | 675 void LayerPainter::paintForegroundForFragments(const LayerFragments& layerFragme nts, GraphicsContext* context, |
| 693 const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, const L ayerPaintingInfo& localPaintingInfo, PaintBehavior paintBehavior, | 676 const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, const L ayerPaintingInfo& localPaintingInfo, PaintBehavior paintBehavior, |
| 694 RenderObject* paintingRootForRenderer, bool selectionOnly, PaintLayerFlags p aintFlags) | 677 RenderObject* paintingRootForRenderer, bool selectionOnly, PaintLayerFlags p aintFlags) |
| 695 { | 678 { |
| 696 // Begin transparency if we have something to paint. | 679 // Begin transparency if we have something to paint. |
| 697 if (haveTransparency || m_renderLayer.paintsWithBlendMode()) { | 680 if (haveTransparency || m_renderLayer.paintsWithBlendMode()) { |
| 698 for (size_t i = 0; i < layerFragments.size(); ++i) { | 681 for (size_t i = 0; i < layerFragments.size(); ++i) { |
| 699 const LayerFragment& fragment = layerFragments.at(i); | 682 const LayerFragment& fragment = layerFragments.at(i); |
| 700 if (fragment.shouldPaintContent && !fragment.foregroundRect.isEmpty( )) { | 683 if (!fragment.foregroundRect.isEmpty()) { |
| 701 beginTransparencyLayers(context, localPaintingInfo.rootLayer, tr ansparencyPaintDirtyRect, localPaintingInfo.subPixelAccumulation, localPaintingI nfo.paintBehavior); | 684 beginTransparencyLayers(context, localPaintingInfo.rootLayer, tr ansparencyPaintDirtyRect, localPaintingInfo.subPixelAccumulation, localPaintingI nfo.paintBehavior); |
| 702 break; | 685 break; |
| 703 } | 686 } |
| 704 } | 687 } |
| 705 } | 688 } |
| 706 | 689 |
| 707 // Optimize clipping for the single fragment case. | 690 // Optimize clipping for the single fragment case. |
| 708 bool shouldClip = localPaintingInfo.clipToDirtyRect && layerFragments.size() == 1 && layerFragments[0].shouldPaintContent && !layerFragments[0].foregroundRe ct.isEmpty(); | 691 bool shouldClip = localPaintingInfo.clipToDirtyRect && layerFragments.size() == 1 && !layerFragments[0].foregroundRect.isEmpty(); |
| 709 if (shouldClip) | 692 if (shouldClip) |
| 710 clipToRect(localPaintingInfo, context, layerFragments[0].foregroundRect, paintFlags); | 693 clipToRect(localPaintingInfo, context, layerFragments[0].foregroundRect, paintFlags); |
| 711 | 694 |
| 712 // We have to loop through every fragment multiple times, since we have to i ssue paint invalidations in each specific phase in order for | 695 // We have to loop through every fragment multiple times, since we have to i ssue paint invalidations in each specific phase in order for |
| 713 // interleaving of the fragments to work properly. | 696 // interleaving of the fragments to work properly. |
| 714 paintForegroundForFragmentsWithPhase(selectionOnly ? PaintPhaseSelection : P aintPhaseChildBlockBackgrounds, layerFragments, | 697 paintForegroundForFragmentsWithPhase(selectionOnly ? PaintPhaseSelection : P aintPhaseChildBlockBackgrounds, layerFragments, |
| 715 context, localPaintingInfo, paintBehavior, paintingRootForRenderer, pain tFlags); | 698 context, localPaintingInfo, paintBehavior, paintingRootForRenderer, pain tFlags); |
| 716 | 699 |
| 717 if (!selectionOnly) { | 700 if (!selectionOnly) { |
| 718 paintForegroundForFragmentsWithPhase(PaintPhaseFloat, layerFragments, co ntext, localPaintingInfo, paintBehavior, paintingRootForRenderer, paintFlags); | 701 paintForegroundForFragmentsWithPhase(PaintPhaseFloat, layerFragments, co ntext, localPaintingInfo, paintBehavior, paintingRootForRenderer, paintFlags); |
| 719 paintForegroundForFragmentsWithPhase(PaintPhaseForeground, layerFragment s, context, localPaintingInfo, paintBehavior, paintingRootForRenderer, paintFlag s); | 702 paintForegroundForFragmentsWithPhase(PaintPhaseForeground, layerFragment s, context, localPaintingInfo, paintBehavior, paintingRootForRenderer, paintFlag s); |
| 720 paintForegroundForFragmentsWithPhase(PaintPhaseChildOutlines, layerFragm ents, context, localPaintingInfo, paintBehavior, paintingRootForRenderer, paintF lags); | 703 paintForegroundForFragmentsWithPhase(PaintPhaseChildOutlines, layerFragm ents, context, localPaintingInfo, paintBehavior, paintingRootForRenderer, paintF lags); |
| 721 } | 704 } |
| 722 | 705 |
| 723 if (shouldClip) | 706 if (shouldClip) |
| 724 restoreClip(context, localPaintingInfo.paintDirtyRect, layerFragments[0] .foregroundRect); | 707 restoreClip(context, localPaintingInfo.paintDirtyRect, layerFragments[0] .foregroundRect); |
| 725 } | 708 } |
| 726 | 709 |
| 727 void LayerPainter::paintForegroundForFragmentsWithPhase(PaintPhase phase, const LayerFragments& layerFragments, GraphicsContext* context, | 710 void LayerPainter::paintForegroundForFragmentsWithPhase(PaintPhase phase, const LayerFragments& layerFragments, GraphicsContext* context, |
| 728 const LayerPaintingInfo& localPaintingInfo, PaintBehavior paintBehavior, Ren derObject* paintingRootForRenderer, PaintLayerFlags paintFlags) | 711 const LayerPaintingInfo& localPaintingInfo, PaintBehavior paintBehavior, Ren derObject* paintingRootForRenderer, PaintLayerFlags paintFlags) |
| 729 { | 712 { |
| 730 bool shouldClip = localPaintingInfo.clipToDirtyRect && layerFragments.size() > 1; | 713 bool shouldClip = localPaintingInfo.clipToDirtyRect && layerFragments.size() > 1; |
| 731 | 714 |
| 732 for (size_t i = 0; i < layerFragments.size(); ++i) { | 715 for (size_t i = 0; i < layerFragments.size(); ++i) { |
| 733 const LayerFragment& fragment = layerFragments.at(i); | 716 const LayerFragment& fragment = layerFragments.at(i); |
| 734 if (!fragment.shouldPaintContent || fragment.foregroundRect.isEmpty()) | 717 if (fragment.foregroundRect.isEmpty()) |
| 735 continue; | 718 continue; |
| 736 | 719 |
| 737 if (shouldClip) | 720 if (shouldClip) |
| 738 clipToRect(localPaintingInfo, context, fragment.foregroundRect, pain tFlags); | 721 clipToRect(localPaintingInfo, context, fragment.foregroundRect, pain tFlags); |
| 739 | 722 |
| 740 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.foregroundRect .rect()), phase, paintBehavior, paintingRootForRenderer, 0, localPaintingInfo.ro otLayer->renderer()); | 723 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.foregroundRect .rect()), phase, paintBehavior, paintingRootForRenderer, 0, localPaintingInfo.ro otLayer->renderer()); |
| 741 m_renderLayer.renderer()->paint(paintInfo, toPoint(fragment.layerBounds. location() - m_renderLayer.renderBoxLocation() + subPixelAccumulationIfNeeded(lo calPaintingInfo.subPixelAccumulation, m_renderLayer.compositingState()))); | 724 m_renderLayer.renderer()->paint(paintInfo, toPoint(fragment.layerBounds. location() - m_renderLayer.renderBoxLocation() + subPixelAccumulationIfNeeded(lo calPaintingInfo.subPixelAccumulation, m_renderLayer.compositingState()))); |
| 742 | 725 |
| 743 if (shouldClip) | 726 if (shouldClip) |
| 744 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.fore groundRect); | 727 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.fore groundRect); |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 759 m_renderLayer.renderer()->paint(paintInfo, toPoint(fragment.layerBounds. location() - m_renderLayer.renderBoxLocation() + subPixelAccumulationIfNeeded(lo calPaintingInfo.subPixelAccumulation, m_renderLayer.compositingState()))); | 742 m_renderLayer.renderer()->paint(paintInfo, toPoint(fragment.layerBounds. location() - m_renderLayer.renderBoxLocation() + subPixelAccumulationIfNeeded(lo calPaintingInfo.subPixelAccumulation, m_renderLayer.compositingState()))); |
| 760 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.outlineR ect); | 743 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.outlineR ect); |
| 761 } | 744 } |
| 762 } | 745 } |
| 763 | 746 |
| 764 void LayerPainter::paintMaskForFragments(const LayerFragments& layerFragments, G raphicsContext* context, const LayerPaintingInfo& localPaintingInfo, | 747 void LayerPainter::paintMaskForFragments(const LayerFragments& layerFragments, G raphicsContext* context, const LayerPaintingInfo& localPaintingInfo, |
| 765 RenderObject* paintingRootForRenderer, PaintLayerFlags paintFlags) | 748 RenderObject* paintingRootForRenderer, PaintLayerFlags paintFlags) |
| 766 { | 749 { |
| 767 for (size_t i = 0; i < layerFragments.size(); ++i) { | 750 for (size_t i = 0; i < layerFragments.size(); ++i) { |
| 768 const LayerFragment& fragment = layerFragments.at(i); | 751 const LayerFragment& fragment = layerFragments.at(i); |
| 769 if (!fragment.shouldPaintContent) | |
| 770 continue; | |
| 771 | |
| 772 if (localPaintingInfo.clipToDirtyRect) | 752 if (localPaintingInfo.clipToDirtyRect) |
| 773 clipToRect(localPaintingInfo, context, fragment.backgroundRect, pain tFlags, DoNotIncludeSelfForBorderRadius); // Mask painting will handle clipping to self. | 753 clipToRect(localPaintingInfo, context, fragment.backgroundRect, pain tFlags, DoNotIncludeSelfForBorderRadius); // Mask painting will handle clipping to self. |
| 774 | 754 |
| 775 // Paint the mask. | 755 // Paint the mask. |
| 776 // FIXME: Eventually we will collect the region from the fragment itself instead of just from the paint info. | 756 // FIXME: Eventually we will collect the region from the fragment itself instead of just from the paint info. |
| 777 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.backgroundRect .rect()), PaintPhaseMask, PaintBehaviorNormal, paintingRootForRenderer, 0, local PaintingInfo.rootLayer->renderer()); | 757 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.backgroundRect .rect()), PaintPhaseMask, PaintBehaviorNormal, paintingRootForRenderer, 0, local PaintingInfo.rootLayer->renderer()); |
| 778 m_renderLayer.renderer()->paint(paintInfo, toPoint(fragment.layerBounds. location() - m_renderLayer.renderBoxLocation() + subPixelAccumulationIfNeeded(lo calPaintingInfo.subPixelAccumulation, m_renderLayer.compositingState()))); | 758 m_renderLayer.renderer()->paint(paintInfo, toPoint(fragment.layerBounds. location() - m_renderLayer.renderBoxLocation() + subPixelAccumulationIfNeeded(lo calPaintingInfo.subPixelAccumulation, m_renderLayer.compositingState()))); |
| 779 | 759 |
| 780 if (localPaintingInfo.clipToDirtyRect) | 760 if (localPaintingInfo.clipToDirtyRect) |
| 781 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.back groundRect); | 761 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.back groundRect); |
| 782 } | 762 } |
| 783 } | 763 } |
| 784 | 764 |
| 785 void LayerPainter::paintChildClippingMaskForFragments(const LayerFragments& laye rFragments, GraphicsContext* context, const LayerPaintingInfo& localPaintingInfo , | 765 void LayerPainter::paintChildClippingMaskForFragments(const LayerFragments& laye rFragments, GraphicsContext* context, const LayerPaintingInfo& localPaintingInfo , |
| 786 RenderObject* paintingRootForRenderer, PaintLayerFlags paintFlags) | 766 RenderObject* paintingRootForRenderer, PaintLayerFlags paintFlags) |
| 787 { | 767 { |
| 788 for (size_t i = 0; i < layerFragments.size(); ++i) { | 768 for (size_t i = 0; i < layerFragments.size(); ++i) { |
| 789 const LayerFragment& fragment = layerFragments.at(i); | 769 const LayerFragment& fragment = layerFragments.at(i); |
| 790 if (!fragment.shouldPaintContent) | |
| 791 continue; | |
| 792 | |
| 793 if (localPaintingInfo.clipToDirtyRect) | 770 if (localPaintingInfo.clipToDirtyRect) |
| 794 clipToRect(localPaintingInfo, context, fragment.foregroundRect, pain tFlags, IncludeSelfForBorderRadius); // Child clipping mask painting will handle clipping to self. | 771 clipToRect(localPaintingInfo, context, fragment.foregroundRect, pain tFlags, IncludeSelfForBorderRadius); // Child clipping mask painting will handle clipping to self. |
| 795 | 772 |
| 796 // Paint the the clipped mask. | 773 // Paint the the clipped mask. |
| 797 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.backgroundRect .rect()), PaintPhaseClippingMask, PaintBehaviorNormal, paintingRootForRenderer, 0, localPaintingInfo.rootLayer->renderer()); | 774 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.backgroundRect .rect()), PaintPhaseClippingMask, PaintBehaviorNormal, paintingRootForRenderer, 0, localPaintingInfo.rootLayer->renderer()); |
| 798 m_renderLayer.renderer()->paint(paintInfo, toPoint(fragment.layerBounds. location() - m_renderLayer.renderBoxLocation() + subPixelAccumulationIfNeeded(lo calPaintingInfo.subPixelAccumulation, m_renderLayer.compositingState()))); | 775 m_renderLayer.renderer()->paint(paintInfo, toPoint(fragment.layerBounds. location() - m_renderLayer.renderBoxLocation() + subPixelAccumulationIfNeeded(lo calPaintingInfo.subPixelAccumulation, m_renderLayer.compositingState()))); |
| 799 | 776 |
| 800 if (localPaintingInfo.clipToDirtyRect) | 777 if (localPaintingInfo.clipToDirtyRect) |
| 801 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.fore groundRect); | 778 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.fore groundRect); |
| 802 } | 779 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 841 clipRect.intersect(parentClipRect); | 818 clipRect.intersect(parentClipRect); |
| 842 } | 819 } |
| 843 | 820 |
| 844 LayerPainter(*m_renderLayer.parent()).clipToRect(paintingInfo, context, clipRect, paintFlags); | 821 LayerPainter(*m_renderLayer.parent()).clipToRect(paintingInfo, context, clipRect, paintFlags); |
| 845 paintLayerByApplyingTransform(context, paintingInfo, paintFlags, fragmen t.paginationOffset); | 822 paintLayerByApplyingTransform(context, paintingInfo, paintFlags, fragmen t.paginationOffset); |
| 846 LayerPainter(*m_renderLayer.parent()).restoreClip(context, paintingInfo. paintDirtyRect, clipRect); | 823 LayerPainter(*m_renderLayer.parent()).restoreClip(context, paintingInfo. paintDirtyRect, clipRect); |
| 847 } | 824 } |
| 848 } | 825 } |
| 849 | 826 |
| 850 } // namespace blink | 827 } // namespace blink |
| OLD | NEW |