Chromium Code Reviews| 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 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 619 return clipRect; | 619 return clipRect; |
| 620 } | 620 } |
| 621 | 621 |
| 622 LayoutRect RenderLayer::paintingExtent(const RenderLayer* rootLayer, const Layou tRect& paintDirtyRect, const LayoutSize& subPixelAccumulation, PaintBehavior pai ntBehavior) | 622 LayoutRect RenderLayer::paintingExtent(const RenderLayer* rootLayer, const Layou tRect& paintDirtyRect, const LayoutSize& subPixelAccumulation, PaintBehavior pai ntBehavior) |
| 623 { | 623 { |
| 624 return intersection(transparencyClipBox(this, rootLayer, PaintingTransparenc yClipBox, RootOfTransparencyClipBox, subPixelAccumulation, paintBehavior), paint DirtyRect); | 624 return intersection(transparencyClipBox(this, rootLayer, PaintingTransparenc yClipBox, RootOfTransparencyClipBox, subPixelAccumulation, paintBehavior), paint DirtyRect); |
| 625 } | 625 } |
| 626 | 626 |
| 627 void RenderLayer::beginTransparencyLayers(GraphicsContext* context, const Render Layer* rootLayer, const LayoutRect& paintDirtyRect, const LayoutSize& subPixelAc cumulation, PaintBehavior paintBehavior) | 627 void RenderLayer::beginTransparencyLayers(GraphicsContext* context, const Render Layer* rootLayer, const LayoutRect& paintDirtyRect, const LayoutSize& subPixelAc cumulation, PaintBehavior paintBehavior) |
| 628 { | 628 { |
| 629 if (paintsWithTransparency(paintBehavior) && m_usedTransparency) | 629 if (isTransparent() && m_usedTransparency) |
| 630 return; | 630 return; |
| 631 | 631 |
| 632 RenderLayer* ancestor = transparentPaintingAncestor(); | 632 RenderLayer* ancestor = transparentPaintingAncestor(); |
| 633 if (ancestor) | 633 if (ancestor) |
| 634 ancestor->beginTransparencyLayers(context, rootLayer, paintDirtyRect, su bPixelAccumulation, paintBehavior); | 634 ancestor->beginTransparencyLayers(context, rootLayer, paintDirtyRect, su bPixelAccumulation, paintBehavior); |
| 635 | 635 |
| 636 if (paintsWithTransparency(paintBehavior)) { | 636 if (isTransparent()) { |
| 637 m_usedTransparency = true; | 637 m_usedTransparency = true; |
| 638 context->save(); | 638 context->save(); |
| 639 LayoutRect clipRect = paintingExtent(rootLayer, paintDirtyRect, subPixel Accumulation, paintBehavior); | 639 LayoutRect clipRect = paintingExtent(rootLayer, paintDirtyRect, subPixel Accumulation, paintBehavior); |
| 640 context->clip(clipRect); | 640 context->clip(clipRect); |
| 641 | 641 |
| 642 context->beginTransparencyLayer(renderer()->opacity()); | 642 context->beginTransparencyLayer(renderer()->opacity()); |
| 643 | 643 |
| 644 #ifdef REVEAL_TRANSPARENCY_LAYERS | 644 #ifdef REVEAL_TRANSPARENCY_LAYERS |
| 645 context->setFillColor(Color(0.0f, 0.0f, 0.5f, 0.2f)); | 645 context->setFillColor(Color(0.0f, 0.0f, 0.5f, 0.2f)); |
| 646 context->fillRect(clipRect); | 646 context->fillRect(clipRect); |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 952 if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant()) | 952 if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant()) |
| 953 return; | 953 return; |
| 954 | 954 |
| 955 if (shouldSuppressPaintingLayer(this)) | 955 if (shouldSuppressPaintingLayer(this)) |
| 956 return; | 956 return; |
| 957 | 957 |
| 958 // If this layer is totally invisible then there is nothing to paint. | 958 // If this layer is totally invisible then there is nothing to paint. |
| 959 if (!renderer()->opacity()) | 959 if (!renderer()->opacity()) |
| 960 return; | 960 return; |
| 961 | 961 |
| 962 if (paintsWithTransparency(paintingInfo.paintBehavior)) | |
| 963 paintFlags |= PaintLayerHaveTransparency; | |
| 964 | |
| 965 if (paintsWithTransform(paintingInfo.paintBehavior)) { | 962 if (paintsWithTransform(paintingInfo.paintBehavior)) { |
| 966 TransformationMatrix layerTransform = renderableTransform(paintingInfo.p aintBehavior); | 963 TransformationMatrix layerTransform = renderableTransform(paintingInfo.p aintBehavior); |
| 967 // If the transform can't be inverted, then don't paint anything. | 964 // If the transform can't be inverted, then don't paint anything. |
| 968 if (!layerTransform.isInvertible()) | 965 if (!layerTransform.isInvertible()) |
| 969 return; | 966 return; |
| 970 | 967 |
| 971 // If we have a transparency layer enclosing us and we are the root of a transform, then we need to establish the transparency | 968 // If we have a transparency layer enclosing us and we are the root of a transform, then we need to establish the transparency |
| 972 // layer from the parent now, assuming there is a parent | 969 // layer from the parent now, assuming there is a parent |
| 973 if (paintFlags & PaintLayerHaveTransparency) { | 970 if (isTransparent()) { |
| 974 if (parent()) | 971 if (parent()) |
| 975 parent()->beginTransparencyLayers(context, paintingInfo.rootLaye r, paintingInfo.paintDirtyRect, paintingInfo.subPixelAccumulation, paintingInfo. paintBehavior); | 972 parent()->beginTransparencyLayers(context, paintingInfo.rootLaye r, paintingInfo.paintDirtyRect, paintingInfo.subPixelAccumulation, paintingInfo. paintBehavior); |
| 976 else | 973 else |
| 977 beginTransparencyLayers(context, paintingInfo.rootLayer, paintin gInfo.paintDirtyRect, paintingInfo.subPixelAccumulation, paintingInfo.paintBehav ior); | 974 beginTransparencyLayers(context, paintingInfo.rootLayer, paintin gInfo.paintDirtyRect, paintingInfo.subPixelAccumulation, paintingInfo.paintBehav ior); |
| 978 } | 975 } |
| 979 | 976 |
| 980 // Make sure the parent's clip rects have been calculated. | 977 // Make sure the parent's clip rects have been calculated. |
| 981 ClipRect clipRect = paintingInfo.paintDirtyRect; | 978 ClipRect clipRect = paintingInfo.paintDirtyRect; |
| 982 if (parent()) { | 979 if (parent()) { |
| 983 ClipRectsContext clipRectsContext(paintingInfo.rootLayer, (paintFlag s & PaintLayerUncachedClipRects) ? UncachedClipRects : PaintingClipRects); | 980 ClipRectsContext clipRectsContext(paintingInfo.rootLayer, PaintingCl ipRects); |
| 984 clipRect = clipper().backgroundClipRect(clipRectsContext); | 981 clipRect = clipper().backgroundClipRect(clipRectsContext); |
| 985 clipRect.intersect(paintingInfo.paintDirtyRect); | 982 clipRect.intersect(paintingInfo.paintDirtyRect); |
| 986 | 983 |
| 987 // Push the parent coordinate space's clip. | 984 // Push the parent coordinate space's clip. |
| 988 parent()->clipToRect(paintingInfo, context, clipRect, paintFlags); | 985 parent()->clipToRect(paintingInfo, context, clipRect, paintFlags); |
| 989 } | 986 } |
| 990 | 987 |
| 991 paintLayerByApplyingTransform(context, paintingInfo, paintFlags); | 988 paintLayerByApplyingTransform(context, paintingInfo, paintFlags); |
| 992 | 989 |
| 993 // Restore the clip. | 990 // Restore the clip. |
| 994 if (parent()) | 991 if (parent()) |
| 995 parent()->restoreClip(context, paintingInfo.paintDirtyRect, clipRect ); | 992 parent()->restoreClip(context, paintingInfo.paintDirtyRect, clipRect ); |
| 996 | 993 |
| 997 return; | 994 return; |
| 998 } | 995 } |
| 999 | 996 |
| 1000 paintLayerContentsAndReflection(context, paintingInfo, paintFlags); | 997 paintLayerContents(context, paintingInfo, paintFlags); |
| 1001 } | |
| 1002 | |
| 1003 void RenderLayer::paintLayerContentsAndReflection(GraphicsContext* context, cons t LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags) | |
| 1004 { | |
| 1005 ASSERT(isSelfPaintingLayer() || hasSelfPaintingLayerDescendant()); | |
| 1006 | |
| 1007 PaintLayerFlags localPaintFlags = paintFlags | PaintLayerPaintingCompositing AllPhases; | |
| 1008 paintLayerContents(context, paintingInfo, localPaintFlags); | |
| 1009 } | 998 } |
| 1010 | 999 |
| 1011 void RenderLayer::paintLayerContents(GraphicsContext* context, const LayerPainti ngInfo& paintingInfo, PaintLayerFlags paintFlags) | 1000 void RenderLayer::paintLayerContents(GraphicsContext* context, const LayerPainti ngInfo& paintingInfo, PaintLayerFlags paintFlags) |
| 1012 { | 1001 { |
| 1013 ASSERT(isSelfPaintingLayer() || hasSelfPaintingLayerDescendant()); | 1002 ASSERT(isSelfPaintingLayer() || hasSelfPaintingLayerDescendant()); |
| 1014 | 1003 |
| 1015 bool haveTransparency = paintFlags & PaintLayerHaveTransparency; | |
|
ojan
2014/12/04 03:47:13
Moved down to where it's first used and called isT
| |
| 1016 bool isSelfPaintingLayer = this->isSelfPaintingLayer(); | |
| 1017 bool isPaintingOverlayScrollbars = paintFlags & PaintLayerPaintingOverlayScr ollbars; | |
|
ojan
2014/12/04 03:47:13
This just moved down to where it's first used.
| |
| 1018 bool isPaintingScrollingContent = paintFlags & PaintLayerPaintingCompositing ScrollingPhase; | |
|
ojan
2014/12/04 03:47:14
Always false
| |
| 1019 bool isPaintingCompositedForeground = paintFlags & PaintLayerPaintingComposi tingForegroundPhase; | |
|
ojan
2014/12/04 03:47:13
Always true
| |
| 1020 bool isPaintingCompositedBackground = paintFlags & PaintLayerPaintingComposi tingBackgroundPhase; | |
|
ojan
2014/12/04 03:47:14
Always true
| |
| 1021 // Outline always needs to be painted even if we have no visible content. Al so, | |
| 1022 // the outline is painted in the background phase during composited scrollin g. | |
| 1023 // If it were painted in the foreground phase, it would move with the scroll ed | |
| 1024 // content. When not composited scrolling, the outline is painted in the | |
| 1025 // foreground phase. Since scrolled contents are moved by paint invalidation in this | |
| 1026 // case, the outline won't get 'dragged along'. | |
| 1027 bool shouldPaintOutline = isSelfPaintingLayer && !isPaintingOverlayScrollbar s | |
| 1028 && ((isPaintingScrollingContent && isPaintingCompositedBackground) | |
| 1029 || (!isPaintingScrollingContent && isPaintingCompositedForeground)); | |
| 1030 bool shouldPaintContent = isSelfPaintingLayer && !isPaintingOverlayScrollbar s; | |
|
ojan
2014/12/04 03:47:13
This just moved down to where it's first used.
| |
| 1031 | |
| 1032 float deviceScaleFactor = blink::deviceScaleFactor(renderer()->frame()); | 1004 float deviceScaleFactor = blink::deviceScaleFactor(renderer()->frame()); |
| 1033 context->setDeviceScaleFactor(deviceScaleFactor); | 1005 context->setDeviceScaleFactor(deviceScaleFactor); |
| 1034 | 1006 |
| 1035 GraphicsContext* transparencyLayerContext = context; | 1007 GraphicsContext* transparencyLayerContext = context; |
| 1036 | 1008 |
| 1037 // Ensure our lists are up-to-date. | |
| 1038 m_stackingNode->updateLayerListsIfNeeded(); | 1009 m_stackingNode->updateLayerListsIfNeeded(); |
| 1039 | 1010 |
| 1040 LayoutPoint offsetFromRoot; | 1011 LayoutPoint offsetFromRoot; |
| 1041 convertToLayerCoords(paintingInfo.rootLayer, offsetFromRoot); | 1012 convertToLayerCoords(paintingInfo.rootLayer, offsetFromRoot); |
| 1042 | 1013 |
| 1043 LayoutRect rootRelativeBounds; | 1014 LayoutRect rootRelativeBounds; |
| 1044 bool rootRelativeBoundsComputed = false; | 1015 bool rootRelativeBoundsComputed = false; |
| 1045 | 1016 |
| 1046 // Apply clip-path to context. | 1017 // Apply clip-path to context. |
| 1047 GraphicsContextStateSaver clipStateSaver(*context, false); | 1018 GraphicsContextStateSaver clipStateSaver(*context, false); |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 1065 context->clipPath(clipPath->path(rootRelativeBounds), clipPath-> windRule()); | 1036 context->clipPath(clipPath->path(rootRelativeBounds), clipPath-> windRule()); |
| 1066 } | 1037 } |
| 1067 } | 1038 } |
| 1068 } | 1039 } |
| 1069 | 1040 |
| 1070 LayerPaintingInfo localPaintingInfo(paintingInfo); | 1041 LayerPaintingInfo localPaintingInfo(paintingInfo); |
| 1071 bool deferredFiltersEnabled = renderer()->document().settings()->deferredFil tersEnabled(); | 1042 bool deferredFiltersEnabled = renderer()->document().settings()->deferredFil tersEnabled(); |
| 1072 FilterEffectRendererHelper filterPainter(filterRenderer() && paintsWithFilte rs()); | 1043 FilterEffectRendererHelper filterPainter(filterRenderer() && paintsWithFilte rs()); |
| 1073 | 1044 |
| 1074 LayerFragments layerFragments; | 1045 LayerFragments layerFragments; |
| 1075 if (shouldPaintContent || shouldPaintOutline || isPaintingOverlayScrollbars) { | 1046 // Collect the fragments. This will compute the clip rectangles and paint of fsets for each layer fragment, as well as whether or not the content of each |
|
ojan
2014/12/04 03:47:13
shouldPaintOutline is always true because of !isPa
| |
| 1076 // 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 | 1047 // fragment should paint. |
| 1077 // fragment should paint. | 1048 collectFragments(layerFragments, localPaintingInfo.rootLayer, localPaintingI nfo.paintDirtyRect, |
| 1078 collectFragments(layerFragments, localPaintingInfo.rootLayer, localPaint ingInfo.paintDirtyRect, | 1049 PaintingClipRects, &offsetFromRoot, localPaintingInfo.subPixelAccumulati on); |
| 1079 (paintFlags & PaintLayerUncachedClipRects) ? UncachedClipRects : Pai ntingClipRects, | 1050 |
| 1080 &offsetFromRoot, localPaintingInfo.subPixelAccumulation); | 1051 bool isPaintingOverlayScrollbars = paintFlags & PaintLayerPaintingOverlayScr ollbars; |
| 1081 updatePaintingInfoForFragments(layerFragments, localPaintingInfo, paintF lags, shouldPaintContent, &offsetFromRoot); | 1052 bool shouldPaintContent = isSelfPaintingLayer() && !isPaintingOverlayScrollb ars; |
| 1082 } | 1053 updatePaintingInfoForFragments(layerFragments, localPaintingInfo, paintFlags , shouldPaintContent, &offsetFromRoot); |
| 1054 | |
| 1055 bool haveTransparency = isTransparent(); | |
| 1083 | 1056 |
| 1084 if (filterPainter.haveFilterEffect()) { | 1057 if (filterPainter.haveFilterEffect()) { |
| 1085 ASSERT(this->filterInfo()); | 1058 ASSERT(this->filterInfo()); |
| 1086 | 1059 |
| 1087 if (!rootRelativeBoundsComputed) | 1060 if (!rootRelativeBoundsComputed) |
| 1088 rootRelativeBounds = physicalBoundingBoxIncludingReflectionAndStacki ngChildren(paintingInfo.rootLayer, offsetFromRoot); | 1061 rootRelativeBounds = physicalBoundingBoxIncludingReflectionAndStacki ngChildren(paintingInfo.rootLayer, offsetFromRoot); |
| 1089 | 1062 |
| 1090 if (filterPainter.prepareFilterEffect(this, rootRelativeBounds, painting Info.paintDirtyRect)) { | 1063 if (filterPainter.prepareFilterEffect(this, rootRelativeBounds, painting Info.paintDirtyRect)) { |
| 1091 | 1064 |
| 1092 // Rewire the old context to a memory buffer, so that we can capture the contents of the layer. | 1065 // Rewire the old context to a memory buffer, so that we can capture the contents of the layer. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1131 // If this layer's renderer is a child of the paintingRoot, we render uncond itionally, which | 1104 // If this layer's renderer is a child of the paintingRoot, we render uncond itionally, which |
| 1132 // is done by passing a nil paintingRoot down to our renderer (as if no pain tingRoot was ever set). | 1105 // is done by passing a nil paintingRoot down to our renderer (as if no pain tingRoot was ever set). |
| 1133 // Else, our renderer tree may or may not contain the painting root, so we p ass that root along | 1106 // Else, our renderer tree may or may not contain the painting root, so we p ass that root along |
| 1134 // so it will be tested against as we descend through the renderers. | 1107 // so it will be tested against as we descend through the renderers. |
| 1135 RenderObject* paintingRootForRenderer = 0; | 1108 RenderObject* paintingRootForRenderer = 0; |
| 1136 if (localPaintingInfo.paintingRoot && !renderer()->isDescendantOf(localPaint ingInfo.paintingRoot)) | 1109 if (localPaintingInfo.paintingRoot && !renderer()->isDescendantOf(localPaint ingInfo.paintingRoot)) |
| 1137 paintingRootForRenderer = localPaintingInfo.paintingRoot; | 1110 paintingRootForRenderer = localPaintingInfo.paintingRoot; |
| 1138 | 1111 |
| 1139 ASSERT(!(localPaintingInfo.paintBehavior & PaintBehaviorForceBlackText)); | 1112 ASSERT(!(localPaintingInfo.paintBehavior & PaintBehaviorForceBlackText)); |
| 1140 | 1113 |
| 1141 bool shouldPaintBackground = isPaintingCompositedBackground && shouldPaintCo ntent; | |
|
ojan
2014/12/04 03:47:13
This is now just shouldPaintContent.
| |
| 1142 bool shouldPaintNegZOrderList = !isPaintingScrollingContent && isPaintingCom positedBackground; | |
|
ojan
2014/12/04 03:47:14
This is always true.
| |
| 1143 bool shouldPaintOwnContents = isPaintingCompositedForeground && shouldPaintC ontent; | |
|
ojan
2014/12/04 03:47:14
This is now just shouldPaintContent.
| |
| 1144 bool shouldPaintNormalFlowAndPosZOrderLists = isPaintingCompositedForeground ; | |
|
ojan
2014/12/04 03:47:14
This is always true.
| |
| 1145 bool shouldPaintOverlayScrollbars = isPaintingOverlayScrollbars; | |
|
ojan
2014/12/04 03:47:14
Useless local variable. Inlined.
| |
| 1146 bool shouldPaintMask = (paintFlags & PaintLayerPaintingCompositingMaskPhase) && shouldPaintContent && renderer()->hasMask(); | |
|
ojan
2014/12/04 03:47:13
This is now shouldPaintContent && renderer()->hasM
| |
| 1147 | |
| 1148 // FIXME(sky): Get rid of PaintBehavior argument now that it's always Normal . | 1114 // FIXME(sky): Get rid of PaintBehavior argument now that it's always Normal . |
| 1149 PaintBehavior paintBehavior = PaintBehaviorNormal; | 1115 PaintBehavior paintBehavior = PaintBehaviorNormal; |
| 1150 | 1116 |
| 1151 if (shouldPaintBackground) { | 1117 if (shouldPaintContent) { |
| 1152 paintBackgroundForFragments(layerFragments, context, transparencyLayerCo ntext, paintingInfo.paintDirtyRect, haveTransparency, | 1118 paintBackgroundForFragments(layerFragments, context, transparencyLayerCo ntext, paintingInfo.paintDirtyRect, haveTransparency, |
| 1153 localPaintingInfo, paintBehavior, paintingRootForRenderer, paintFlag s); | 1119 localPaintingInfo, paintBehavior, paintingRootForRenderer, paintFlag s); |
| 1154 } | 1120 } |
| 1155 | 1121 |
| 1156 if (shouldPaintNegZOrderList) | 1122 paintChildren(NegativeZOrderChildren, context, paintingInfo, paintFlags); |
| 1157 paintChildren(NegativeZOrderChildren, context, paintingInfo, paintFlags) ; | |
| 1158 | 1123 |
| 1159 if (shouldPaintOwnContents) { | 1124 if (shouldPaintContent) { |
| 1160 paintForegroundForFragments(layerFragments, context, transparencyLayerCo ntext, paintingInfo.paintDirtyRect, haveTransparency, | 1125 paintForegroundForFragments(layerFragments, context, transparencyLayerCo ntext, paintingInfo.paintDirtyRect, haveTransparency, |
| 1161 localPaintingInfo, paintBehavior, paintingRootForRenderer, paintFlag s); | 1126 localPaintingInfo, paintBehavior, paintingRootForRenderer, paintFlag s); |
| 1162 } | 1127 } |
| 1163 | 1128 |
| 1164 if (shouldPaintOutline) | 1129 paintOutlineForFragments(layerFragments, context, localPaintingInfo, paintBe havior, paintingRootForRenderer, paintFlags); |
| 1165 paintOutlineForFragments(layerFragments, context, localPaintingInfo, pai ntBehavior, paintingRootForRenderer, paintFlags); | 1130 paintChildren(NormalFlowChildren | PositiveZOrderChildren, context, painting Info, paintFlags); |
| 1166 | 1131 |
| 1167 if (shouldPaintNormalFlowAndPosZOrderLists) | 1132 if (isPaintingOverlayScrollbars) |
| 1168 paintChildren(NormalFlowChildren | PositiveZOrderChildren, context, pain tingInfo, paintFlags); | |
| 1169 | |
| 1170 if (shouldPaintOverlayScrollbars) | |
| 1171 paintOverflowControlsForFragments(layerFragments, context, localPainting Info, paintFlags); | 1133 paintOverflowControlsForFragments(layerFragments, context, localPainting Info, paintFlags); |
| 1172 | 1134 |
| 1173 if (filterPainter.hasStartedFilterEffect()) { | 1135 if (filterPainter.hasStartedFilterEffect()) { |
| 1174 // Apply the correct clipping (ie. overflow: hidden). | 1136 // Apply the correct clipping (ie. overflow: hidden). |
| 1175 // FIXME: It is incorrect to just clip to the damageRect here once multi ple fragments are involved. | 1137 // FIXME: It is incorrect to just clip to the damageRect here once multi ple fragments are involved. |
| 1176 ClipRect backgroundRect = layerFragments.isEmpty() ? ClipRect() : layerF ragments[0].backgroundRect; | 1138 ClipRect backgroundRect = layerFragments.isEmpty() ? ClipRect() : layerF ragments[0].backgroundRect; |
| 1177 if (!deferredFiltersEnabled) | 1139 if (!deferredFiltersEnabled) |
| 1178 clipToRect(localPaintingInfo, transparencyLayerContext, backgroundRe ct, paintFlags); | 1140 clipToRect(localPaintingInfo, transparencyLayerContext, backgroundRe ct, paintFlags); |
| 1179 | 1141 |
| 1180 context = filterPainter.applyFilterEffect(); | 1142 context = filterPainter.applyFilterEffect(); |
| 1181 restoreClip(transparencyLayerContext, localPaintingInfo.paintDirtyRect, backgroundRect); | 1143 restoreClip(transparencyLayerContext, localPaintingInfo.paintDirtyRect, backgroundRect); |
| 1182 } | 1144 } |
| 1183 | 1145 |
| 1184 // Make sure that we now use the original transparency context. | 1146 // Make sure that we now use the original transparency context. |
| 1185 ASSERT(transparencyLayerContext == context); | 1147 ASSERT(transparencyLayerContext == context); |
| 1186 | 1148 |
| 1187 if (shouldPaintMask) | 1149 if (shouldPaintContent && renderer()->hasMask()) |
| 1188 paintMaskForFragments(layerFragments, context, localPaintingInfo, painti ngRootForRenderer, paintFlags); | 1150 paintMaskForFragments(layerFragments, context, localPaintingInfo, painti ngRootForRenderer, paintFlags); |
| 1189 | 1151 |
| 1190 // End our transparency layer | 1152 // End our transparency layer |
| 1191 if (haveTransparency && m_usedTransparency) { | 1153 if (haveTransparency && m_usedTransparency) { |
| 1192 context->endLayer(); | 1154 context->endLayer(); |
| 1193 context->restore(); | 1155 context->restore(); |
| 1194 m_usedTransparency = false; | 1156 m_usedTransparency = false; |
| 1195 } | 1157 } |
| 1196 } | 1158 } |
| 1197 | 1159 |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 1210 // Apply the transform. | 1172 // Apply the transform. |
| 1211 GraphicsContextStateSaver stateSaver(*context, false); | 1173 GraphicsContextStateSaver stateSaver(*context, false); |
| 1212 if (!transform.isIdentity()) { | 1174 if (!transform.isIdentity()) { |
| 1213 stateSaver.save(); | 1175 stateSaver.save(); |
| 1214 context->concatCTM(transform.toAffineTransform()); | 1176 context->concatCTM(transform.toAffineTransform()); |
| 1215 } | 1177 } |
| 1216 | 1178 |
| 1217 // Now do a paint with the root layer shifted to be us. | 1179 // Now do a paint with the root layer shifted to be us. |
| 1218 LayerPaintingInfo transformedPaintingInfo(this, enclosingIntRect(transform.i nverse().mapRect(paintingInfo.paintDirtyRect)), paintingInfo.paintBehavior, | 1180 LayerPaintingInfo transformedPaintingInfo(this, enclosingIntRect(transform.i nverse().mapRect(paintingInfo.paintDirtyRect)), paintingInfo.paintBehavior, |
| 1219 adjustedSubPixelAccumulation, paintingInfo.paintingRoot); | 1181 adjustedSubPixelAccumulation, paintingInfo.paintingRoot); |
| 1220 paintLayerContentsAndReflection(context, transformedPaintingInfo, paintFlags ); | 1182 paintLayerContents(context, transformedPaintingInfo, paintFlags); |
| 1221 } | 1183 } |
| 1222 | 1184 |
| 1223 void RenderLayer::paintChildren(unsigned childrenToVisit, GraphicsContext* conte xt, const LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags) | 1185 void RenderLayer::paintChildren(unsigned childrenToVisit, GraphicsContext* conte xt, const LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags) |
| 1224 { | 1186 { |
| 1225 if (!hasSelfPaintingLayerDescendant()) | 1187 if (!hasSelfPaintingLayerDescendant()) |
| 1226 return; | 1188 return; |
| 1227 | 1189 |
| 1228 #if ENABLE(ASSERT) | 1190 #if ENABLE(ASSERT) |
| 1229 LayerListMutationDetector mutationChecker(m_stackingNode.get()); | 1191 LayerListMutationDetector mutationChecker(m_stackingNode.get()); |
| 1230 #endif | 1192 #endif |
| (...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1961 { | 1923 { |
| 1962 // FIXME(sky): Remove | 1924 // FIXME(sky): Remove |
| 1963 return transform(); | 1925 return transform(); |
| 1964 } | 1926 } |
| 1965 | 1927 |
| 1966 bool RenderLayer::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) const | 1928 bool RenderLayer::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) const |
| 1967 { | 1929 { |
| 1968 if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant()) | 1930 if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant()) |
| 1969 return false; | 1931 return false; |
| 1970 | 1932 |
| 1971 if (paintsWithTransparency(PaintBehaviorNormal)) | 1933 if (isTransparent()) |
| 1972 return false; | 1934 return false; |
| 1973 | 1935 |
| 1974 if (paintsWithFilters() && renderer()->style()->filter().hasFilterThatAffect sOpacity()) | 1936 if (paintsWithFilters() && renderer()->style()->filter().hasFilterThatAffect sOpacity()) |
| 1975 return false; | 1937 return false; |
| 1976 | 1938 |
| 1977 // FIXME: Handle simple transforms. | 1939 // FIXME: Handle simple transforms. |
| 1978 if (paintsWithTransform(PaintBehaviorNormal)) | 1940 if (paintsWithTransform(PaintBehaviorNormal)) |
| 1979 return false; | 1941 return false; |
| 1980 | 1942 |
| 1981 // FIXME: Remove this check. | 1943 // FIXME: Remove this check. |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2188 } | 2150 } |
| 2189 } | 2151 } |
| 2190 | 2152 |
| 2191 void showLayerTree(const blink::RenderObject* renderer) | 2153 void showLayerTree(const blink::RenderObject* renderer) |
| 2192 { | 2154 { |
| 2193 if (!renderer) | 2155 if (!renderer) |
| 2194 return; | 2156 return; |
| 2195 showLayerTree(renderer->enclosingLayer()); | 2157 showLayerTree(renderer->enclosingLayer()); |
| 2196 } | 2158 } |
| 2197 #endif | 2159 #endif |
| OLD | NEW |