| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. |
| 3 * | 3 * |
| 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 5 * | 5 * |
| 6 * Other contributors: | 6 * Other contributors: |
| 7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
| 9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
| 10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
| (...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 943 paintChildren(NormalFlowChildren | PositiveZOrderChildren, context, painting
Info, paintFlags); | 943 paintChildren(NormalFlowChildren | PositiveZOrderChildren, context, painting
Info, paintFlags); |
| 944 | 944 |
| 945 if (filterPainter.hasStartedFilterEffect()) { | 945 if (filterPainter.hasStartedFilterEffect()) { |
| 946 context = filterPainter.applyFilterEffect(); | 946 context = filterPainter.applyFilterEffect(); |
| 947 restoreClip(transparencyLayerContext, localPaintingInfo.paintDirtyRect,
backgroundRect); | 947 restoreClip(transparencyLayerContext, localPaintingInfo.paintDirtyRect,
backgroundRect); |
| 948 } | 948 } |
| 949 | 949 |
| 950 // Make sure that we now use the original transparency context. | 950 // Make sure that we now use the original transparency context. |
| 951 ASSERT(transparencyLayerContext == context); | 951 ASSERT(transparencyLayerContext == context); |
| 952 | 952 |
| 953 if (shouldPaintContent && renderer()->hasMask()) | |
| 954 paintMask(context, localPaintingInfo, layerLocation, backgroundRect); | |
| 955 | |
| 956 // End our transparency layer | 953 // End our transparency layer |
| 957 if (haveTransparency && m_usedTransparency) { | 954 if (haveTransparency && m_usedTransparency) { |
| 958 context->endLayer(); | 955 context->endLayer(); |
| 959 context->restore(); | 956 context->restore(); |
| 960 m_usedTransparency = false; | 957 m_usedTransparency = false; |
| 961 } | 958 } |
| 962 } | 959 } |
| 963 | 960 |
| 964 void RenderLayer::paintLayerByApplyingTransform(GraphicsContext* context, const
LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags, const LayoutPoint&
translationOffset) | 961 void RenderLayer::paintLayerByApplyingTransform(GraphicsContext* context, const
LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags, const LayoutPoint&
translationOffset) |
| 965 { | 962 { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1020 // if the rect is empty. | 1017 // if the rect is empty. |
| 1021 if (!foregroundRectIsEmpty) { | 1018 if (!foregroundRectIsEmpty) { |
| 1022 PaintInfo paintInfo(context, pixelSnappedIntRect(layerForegroundRect.rec
t()), PaintPhaseForeground, localPaintingInfo.rootLayer->renderer()); | 1019 PaintInfo paintInfo(context, pixelSnappedIntRect(layerForegroundRect.rec
t()), PaintPhaseForeground, localPaintingInfo.rootLayer->renderer()); |
| 1023 renderer()->paint(paintInfo, layerLocation); | 1020 renderer()->paint(paintInfo, layerLocation); |
| 1024 } | 1021 } |
| 1025 | 1022 |
| 1026 if (shouldClip) | 1023 if (shouldClip) |
| 1027 restoreClip(context, localPaintingInfo.paintDirtyRect, layerForegroundRe
ct); | 1024 restoreClip(context, localPaintingInfo.paintDirtyRect, layerForegroundRe
ct); |
| 1028 } | 1025 } |
| 1029 | 1026 |
| 1030 void RenderLayer::paintMask(GraphicsContext* context, const LayerPaintingInfo& l
ocalPaintingInfo, | |
| 1031 LayoutPoint& layerLocation, ClipRect& layerBackgroundRect) | |
| 1032 { | |
| 1033 if (localPaintingInfo.clipToDirtyRect) | |
| 1034 clipToRect(localPaintingInfo, context, layerBackgroundRect, DoNotInclude
SelfForBorderRadius); // Mask painting will handle clipping to self. | |
| 1035 | |
| 1036 // Paint the mask. | |
| 1037 // FIXME: Eventually we will collect the region from the fragment itself ins
tead of just from the paint info. | |
| 1038 PaintInfo paintInfo(context, pixelSnappedIntRect(layerBackgroundRect.rect())
, PaintPhaseMask, localPaintingInfo.rootLayer->renderer()); | |
| 1039 renderer()->paint(paintInfo, layerLocation); | |
| 1040 | |
| 1041 if (localPaintingInfo.clipToDirtyRect) | |
| 1042 restoreClip(context, localPaintingInfo.paintDirtyRect, layerBackgroundRe
ct); | |
| 1043 } | |
| 1044 | |
| 1045 static inline LayoutRect frameVisibleRect(RenderObject* renderer) | 1027 static inline LayoutRect frameVisibleRect(RenderObject* renderer) |
| 1046 { | 1028 { |
| 1047 FrameView* frameView = renderer->document().view(); | 1029 FrameView* frameView = renderer->document().view(); |
| 1048 if (!frameView) | 1030 if (!frameView) |
| 1049 return LayoutRect(); | 1031 return LayoutRect(); |
| 1050 | 1032 |
| 1051 return frameView->visibleContentRect(); | 1033 return frameView->visibleContentRect(); |
| 1052 } | 1034 } |
| 1053 | 1035 |
| 1054 bool RenderLayer::hitTest(const HitTestRequest& request, HitTestResult& result) | 1036 bool RenderLayer::hitTest(const HitTestRequest& request, HitTestResult& result) |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1690 } | 1672 } |
| 1691 } | 1673 } |
| 1692 | 1674 |
| 1693 void showLayerTree(const blink::RenderObject* renderer) | 1675 void showLayerTree(const blink::RenderObject* renderer) |
| 1694 { | 1676 { |
| 1695 if (!renderer) | 1677 if (!renderer) |
| 1696 return; | 1678 return; |
| 1697 showLayerTree(renderer->enclosingLayer()); | 1679 showLayerTree(renderer->enclosingLayer()); |
| 1698 } | 1680 } |
| 1699 #endif | 1681 #endif |
| OLD | NEW |