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/paint/FilterPainter.h" | 10 #include "core/paint/FilterPainter.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 if (m_renderLayer.paintsWithTransparency(paintingInfo.paintBehavior)) | 68 if (m_renderLayer.paintsWithTransparency(paintingInfo.paintBehavior)) |
| 69 paintFlags |= PaintLayerHaveTransparency; | 69 paintFlags |= PaintLayerHaveTransparency; |
| 70 | 70 |
| 71 // PaintLayerAppliedTransform is used in RenderReplica, to avoid applying th e transform twice. | 71 // PaintLayerAppliedTransform is used in RenderReplica, to avoid applying th e transform twice. |
| 72 if (m_renderLayer.paintsWithTransform(paintingInfo.paintBehavior) && !(paint Flags & PaintLayerAppliedTransform)) { | 72 if (m_renderLayer.paintsWithTransform(paintingInfo.paintBehavior) && !(paint Flags & PaintLayerAppliedTransform)) { |
| 73 TransformationMatrix layerTransform = m_renderLayer.renderableTransform( paintingInfo.paintBehavior); | 73 TransformationMatrix layerTransform = m_renderLayer.renderableTransform( paintingInfo.paintBehavior); |
| 74 // If the transform can't be inverted, then don't paint anything. | 74 // If the transform can't be inverted, then don't paint anything. |
| 75 if (!layerTransform.isInvertible()) | 75 if (!layerTransform.isInvertible()) |
| 76 return; | 76 return; |
| 77 | 77 |
| 78 // If we have a transparency layer enclosing us and we are the root of a transform, then we need to establish the transparency | |
| 79 // layer from the parent now, assuming there is a parent | |
| 80 if (paintFlags & PaintLayerHaveTransparency) { | |
| 81 // FIXME: can we get rid of this? It would mean transparency starts after clipping in these cases. | |
| 82 if (m_renderLayer.parent()) | |
| 83 LayerPainter(*m_renderLayer.parent()).beginTransparencyLayers(co ntext, paintingInfo.rootLayer, paintingInfo.paintDirtyRect, paintingInfo.subPixe lAccumulation, paintingInfo.paintBehavior); | |
|
mstensho (USE GERRIT)
2014/11/14 12:20:51
I think this change is actually what causes the in
chrishtr
2014/11/14 20:11:37
Done.
| |
| 84 else | |
| 85 beginTransparencyLayers(context, paintingInfo.rootLayer, paintin gInfo.paintDirtyRect, paintingInfo.subPixelAccumulation, paintingInfo.paintBehav ior); | |
| 86 } | |
| 87 | |
| 88 if (m_renderLayer.enclosingPaginationLayer()) { | 78 if (m_renderLayer.enclosingPaginationLayer()) { |
| 79 // FIXME: unify this one-off path with the code below. | |
|
mstensho (USE GERRIT)
2014/11/14 12:20:52
I'm on it. :)
chrishtr
2014/11/14 20:11:37
ack!
| |
| 89 paintTransformedLayerIntoFragments(context, paintingInfo, paintFlags ); | 80 paintTransformedLayerIntoFragments(context, paintingInfo, paintFlags ); |
| 90 return; | 81 return; |
| 91 } | 82 } |
| 92 | 83 |
| 93 // Make sure the parent's clip rects have been calculated. | 84 // Make sure the parent's clip rects have been calculated. |
| 94 ClipRect clipRect = paintingInfo.paintDirtyRect; | 85 ClipRect clipRect = paintingInfo.paintDirtyRect; |
| 95 | 86 |
| 96 OwnPtr<ClipRecorder> clipRecorder; | 87 OwnPtr<ClipRecorder> clipRecorder; |
| 97 if (m_renderLayer.parent()) { | 88 if (m_renderLayer.parent()) { |
| 98 ClipRectsContext clipRectsContext(paintingInfo.rootLayer, (paintFlag s & PaintLayerUncachedClipRects) ? UncachedClipRects : PaintingClipRects, Ignore OverlayScrollbarSize); | 89 ClipRectsContext clipRectsContext(paintingInfo.rootLayer, (paintFlag s & PaintLayerUncachedClipRects) ? UncachedClipRects : PaintingClipRects, Ignore OverlayScrollbarSize); |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 109 } | 100 } |
| 110 | 101 |
| 111 paintLayerByApplyingTransform(context, paintingInfo, paintFlags); | 102 paintLayerByApplyingTransform(context, paintingInfo, paintFlags); |
| 112 | 103 |
| 113 return; | 104 return; |
| 114 } | 105 } |
| 115 | 106 |
| 116 paintLayerContentsAndReflection(context, paintingInfo, paintFlags); | 107 paintLayerContentsAndReflection(context, paintingInfo, paintFlags); |
| 117 } | 108 } |
| 118 | 109 |
| 119 bool LayerPainter::shouldCreateTransparencyLayerForBlendMode() | 110 bool shouldUseTransparencyLayer(RenderLayer& renderLayer, PaintBehavior paintBeh avior) |
|
mstensho (USE GERRIT)
2014/11/14 12:20:51
static? Static inline, even?
chrishtr
2014/11/14 20:11:36
Inlined.
| |
| 120 { | |
| 121 return !m_renderLayer.renderer()->isDocumentElement() && m_renderLayer.stack ingNode()->isStackingContext() && m_renderLayer.hasNonIsolatedDescendantWithBlen dMode(); | |
| 122 } | |
| 123 | |
| 124 void LayerPainter::beginTransparencyLayers(GraphicsContext* context, const Rende rLayer* rootLayer, const LayoutRect& paintDirtyRect, const LayoutSize& subPixelA ccumulation, PaintBehavior paintBehavior) | |
| 125 { | 111 { |
| 126 // Blending operations must be performed only with the nearest ancestor stac king context. | 112 // Blending operations must be performed only with the nearest ancestor stac king context. |
| 127 // Note that there is no need to create a transparency layer if we're painti ng the root. | 113 // Note that there is no need to create a transparency layer if we're painti ng the root. |
| 128 // FIXME: this should be unified further into RenderLayer::paintsWithTranspa rency(). | 114 // FIXME: this should be unified further into RenderLayer::paintsWithTranspa rency(). |
| 129 if (!m_renderLayer.paintsWithTransparency(paintBehavior) && !shouldCreateTra nsparencyLayerForBlendMode()) | 115 bool shouldUseTransparencyLayerForBlendMode = !renderLayer.renderer()->isDoc umentElement() && renderLayer.stackingNode()->isStackingContext() && renderLayer .hasNonIsolatedDescendantWithBlendMode(); |
| 116 return renderLayer.paintsWithTransparency(paintBehavior) || shouldUseTranspa rencyLayerForBlendMode; | |
|
mstensho (USE GERRIT)
2014/11/14 12:20:51
Might as well flip the expressions here. No need t
chrishtr
2014/11/14 20:11:36
Done.
| |
| 117 } | |
| 118 | |
| 119 class TransparencyLayerHelper { | |
| 120 public: | |
| 121 TransparencyLayerHelper(GraphicsContext* context, RenderLayer& renderLayer, const RenderLayer* rootLayer, const LayoutRect& paintDirtyRect, const LayoutSize & subPixelAccumulation, PaintBehavior paintBehavior) | |
| 122 : m_transparencyLayerInProgress(false) | |
| 123 , m_context(context) | |
| 124 { | |
| 125 if (!shouldUseTransparencyLayer(renderLayer, paintBehavior)) | |
| 126 return; | |
| 127 | |
| 128 context->save(); | |
| 129 LayoutRect clipRect = renderLayer.paintingExtent(rootLayer, paintDirtyRe ct, subPixelAccumulation, paintBehavior); | |
| 130 context->clip(clipRect); | |
| 131 | |
| 132 if (renderLayer.renderer()->hasBlendMode()) | |
| 133 context->setCompositeOperation(context->compositeOperation(), render Layer.renderer()->style()->blendMode()); | |
| 134 | |
| 135 context->beginTransparencyLayer(renderLayer.renderer()->opacity()); | |
| 136 | |
| 137 if (renderLayer.renderer()->hasBlendMode()) | |
| 138 context->setCompositeOperation(context->compositeOperation(), WebBle ndModeNormal); | |
| 139 #ifdef REVEAL_TRANSPARENCY_LAYERS | |
| 140 context->fillRect(clipRect, Color(0.0f, 0.0f, 0.5f, 0.2f)); | |
| 141 #endif | |
| 142 m_transparencyLayerInProgress = true; | |
| 143 } | |
| 144 | |
| 145 ~TransparencyLayerHelper() | |
| 146 { | |
| 147 if (m_transparencyLayerInProgress) { | |
|
mstensho (USE GERRIT)
2014/11/14 12:20:51
Couldn't you just NULL m_context if there's no tra
chrishtr
2014/11/14 20:11:36
Feels ugly to me.
mstensho (USE GERRIT)
2014/11/14 23:03:21
Acknowledged.
| |
| 148 m_context->endLayer(); | |
| 149 m_context->restore(); | |
| 150 } | |
| 151 } | |
| 152 private: | |
| 153 bool m_transparencyLayerInProgress; | |
| 154 GraphicsContext* m_context; | |
| 155 }; | |
| 156 | |
| 157 void LayerPainter::beginTransparencyLayers(GraphicsContext* context, const Rende rLayer* rootLayer, const LayoutRect& paintDirtyRect, const LayoutSize& subPixelA ccumulation, PaintBehavior paintBehavior) | |
|
mstensho (USE GERRIT)
2014/11/14 12:20:51
Bye-bye to this then. :)
chrishtr
2014/11/14 20:11:36
Yeah, forgot to delete. Sorry for the sloppy work
mstensho (USE GERRIT)
2014/11/14 23:03:21
No worries. Didn't keep me from seeing the inner b
| |
| 158 { | |
| 159 if (!shouldUseTransparencyLayer(m_renderLayer, paintBehavior)) | |
| 130 return; | 160 return; |
| 131 | 161 |
| 132 // FIXME: refactor to remove this. | |
| 133 if (m_renderLayer.usedTransparency()) | |
| 134 return; | |
| 135 | |
| 136 m_renderLayer.setUsedTransparency(true); | |
| 137 context->save(); | 162 context->save(); |
| 138 LayoutRect clipRect = m_renderLayer.paintingExtent(rootLayer, paintDirtyRect , subPixelAccumulation, paintBehavior); | 163 LayoutRect clipRect = m_renderLayer.paintingExtent(rootLayer, paintDirtyRect , subPixelAccumulation, paintBehavior); |
| 139 context->clip(clipRect); | 164 context->clip(clipRect); |
| 140 | 165 |
| 141 if (m_renderLayer.renderer()->hasBlendMode()) | 166 if (m_renderLayer.renderer()->hasBlendMode()) |
| 142 context->setCompositeOperation(context->compositeOperation(), m_renderLa yer.renderer()->style()->blendMode()); | 167 context->setCompositeOperation(context->compositeOperation(), m_renderLa yer.renderer()->style()->blendMode()); |
| 143 | 168 |
| 144 context->beginTransparencyLayer(m_renderLayer.renderer()->opacity()); | 169 context->beginTransparencyLayer(m_renderLayer.renderer()->opacity()); |
| 145 | 170 |
| 146 if (m_renderLayer.renderer()->hasBlendMode()) | 171 if (m_renderLayer.renderer()->hasBlendMode()) |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 265 m_renderLayer.convertToLayerCoords(paintingInfo.rootLayer, offsetFromRoot); | 290 m_renderLayer.convertToLayerCoords(paintingInfo.rootLayer, offsetFromRoot); |
| 266 | 291 |
| 267 if (m_renderLayer.compositingState() == PaintsIntoOwnBacking) | 292 if (m_renderLayer.compositingState() == PaintsIntoOwnBacking) |
| 268 offsetFromRoot.move(m_renderLayer.subpixelAccumulation()); | 293 offsetFromRoot.move(m_renderLayer.subpixelAccumulation()); |
| 269 | 294 |
| 270 LayoutRect rootRelativeBounds; | 295 LayoutRect rootRelativeBounds; |
| 271 bool rootRelativeBoundsComputed = false; | 296 bool rootRelativeBoundsComputed = false; |
| 272 | 297 |
| 273 ClipPathHelper clipPathHelper(context, m_renderLayer, paintingInfo, rootRela tiveBounds, rootRelativeBoundsComputed, offsetFromRoot, paintFlags); | 298 ClipPathHelper clipPathHelper(context, m_renderLayer, paintingInfo, rootRela tiveBounds, rootRelativeBoundsComputed, offsetFromRoot, paintFlags); |
| 274 | 299 |
| 275 beginTransparencyLayers(context, paintingInfo.rootLayer, paintingInfo.paintD irtyRect, paintingInfo.subPixelAccumulation, paintingInfo.paintBehavior); | 300 { |
|
mstensho (USE GERRIT)
2014/11/14 12:20:51
No need for this scope.
chrishtr
2014/11/14 20:11:36
The reason I have a scope is to distinguish it fro
mstensho (USE GERRIT)
2014/11/14 23:03:22
Aren't the objects guaranteed to be destroyed in r
chrishtr
2014/11/14 23:05:45
Probably, but I couldn't say that for sure without
mstensho (USE GERRIT)
2014/11/14 23:24:13
https://isocpp.org/wiki/faq/dtors#order-dtors-for-
| |
| 301 TransparencyLayerHelper transparencyLayerHelper(context, m_renderLayer, paintingInfo.rootLayer, paintingInfo.paintDirtyRect, paintingInfo.subPixelAccumu lation, paintingInfo.paintBehavior); | |
| 276 | 302 |
| 277 LayerPaintingInfo localPaintingInfo(paintingInfo); | 303 LayerPaintingInfo localPaintingInfo(paintingInfo); |
| 278 | 304 |
| 279 LayerFragments layerFragments; | 305 LayerFragments layerFragments; |
| 280 if (shouldPaintContent || shouldPaintOutline || isPaintingOverlayScrollbars) { | 306 if (shouldPaintContent || shouldPaintOutline || isPaintingOverlayScrollb ars) { |
| 281 // Collect the fragments. This will compute the clip rectangles and pain t offsets for each layer fragment. | 307 // Collect the fragments. This will compute the clip rectangles and paint offsets for each layer fragment. |
| 282 m_renderLayer.collectFragments(layerFragments, localPaintingInfo.rootLay er, localPaintingInfo.paintDirtyRect, | 308 m_renderLayer.collectFragments(layerFragments, localPaintingInfo.roo tLayer, localPaintingInfo.paintDirtyRect, |
| 283 (paintFlags & PaintLayerUncachedClipRects) ? UncachedClipRects : Pai ntingClipRects, IgnoreOverlayScrollbarSize, | 309 (paintFlags & PaintLayerUncachedClipRects) ? UncachedClipRects : PaintingClipRects, IgnoreOverlayScrollbarSize, |
| 284 shouldRespectOverflowClip(paintFlags, m_renderLayer.renderer()), &of fsetFromRoot, localPaintingInfo.subPixelAccumulation); | 310 shouldRespectOverflowClip(paintFlags, m_renderLayer.renderer()), &offsetFromRoot, localPaintingInfo.subPixelAccumulation); |
| 285 if (shouldPaintContent) | 311 if (shouldPaintContent) |
| 286 shouldPaintContent = atLeastOneFragmentIntersectsDamageRect(layerFra gments, localPaintingInfo, paintFlags, offsetFromRoot); | 312 shouldPaintContent = atLeastOneFragmentIntersectsDamageRect(laye rFragments, localPaintingInfo, paintFlags, offsetFromRoot); |
| 287 } | |
| 288 | |
| 289 bool selectionOnly = localPaintingInfo.paintBehavior & PaintBehaviorSelectio nOnly; | |
| 290 // If this layer's renderer is a child of the paintingRoot, we render uncond itionally, which | |
| 291 // is done by passing a nil paintingRoot down to our renderer (as if no pain tingRoot was ever set). | |
| 292 // Else, our renderer tree may or may not contain the painting root, so we p ass that root along | |
| 293 // so it will be tested against as we descend through the renderers. | |
| 294 RenderObject* paintingRootForRenderer = 0; | |
| 295 if (localPaintingInfo.paintingRoot && !m_renderLayer.renderer()->isDescendan tOf(localPaintingInfo.paintingRoot)) | |
| 296 paintingRootForRenderer = localPaintingInfo.paintingRoot; | |
| 297 | |
| 298 { // Begin block for the lifetime of any filter. | |
| 299 FilterPainter filterPainter(m_renderLayer, context, offsetFromRoot, laye rFragments.isEmpty() ? ClipRect() : layerFragments[0].backgroundRect, localPaint ingInfo, paintFlags, | |
| 300 rootRelativeBounds, rootRelativeBoundsComputed); | |
| 301 | |
| 302 ASSERT(!(localPaintingInfo.paintBehavior & PaintBehaviorForceBlackText)) ; | |
| 303 | |
| 304 bool shouldPaintBackground = isPaintingCompositedBackground && shouldPai ntContent && !selectionOnly; | |
| 305 bool shouldPaintNegZOrderList = (isPaintingScrollingContent && isPaintin gOverflowContents) || (!isPaintingScrollingContent && isPaintingCompositedBackgr ound); | |
| 306 bool shouldPaintOwnContents = isPaintingCompositedForeground && shouldPa intContent; | |
| 307 bool shouldPaintNormalFlowAndPosZOrderLists = isPaintingCompositedForegr ound; | |
| 308 bool shouldPaintOverlayScrollbars = isPaintingOverlayScrollbars; | |
| 309 | |
| 310 PaintBehavior paintBehavior = PaintBehaviorNormal; | |
| 311 if (paintFlags & PaintLayerPaintingSkipRootBackground) | |
| 312 paintBehavior |= PaintBehaviorSkipRootBackground; | |
| 313 else if (paintFlags & PaintLayerPaintingRootBackgroundOnly) | |
| 314 paintBehavior |= PaintBehaviorRootBackgroundOnly; | |
| 315 | |
| 316 if (shouldPaintBackground) { | |
| 317 paintBackgroundForFragments(layerFragments, context, paintingInfo.pa intDirtyRect, | |
| 318 localPaintingInfo, paintBehavior, paintingRootForRenderer, paint Flags); | |
| 319 } | 313 } |
| 320 | 314 |
| 321 if (shouldPaintNegZOrderList) | 315 bool selectionOnly = localPaintingInfo.paintBehavior & PaintBehaviorSele ctionOnly; |
| 322 paintChildren(NegativeZOrderChildren, context, paintingInfo, paintFl ags); | 316 // If this layer's renderer is a child of the paintingRoot, we render un conditionally, which |
| 317 // is done by passing a nil paintingRoot down to our renderer (as if no paintingRoot was ever set). | |
| 318 // Else, our renderer tree may or may not contain the painting root, so we pass that root along | |
| 319 // so it will be tested against as we descend through the renderers. | |
| 320 RenderObject* paintingRootForRenderer = 0; | |
| 321 if (localPaintingInfo.paintingRoot && !m_renderLayer.renderer()->isDesce ndantOf(localPaintingInfo.paintingRoot)) | |
| 322 paintingRootForRenderer = localPaintingInfo.paintingRoot; | |
| 323 | 323 |
| 324 if (shouldPaintOwnContents) { | 324 { // Begin block for the lifetime of any filter. |
| 325 paintForegroundForFragments(layerFragments, context, paintingInfo.pa intDirtyRect, | 325 FilterPainter filterPainter(m_renderLayer, context, offsetFromRoot, layerFragments.isEmpty() ? ClipRect() : layerFragments[0].backgroundRect, localP aintingInfo, paintFlags, |
| 326 localPaintingInfo, paintBehavior, paintingRootForRenderer, selec tionOnly, paintFlags); | 326 rootRelativeBounds, rootRelativeBoundsComputed); |
| 327 | |
| 328 ASSERT(!(localPaintingInfo.paintBehavior & PaintBehaviorForceBlackTe xt)); | |
| 329 | |
| 330 bool shouldPaintBackground = isPaintingCompositedBackground && shoul dPaintContent && !selectionOnly; | |
| 331 bool shouldPaintNegZOrderList = (isPaintingScrollingContent && isPai ntingOverflowContents) || (!isPaintingScrollingContent && isPaintingCompositedBa ckground); | |
| 332 bool shouldPaintOwnContents = isPaintingCompositedForeground && shou ldPaintContent; | |
| 333 bool shouldPaintNormalFlowAndPosZOrderLists = isPaintingCompositedFo reground; | |
| 334 bool shouldPaintOverlayScrollbars = isPaintingOverlayScrollbars; | |
| 335 | |
| 336 PaintBehavior paintBehavior = PaintBehaviorNormal; | |
| 337 if (paintFlags & PaintLayerPaintingSkipRootBackground) | |
| 338 paintBehavior |= PaintBehaviorSkipRootBackground; | |
| 339 else if (paintFlags & PaintLayerPaintingRootBackgroundOnly) | |
| 340 paintBehavior |= PaintBehaviorRootBackgroundOnly; | |
| 341 | |
| 342 if (shouldPaintBackground) { | |
| 343 paintBackgroundForFragments(layerFragments, context, paintingInf o.paintDirtyRect, | |
| 344 localPaintingInfo, paintBehavior, paintingRootForRenderer, p aintFlags); | |
| 345 } | |
| 346 | |
| 347 if (shouldPaintNegZOrderList) | |
| 348 paintChildren(NegativeZOrderChildren, context, paintingInfo, pai ntFlags); | |
| 349 | |
| 350 if (shouldPaintOwnContents) { | |
| 351 paintForegroundForFragments(layerFragments, context, paintingInf o.paintDirtyRect, | |
| 352 localPaintingInfo, paintBehavior, paintingRootForRenderer, s electionOnly, paintFlags); | |
| 353 } | |
| 354 | |
| 355 if (shouldPaintOutline) | |
| 356 paintOutlineForFragments(layerFragments, context, localPaintingI nfo, paintBehavior, paintingRootForRenderer, paintFlags); | |
| 357 | |
| 358 if (shouldPaintNormalFlowAndPosZOrderLists) | |
| 359 paintChildren(NormalFlowChildren | PositiveZOrderChildren, conte xt, paintingInfo, paintFlags); | |
| 360 | |
| 361 if (shouldPaintOverlayScrollbars) | |
| 362 paintOverflowControlsForFragments(layerFragments, context, local PaintingInfo, paintFlags); | |
| 363 } // FilterPainter block | |
| 364 | |
| 365 bool shouldPaintMask = (paintFlags & PaintLayerPaintingCompositingMaskPh ase) && shouldPaintContent && m_renderLayer.renderer()->hasMask() && !selectionO nly; | |
| 366 bool shouldPaintClippingMask = (paintFlags & PaintLayerPaintingChildClip pingMaskPhase) && shouldPaintContent && !selectionOnly; | |
| 367 | |
| 368 if (shouldPaintMask) | |
| 369 paintMaskForFragments(layerFragments, context, localPaintingInfo, pa intingRootForRenderer, paintFlags); | |
| 370 if (shouldPaintClippingMask) { | |
| 371 // Paint the border radius mask for the fragments. | |
| 372 paintChildClippingMaskForFragments(layerFragments, context, localPai ntingInfo, paintingRootForRenderer, paintFlags); | |
| 327 } | 373 } |
| 328 | 374 } // TransparencyLayerHelper block |
| 329 if (shouldPaintOutline) | |
| 330 paintOutlineForFragments(layerFragments, context, localPaintingInfo, paintBehavior, paintingRootForRenderer, paintFlags); | |
| 331 | |
| 332 if (shouldPaintNormalFlowAndPosZOrderLists) | |
| 333 paintChildren(NormalFlowChildren | PositiveZOrderChildren, context, paintingInfo, paintFlags); | |
| 334 | |
| 335 if (shouldPaintOverlayScrollbars) | |
| 336 paintOverflowControlsForFragments(layerFragments, context, localPain tingInfo, paintFlags); | |
| 337 } // Filter painter block | |
| 338 | |
| 339 bool shouldPaintMask = (paintFlags & PaintLayerPaintingCompositingMaskPhase) && shouldPaintContent && m_renderLayer.renderer()->hasMask() && !selectionOnly; | |
| 340 bool shouldPaintClippingMask = (paintFlags & PaintLayerPaintingChildClipping MaskPhase) && shouldPaintContent && !selectionOnly; | |
| 341 | |
| 342 if (shouldPaintMask) | |
| 343 paintMaskForFragments(layerFragments, context, localPaintingInfo, painti ngRootForRenderer, paintFlags); | |
| 344 | |
| 345 if (shouldPaintClippingMask) { | |
| 346 // Paint the border radius mask for the fragments. | |
| 347 paintChildClippingMaskForFragments(layerFragments, context, localPaintin gInfo, paintingRootForRenderer, paintFlags); | |
| 348 } | |
| 349 | |
| 350 // End our transparency layer | |
| 351 if (((paintFlags & PaintLayerHaveTransparency) || shouldCreateTransparencyLa yerForBlendMode()) && m_renderLayer.usedTransparency() | |
| 352 && !(m_renderLayer.reflectionInfo() && m_renderLayer.reflectionInfo()->i sPaintingInsideReflection())) { | |
| 353 context->endLayer(); | |
| 354 context->restore(); | |
| 355 m_renderLayer.setUsedTransparency(false); | |
| 356 } | |
| 357 } | 375 } |
| 358 | 376 |
| 359 static bool inContainingBlockChain(RenderLayer* startLayer, RenderLayer* endLaye r) | 377 static bool inContainingBlockChain(RenderLayer* startLayer, RenderLayer* endLaye r) |
| 360 { | 378 { |
| 361 if (startLayer == endLayer) | 379 if (startLayer == endLayer) |
| 362 return true; | 380 return true; |
| 363 | 381 |
| 364 RenderView* view = startLayer->renderer()->view(); | 382 RenderView* view = startLayer->renderer()->view(); |
| 365 for (RenderBlock* currentBlock = startLayer->renderer()->containingBlock(); currentBlock && currentBlock != view; currentBlock = currentBlock->containingBlo ck()) { | 383 for (RenderBlock* currentBlock = startLayer->renderer()->containingBlock(); currentBlock && currentBlock != view; currentBlock = currentBlock->containingBlo ck()) { |
| 366 if (currentBlock->layer() == endLayer) | 384 if (currentBlock->layer() == endLayer) |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 810 | 828 |
| 811 OwnPtr<ClipRecorder> clipRecorder; | 829 OwnPtr<ClipRecorder> clipRecorder; |
| 812 if (needsToClip(paintingInfo, clipRect)) | 830 if (needsToClip(paintingInfo, clipRect)) |
| 813 clipRecorder = adoptPtr(new ClipRecorder(m_renderLayer.parent(), con text, DisplayItem::ClipLayerFragmentParent, clipRect)); | 831 clipRecorder = adoptPtr(new ClipRecorder(m_renderLayer.parent(), con text, DisplayItem::ClipLayerFragmentParent, clipRect)); |
| 814 | 832 |
| 815 paintLayerByApplyingTransform(context, paintingInfo, paintFlags, fragmen t.paginationOffset); | 833 paintLayerByApplyingTransform(context, paintingInfo, paintFlags, fragmen t.paginationOffset); |
| 816 } | 834 } |
| 817 } | 835 } |
| 818 | 836 |
| 819 } // namespace blink | 837 } // namespace blink |
| OLD | NEW |