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 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 const LayerFragment& fragment = layerFragments.at(i); | 681 const LayerFragment& fragment = layerFragments.at(i); |
682 | 682 |
683 // Begin transparency layers lazily now that we know we have to paint so
mething. | 683 // Begin transparency layers lazily now that we know we have to paint so
mething. |
684 if (haveTransparency) | 684 if (haveTransparency) |
685 beginTransparencyLayers(context, localPaintingInfo.rootLayer, transp
arencyPaintDirtyRect, localPaintingInfo.subPixelAccumulation, localPaintingInfo.
paintBehavior); | 685 beginTransparencyLayers(context, localPaintingInfo.rootLayer, transp
arencyPaintDirtyRect, localPaintingInfo.subPixelAccumulation, localPaintingInfo.
paintBehavior); |
686 | 686 |
687 OwnPtr<ClipRecorder> clipRecorder; | 687 OwnPtr<ClipRecorder> clipRecorder; |
688 | 688 |
689 if (localPaintingInfo.clipToDirtyRect && needsToClip(localPaintingInfo,
fragment.backgroundRect)) { | 689 if (localPaintingInfo.clipToDirtyRect && needsToClip(localPaintingInfo,
fragment.backgroundRect)) { |
690 clipRecorder = adoptPtr(new ClipRecorder(&m_renderLayer, context, Di
splayItem::ClipLayerBackground, fragment.backgroundRect)); | 690 clipRecorder = adoptPtr(new ClipRecorder(&m_renderLayer, context, Di
splayItem::ClipLayerBackground, fragment.backgroundRect)); |
691 applyRoundedRectClips(localPaintingInfo, context, fragment.backgroun
dRect, paintFlags, *clipRecorder); | 691 applyRoundedRectClips(localPaintingInfo, context, fragment.backgroun
dRect, paintFlags, *clipRecorder, DoNotIncludeSelfForBorderRadius); // Backgroun
d painting will handle clipping to self. |
692 } | 692 } |
693 | 693 |
694 // Paint the background. | 694 // Paint the background. |
695 // FIXME: Eventually we will collect the region from the fragment itself
instead of just from the paint info. | 695 // FIXME: Eventually we will collect the region from the fragment itself
instead of just from the paint info. |
696 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.backgroundRect
.rect()), PaintPhaseBlockBackground, paintBehavior, paintingRootForRenderer, 0,
localPaintingInfo.rootLayer->renderer()); | 696 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.backgroundRect
.rect()), PaintPhaseBlockBackground, paintBehavior, paintingRootForRenderer, 0,
localPaintingInfo.rootLayer->renderer()); |
697 m_renderLayer.renderer()->paint(paintInfo, toPoint(fragment.layerBounds.
location() - m_renderLayer.renderBoxLocation() + subPixelAccumulationIfNeeded(lo
calPaintingInfo.subPixelAccumulation, m_renderLayer.compositingState()))); | 697 m_renderLayer.renderer()->paint(paintInfo, toPoint(fragment.layerBounds.
location() - m_renderLayer.renderBoxLocation() + subPixelAccumulationIfNeeded(lo
calPaintingInfo.subPixelAccumulation, m_renderLayer.compositingState()))); |
698 } | 698 } |
699 } | 699 } |
700 | 700 |
701 void LayerPainter::paintForegroundForFragments(const LayerFragments& layerFragme
nts, GraphicsContext* context, | 701 void LayerPainter::paintForegroundForFragments(const LayerFragments& layerFragme
nts, GraphicsContext* context, |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
866 if (shouldRespectOverflowClip(paintFlags, m_renderLayer.renderer())
== IgnoreOverflowClip) | 866 if (shouldRespectOverflowClip(paintFlags, m_renderLayer.renderer())
== IgnoreOverflowClip) |
867 clipRectsContext.setIgnoreOverflowClip(); | 867 clipRectsContext.setIgnoreOverflowClip(); |
868 LayoutRect parentClipRect = m_renderLayer.clipper().backgroundClipRe
ct(clipRectsContext).rect(); | 868 LayoutRect parentClipRect = m_renderLayer.clipper().backgroundClipRe
ct(clipRectsContext).rect(); |
869 parentClipRect.moveBy(fragment.paginationOffset + offsetOfPagination
LayerFromRoot); | 869 parentClipRect.moveBy(fragment.paginationOffset + offsetOfPagination
LayerFromRoot); |
870 clipRect.intersect(parentClipRect); | 870 clipRect.intersect(parentClipRect); |
871 } | 871 } |
872 | 872 |
873 OwnPtr<ClipRecorder> clipRecorder; | 873 OwnPtr<ClipRecorder> clipRecorder; |
874 if (needsToClip(paintingInfo, clipRect)) { | 874 if (needsToClip(paintingInfo, clipRect)) { |
875 clipRecorder = adoptPtr(new ClipRecorder(m_renderLayer.parent(), con
text, DisplayItem::ClipLayerFragmentParent, clipRect)); | 875 clipRecorder = adoptPtr(new ClipRecorder(m_renderLayer.parent(), con
text, DisplayItem::ClipLayerFragmentParent, clipRect)); |
876 LayerPainter(*m_renderLayer.parent()).applyRoundedRectClips(painting
Info, context, clipRect, paintFlags, *clipRecorder, DoNotIncludeSelfForBorderRad
ius); // Child clipping mask painting will handle clipping to self. | 876 // FIXME: why should we have to deal with rounded rect clips here at
all? |
| 877 LayerPainter(*m_renderLayer.parent()).applyRoundedRectClips(painting
Info, context, clipRect, paintFlags, *clipRecorder); |
877 } | 878 } |
878 | 879 |
879 paintLayerByApplyingTransform(context, paintingInfo, paintFlags, fragmen
t.paginationOffset); | 880 paintLayerByApplyingTransform(context, paintingInfo, paintFlags, fragmen
t.paginationOffset); |
880 } | 881 } |
881 } | 882 } |
882 | 883 |
883 } // namespace blink | 884 } // namespace blink |
OLD | NEW |