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 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
815 } | 815 } |
816 | 816 |
817 void LayerPainter::paintChildClippingMaskForFragments(const LayerFragments& laye rFragments, GraphicsContext* context, const LayerPaintingInfo& localPaintingInfo , | 817 void LayerPainter::paintChildClippingMaskForFragments(const LayerFragments& laye rFragments, GraphicsContext* context, const LayerPaintingInfo& localPaintingInfo , |
818 RenderObject* paintingRootForRenderer, PaintLayerFlags paintFlags) | 818 RenderObject* paintingRootForRenderer, PaintLayerFlags paintFlags) |
819 { | 819 { |
820 for (size_t i = 0; i < layerFragments.size(); ++i) { | 820 for (size_t i = 0; i < layerFragments.size(); ++i) { |
821 const LayerFragment& fragment = layerFragments.at(i); | 821 const LayerFragment& fragment = layerFragments.at(i); |
822 OwnPtr<ClipRecorder> clipRecorder; | 822 OwnPtr<ClipRecorder> clipRecorder; |
823 if (localPaintingInfo.clipToDirtyRect && needsToClip(localPaintingInfo, fragment.foregroundRect)) { | 823 if (localPaintingInfo.clipToDirtyRect && needsToClip(localPaintingInfo, fragment.foregroundRect)) { |
824 clipRecorder = adoptPtr(new ClipRecorder(&m_renderLayer, context, Di splayItem::ClipLayerFragmentClippingMask, fragment.foregroundRect)); | 824 clipRecorder = adoptPtr(new ClipRecorder(&m_renderLayer, context, Di splayItem::ClipLayerFragmentClippingMask, fragment.foregroundRect)); |
825 applyRoundedRectClips(localPaintingInfo, context, fragment.foregroun dRect, paintFlags, *clipRecorder, IncludeSelfForBorderRadius); // Child clipping mask painting will handle clipping to self. | 825 applyRoundedRectClips(localPaintingInfo, context, fragment.foregroun dRect, paintFlags, *clipRecorder, IncludeSelfForBorderRadius); |
826 } | 826 } |
827 | 827 |
828 // Paint the the clipped mask. | 828 // Paint the the clipped mask. |
829 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.backgroundRect .rect()), PaintPhaseClippingMask, PaintBehaviorNormal, paintingRootForRenderer, 0, localPaintingInfo.rootLayer->renderer()); | 829 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.foregroundRect .rect()), PaintPhaseClippingMask, PaintBehaviorNormal, paintingRootForRenderer, 0, localPaintingInfo.rootLayer->renderer()); |
chrishtr
2014/11/06 02:03:04
The rect passed here is supposed to be the bounds
mstensho (USE GERRIT)
2014/11/06 14:06:41
No, it's supposed to be the damage rectangle, isn'
chrishtr
2014/11/06 18:10:01
Bear with me, I am learning some of this code also
mstensho (USE GERRIT)
2014/11/06 19:06:08
No, it didn't fail prior to my changes. Like it sa
| |
830 m_renderLayer.renderer()->paint(paintInfo, toPoint(fragment.layerBounds. location() - m_renderLayer.renderBoxLocation() + subPixelAccumulationIfNeeded(lo calPaintingInfo.subPixelAccumulation, m_renderLayer.compositingState()))); | 830 m_renderLayer.renderer()->paint(paintInfo, toPoint(fragment.layerBounds. location() - m_renderLayer.renderBoxLocation() + subPixelAccumulationIfNeeded(lo calPaintingInfo.subPixelAccumulation, m_renderLayer.compositingState()))); |
831 } | 831 } |
832 } | 832 } |
833 | 833 |
834 void LayerPainter::paintOverlayScrollbars(GraphicsContext* context, const Layout Rect& damageRect, PaintBehavior paintBehavior, RenderObject* paintingRoot) | 834 void LayerPainter::paintOverlayScrollbars(GraphicsContext* context, const Layout Rect& damageRect, PaintBehavior paintBehavior, RenderObject* paintingRoot) |
835 { | 835 { |
836 if (!m_renderLayer.containsDirtyOverlayScrollbars()) | 836 if (!m_renderLayer.containsDirtyOverlayScrollbars()) |
837 return; | 837 return; |
838 | 838 |
839 LayerPaintingInfo paintingInfo(&m_renderLayer, enclosingIntRect(damageRect), paintBehavior, LayoutSize(), paintingRoot); | 839 LayerPaintingInfo paintingInfo(&m_renderLayer, enclosingIntRect(damageRect), paintBehavior, LayoutSize(), paintingRoot); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 // FIXME: why should we have to deal with rounded rect clips here at all? | 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 LayerPainter(*m_renderLayer.parent()).applyRoundedRectClips(painting Info, context, clipRect, paintFlags, *clipRecorder); |
878 } | 878 } |
879 | 879 |
880 paintLayerByApplyingTransform(context, paintingInfo, paintFlags, fragmen t.paginationOffset); | 880 paintLayerByApplyingTransform(context, paintingInfo, paintFlags, fragmen t.paginationOffset); |
881 } | 881 } |
882 } | 882 } |
883 | 883 |
884 } // namespace blink | 884 } // namespace blink |
OLD | NEW |