Changeset 170282 in webkit
- Timestamp:
- Jun 22, 2014, 9:28:16 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r170273 r170282 1 2014-06-22 Zalan Bujtas <zalan@apple.com> 2 3 Make offset from ancestor computation explicit by moving it to the callers. 4 https://bugs.webkit.org/show_bug.cgi?id=134168. 5 6 Reviewed by Simon Fraser. 7 8 Explicit offset computation helps code reading and less error-prone than passing 9 the offset pointer and compute it locally when it is null. 10 11 No change in functionality. 12 13 * rendering/RenderLayer.cpp: 14 (WebCore::transparencyClipBox): 15 (WebCore::performOverlapTests): 16 (WebCore::RenderLayer::setupClipPath): 17 (WebCore::RenderLayer::setupFilters): 18 (WebCore::RenderLayer::paintLayerContents): 19 (WebCore::RenderLayer::collectFragments): 20 (WebCore::RenderLayer::updatePaintingInfoForFragments): 21 (WebCore::RenderLayer::paintTransformedLayerIntoFragments): 22 (WebCore::RenderLayer::hitTestLayer): 23 (WebCore::RenderLayer::hitTestTransformedLayerInFragments): 24 (WebCore::RenderLayer::calculateClipRects): 25 * rendering/RenderLayer.h: 26 * rendering/RenderLayerCompositor.cpp: 27 (WebCore::RenderLayerCompositor::calculateCompositedBounds): 28 (WebCore::RenderLayerCompositor::requiresCompositingForPosition): 29 * rendering/RenderTreeAsText.cpp: 30 (WebCore::writeLayers): 31 1 32 2014-06-22 Zalan Bujtas <zalan@apple.com> 2 33 -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r170273 r170282 1637 1637 } 1638 1638 1639 LayoutRect clipRect = layer->boundingBox(rootLayer, transparencyBehavior == HitTestingTransparencyClipBox ? RenderLayer::UseFragmentBoxesIncludingCompositing : RenderLayer::UseFragmentBoxesExcludingCompositing);1639 LayoutRect clipRect = layer->boundingBox(rootLayer, layer->offsetFromAncestor(rootLayer), transparencyBehavior == HitTestingTransparencyClipBox ? RenderLayer::UseFragmentBoxesIncludingCompositing : RenderLayer::UseFragmentBoxesExcludingCompositing); 1640 1640 expandClipRectForDescendantsAndReflection(clipRect, layer, rootLayer, transparencyBehavior, paintBehavior); 1641 1641 #if ENABLE(CSS_FILTERS) … … 3579 3579 Vector<OverlapTestRequestClient*> overlappedRequestClients; 3580 3580 OverlapTestRequestMap::iterator end = overlapTestRequests.end(); 3581 LayoutRect boundingBox = layer->boundingBox(rootLayer );3581 LayoutRect boundingBox = layer->boundingBox(rootLayer, layer->offsetFromAncestor(rootLayer)); 3582 3582 for (OverlapTestRequestMap::iterator it = overlapTestRequests.begin(); it != end; ++it) { 3583 3583 if (!boundingBox.intersects(it->value)) … … 3796 3796 3797 3797 if (!rootRelativeBoundsComputed) { 3798 rootRelativeBounds = calculateLayerBounds(paintingInfo.rootLayer, &offsetFromRoot, 0);3798 rootRelativeBounds = calculateLayerBounds(paintingInfo.rootLayer, offsetFromRoot, 0); 3799 3799 rootRelativeBoundsComputed = true; 3800 3800 } … … 3858 3858 3859 3859 if (!rootRelativeBoundsComputed) { 3860 rootRelativeBounds = calculateLayerBounds(paintingInfo.rootLayer, &offsetFromRoot, 0);3860 rootRelativeBounds = calculateLayerBounds(paintingInfo.rootLayer, offsetFromRoot, 0); 3861 3861 rootRelativeBoundsComputed = true; 3862 3862 } … … 4023 4023 collectFragments(layerFragments, localPaintingInfo.rootLayer, paintDirtyRect, ExcludeCompositedPaginatedLayers, 4024 4024 (localPaintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : PaintingClipRects, IgnoreOverlayScrollbarSize, 4025 (isPaintingOverflowContents) ? IgnoreOverflowClip : RespectOverflowClip, &offsetFromRoot);4026 updatePaintingInfoForFragments(layerFragments, localPaintingInfo, localPaintFlags, shouldPaintContent, &offsetFromRoot);4025 (isPaintingOverflowContents) ? IgnoreOverflowClip : RespectOverflowClip, offsetFromRoot); 4026 updatePaintingInfoForFragments(layerFragments, localPaintingInfo, localPaintFlags, shouldPaintContent, offsetFromRoot); 4027 4027 } 4028 4028 … … 4166 4166 4167 4167 void RenderLayer::collectFragments(LayerFragments& fragments, const RenderLayer* rootLayer, const LayoutRect& dirtyRect, PaginationInclusionMode inclusionMode, 4168 ClipRectsType clipRectsType, OverlayScrollbarSizeRelevancy inOverlayScrollbarSizeRelevancy, ShouldRespectOverflowClip respectOverflowClip, const LayoutSize *offsetFromRoot,4168 ClipRectsType clipRectsType, OverlayScrollbarSizeRelevancy inOverlayScrollbarSizeRelevancy, ShouldRespectOverflowClip respectOverflowClip, const LayoutSize& offsetFromRoot, 4169 4169 const LayoutRect* layerBoundingBox, ShouldApplyRootOffsetToFragments applyRootOffsetToFragments) 4170 4170 { … … 4190 4190 ClipRect outlineRectInFlowThread; 4191 4191 calculateRects(paginationClipRectsContext, LayoutRect::infiniteRect(), layerBoundsInFlowThread, backgroundRectInFlowThread, foregroundRectInFlowThread, 4192 outlineRectInFlowThread, &offsetWithinPaginatedLayer);4192 outlineRectInFlowThread, offsetWithinPaginatedLayer); 4193 4193 4194 4194 // Take our bounding box within the flow thread and clip it. 4195 LayoutRect layerBoundingBoxInFlowThread = layerBoundingBox ? *layerBoundingBox : boundingBox(paginationLayer, 0, &offsetWithinPaginatedLayer);4195 LayoutRect layerBoundingBoxInFlowThread = layerBoundingBox ? *layerBoundingBox : boundingBox(paginationLayer, offsetWithinPaginatedLayer); 4196 4196 layerBoundingBoxInFlowThread.intersect(backgroundRectInFlowThread.rect()); 4197 4197 … … 4208 4208 4209 4209 // Now collect ancestor fragments. 4210 parentPaginationLayer->collectFragments(ancestorFragments, rootLayer, dirtyRect, inclusionMode, clipRectsType, inOverlayScrollbarSizeRelevancy, respectOverflowClip, nullptr, &layerFragmentBoundingBoxInParentPaginationLayer, ApplyRootOffsetToFragments); 4210 parentPaginationLayer->collectFragments(ancestorFragments, rootLayer, dirtyRect, inclusionMode, clipRectsType, inOverlayScrollbarSizeRelevancy, respectOverflowClip, 4211 offsetFromAncestor(rootLayer), &layerFragmentBoundingBoxInParentPaginationLayer, ApplyRootOffsetToFragments); 4211 4212 4212 4213 if (ancestorFragments.isEmpty()) … … 4297 4298 4298 4299 void RenderLayer::updatePaintingInfoForFragments(LayerFragments& fragments, const LayerPaintingInfo& localPaintingInfo, PaintLayerFlags localPaintFlags, 4299 bool shouldPaintContent, const LayoutSize* offsetFromRoot) 4300 { 4301 ASSERT(offsetFromRoot); 4300 bool shouldPaintContent, const LayoutSize& offsetFromRoot) 4301 { 4302 4302 for (size_t i = 0; i < fragments.size(); ++i) { 4303 4303 LayerFragment& fragment = fragments.at(i); 4304 4304 fragment.shouldPaintContent = shouldPaintContent; 4305 4305 if (this != localPaintingInfo.rootLayer || !(localPaintFlags & PaintLayerPaintingOverflowContents)) { 4306 LayoutSize newOffsetFromRoot = *offsetFromRoot + fragment.paginationOffset;4307 fragment.shouldPaintContent &= intersectsDamageRect(fragment.layerBounds, fragment.backgroundRect.rect(), localPaintingInfo.rootLayer, &newOffsetFromRoot, fragment.hasBoundingBox ? &fragment.boundingBox : 0);4306 LayoutSize newOffsetFromRoot = offsetFromRoot + fragment.paginationOffset; 4307 fragment.shouldPaintContent &= intersectsDamageRect(fragment.layerBounds, fragment.backgroundRect.rect(), localPaintingInfo.rootLayer, newOffsetFromRoot, fragment.hasBoundingBox ? &fragment.boundingBox : 0); 4308 4308 } 4309 4309 } … … 4318 4318 paginatedLayer->collectFragments(enclosingPaginationFragments, paintingInfo.rootLayer, paintingInfo.paintDirtyRect, ExcludeCompositedPaginatedLayers, 4319 4319 (paintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : PaintingClipRects, IgnoreOverlayScrollbarSize, 4320 (paintFlags & PaintLayerPaintingOverflowContents) ? IgnoreOverflowClip : RespectOverflowClip, &offsetOfPaginationLayerFromRoot, &transformedExtent);4320 (paintFlags & PaintLayerPaintingOverflowContents) ? IgnoreOverflowClip : RespectOverflowClip, offsetOfPaginationLayerFromRoot, &transformedExtent); 4321 4321 4322 4322 for (size_t i = 0; i < enclosingPaginationFragments.size(); ++i) { … … 4810 4810 // Collect the fragments. This will compute the clip rectangles for each layer fragment. 4811 4811 LayerFragments layerFragments; 4812 collectFragments(layerFragments, rootLayer, hitTestRect, IncludeCompositedPaginatedLayers, RootRelativeClipRects, IncludeOverlayScrollbarSize); 4812 collectFragments(layerFragments, rootLayer, hitTestRect, IncludeCompositedPaginatedLayers, RootRelativeClipRects, IncludeOverlayScrollbarSize, RespectOverflowClip, 4813 offsetFromAncestor(rootLayer)); 4813 4814 4814 4815 if (canResize() && hitTestResizerInFragments(layerFragments, hitTestLocation)) { … … 4917 4918 LayoutRect transformedExtent = transparencyClipBox(this, paginatedLayer, HitTestingTransparencyClipBox, RootOfTransparencyClipBox); 4918 4919 paginatedLayer->collectFragments(enclosingPaginationFragments, rootLayer, hitTestRect, IncludeCompositedPaginatedLayers, 4919 RootRelativeClipRects, IncludeOverlayScrollbarSize, RespectOverflowClip, &offsetOfPaginationLayerFromRoot, &transformedExtent);4920 RootRelativeClipRects, IncludeOverlayScrollbarSize, RespectOverflowClip, offsetOfPaginationLayerFromRoot, &transformedExtent); 4920 4921 4921 4922 for (int i = enclosingPaginationFragments.size() - 1; i >= 0; --i) { … … 5252 5253 5253 5254 void RenderLayer::calculateRects(const ClipRectsContext& clipRectsContext, const LayoutRect& paintDirtyRect, LayoutRect& layerBounds, 5254 ClipRect& backgroundRect, ClipRect& foregroundRect, ClipRect& outlineRect, const LayoutSize *offsetFromRoot) const5255 ClipRect& backgroundRect, ClipRect& foregroundRect, ClipRect& outlineRect, const LayoutSize& offsetFromRoot) const 5255 5256 { 5256 5257 if (clipRectsContext.rootLayer != this && parent()) { … … 5260 5261 backgroundRect = paintDirtyRect; 5261 5262 5262 LayoutSize offsetFromAcestor; 5263 if (offsetFromRoot) 5264 offsetFromAcestor = *offsetFromRoot; 5265 else 5266 offsetFromAcestor = offsetFromAncestor(clipRectsContext.rootLayer); 5267 5263 LayoutSize offsetFromRootLocal = offsetFromRoot; 5268 5264 RenderNamedFlowFragment* namedFlowFragment = currentRenderNamedFlowFragment(); 5269 5265 // If the view is scrolled, the flow thread is not scrolled with it and we should … … 5271 5267 if (clipRectsContext.rootLayer->isOutOfFlowRenderFlowThread() && !namedFlowFragment) { 5272 5268 LayoutPoint absPos = LayoutPoint(renderer().view().localToAbsolute(FloatPoint(), IsFixed)); 5273 offsetFrom Acestor+= toLayoutSize(absPos);5274 } 5275 5276 layerBounds = LayoutRect(toLayoutPoint(offsetFrom Acestor), size());5269 offsetFromRootLocal += toLayoutSize(absPos); 5270 } 5271 5272 layerBounds = LayoutRect(toLayoutPoint(offsetFromRootLocal), size()); 5277 5273 5278 5274 foregroundRect = backgroundRect; … … 5297 5293 } 5298 5294 5299 layerBoundsWithVisualOverflow.move(offsetFrom Acestor);5295 layerBoundsWithVisualOverflow.move(offsetFromRootLocal); 5300 5296 backgroundRect.intersect(layerBoundsWithVisualOverflow); 5301 5297 … … 5314 5310 // This layer establishes a clip of some kind. 5315 5311 if (renderer().hasOverflowClip() && (this != clipRectsContext.rootLayer || clipRectsContext.respectOverflowClip == RespectOverflowClip)) { 5316 foregroundRect.intersect(toRenderBox(renderer()).overflowClipRect(toLayoutPoint(offsetFrom Acestor), namedFlowFragment, clipRectsContext.overlayScrollbarSizeRelevancy));5312 foregroundRect.intersect(toRenderBox(renderer()).overflowClipRect(toLayoutPoint(offsetFromRootLocal), namedFlowFragment, clipRectsContext.overlayScrollbarSizeRelevancy)); 5317 5313 if (renderer().style().hasBorderRadius()) 5318 5314 foregroundRect.setHasRadius(true); … … 5321 5317 if (renderer().hasClip()) { 5322 5318 // Clip applies to *us* as well, so go ahead and update the damageRect. 5323 LayoutRect newPosClip = toRenderBox(renderer()).clipRect(toLayoutPoint(offsetFrom Acestor), namedFlowFragment);5319 LayoutRect newPosClip = toRenderBox(renderer()).clipRect(toLayoutPoint(offsetFromRootLocal), namedFlowFragment); 5324 5320 backgroundRect.intersect(newPosClip); 5325 5321 foregroundRect.intersect(newPosClip); … … 5335 5331 LayoutRect layerBoundsWithVisualOverflow = namedFlowFragment ? namedFlowFragment->visualOverflowRectForBox(renderBox()) : renderBox()->visualOverflowRect(); 5336 5332 renderBox()->flipForWritingMode(layerBoundsWithVisualOverflow); // Layers are in physical coordinates, so the overflow has to be flipped. 5337 layerBoundsWithVisualOverflow.move(offsetFrom Acestor);5333 layerBoundsWithVisualOverflow.move(offsetFromRootLocal); 5338 5334 if (this != clipRectsContext.rootLayer || clipRectsContext.respectOverflowClip == RespectOverflowClip) 5339 5335 backgroundRect.intersect(layerBoundsWithVisualOverflow); … … 5344 5340 bounds = namedFlowFragment->rectFlowPortionForBox(renderBox(), bounds); 5345 5341 5346 bounds.move(offsetFrom Acestor);5342 bounds.move(offsetFromRootLocal); 5347 5343 if (this != clipRectsContext.rootLayer || clipRectsContext.respectOverflowClip == RespectOverflowClip) 5348 5344 backgroundRect.intersect(bounds); … … 5372 5368 ClipRectsContext clipRectsContext(clippingRootLayer, TemporaryClipRects); 5373 5369 // Need to use temporary clip rects, because the value of 'dontClipToOverflow' may be different from the painting path (<rdar://problem/11844909>). 5374 calculateRects(clipRectsContext, renderer().view().unscaledDocumentRect(), layerBounds, backgroundRect, foregroundRect, outlineRect );5370 calculateRects(clipRectsContext, renderer().view().unscaledDocumentRect(), layerBounds, backgroundRect, foregroundRect, outlineRect, offsetFromAncestor(clipRectsContext.rootLayer)); 5375 5371 return clippingRootLayer->renderer().localToAbsoluteQuad(FloatQuad(foregroundRect.rect())).enclosingBoundingBox(); 5376 5372 } … … 5384 5380 ClipRect backgroundRect, foregroundRect, outlineRect; 5385 5381 ClipRectsContext clipRectsContext(clippingRootLayer, PaintingClipRects); 5386 calculateRects(clipRectsContext, renderer().view().documentRect(), layerBounds, backgroundRect, foregroundRect, outlineRect );5382 calculateRects(clipRectsContext, renderer().view().documentRect(), layerBounds, backgroundRect, foregroundRect, outlineRect, offsetFromAncestor(clippingRootLayer)); 5387 5383 return clippingRootLayer->renderer().localToAbsoluteQuad(FloatQuad(backgroundRect.rect())).enclosingBoundingBox(); 5388 5384 } … … 5400 5396 ClipRect backgroundRect, foregroundRect, outlineRect; 5401 5397 ClipRectsContext clipRectsContext(clippingRootLayer, PaintingClipRects); 5402 calculateRects(clipRectsContext, LayoutRect::infiniteRect(), layerBounds, backgroundRect, foregroundRect, outlineRect, &offsetFromRoot);5398 calculateRects(clipRectsContext, LayoutRect::infiniteRect(), layerBounds, backgroundRect, foregroundRect, outlineRect, offsetFromRoot); 5403 5399 5404 5400 LayoutRect clipRect = backgroundRect.rect(); … … 5446 5442 } 5447 5443 5448 bool RenderLayer::intersectsDamageRect(const LayoutRect& layerBounds, const LayoutRect& damageRect, const RenderLayer* rootLayer, const LayoutSize *offsetFromRoot, const LayoutRect* cachedBoundingBox) const5444 bool RenderLayer::intersectsDamageRect(const LayoutRect& layerBounds, const LayoutRect& damageRect, const RenderLayer* rootLayer, const LayoutSize& offsetFromRoot, const LayoutRect* cachedBoundingBox) const 5449 5445 { 5450 5446 // Always examine the canvas and the root. … … 5482 5478 return cachedBoundingBox->intersects(damageRect); 5483 5479 5484 return boundingBox(rootLayer, 0,offsetFromRoot).intersects(damageRect);5480 return boundingBox(rootLayer, offsetFromRoot).intersects(damageRect); 5485 5481 } 5486 5482 … … 5528 5524 } 5529 5525 5530 LayoutRect RenderLayer::boundingBox(const RenderLayer* ancestorLayer, CalculateLayerBoundsFlags flags, const LayoutSize* offsetFromRoot) const5526 LayoutRect RenderLayer::boundingBox(const RenderLayer* ancestorLayer, const LayoutSize& offsetFromRoot, CalculateLayerBoundsFlags flags) const 5531 5527 { 5532 5528 LayoutRect result = localBoundingBox(flags); … … 5562 5558 } 5563 5559 5564 LayoutSize delta; 5565 if (offsetFromRoot) 5566 delta = *offsetFromRoot; 5567 else 5568 delta = offsetFromAncestor(ancestorLayer); 5569 5570 result.move(delta); 5560 result.move(offsetFromRoot); 5571 5561 return result; 5572 5562 } … … 5574 5564 IntRect RenderLayer::absoluteBoundingBox() const 5575 5565 { 5576 return pixelSnappedIntRect(boundingBox(root())); 5566 const RenderLayer* rootLayer = root(); 5567 return pixelSnappedIntRect(boundingBox(rootLayer, offsetFromAncestor(rootLayer))); 5577 5568 } 5578 5569 5579 5570 FloatRect RenderLayer::absoluteBoundingBoxForPainting() const 5580 5571 { 5581 return pixelSnappedForPainting(boundingBox(root()), renderer().document().deviceScaleFactor()); 5582 } 5583 5584 LayoutRect RenderLayer::calculateLayerBounds(const RenderLayer* ancestorLayer, const LayoutSize* offsetFromRoot, CalculateLayerBoundsFlags flags) const 5572 const RenderLayer* rootLayer = root(); 5573 return pixelSnappedForPainting(boundingBox(rootLayer, offsetFromAncestor(rootLayer)), renderer().document().deviceScaleFactor()); 5574 } 5575 5576 LayoutRect RenderLayer::calculateLayerBounds(const RenderLayer* ancestorLayer, const LayoutSize& offsetFromRoot, CalculateLayerBoundsFlags flags) const 5585 5577 { 5586 5578 if (!isSelfPaintingLayer()) … … 5633 5625 if (RenderLayer* reflection = reflectionLayer()) { 5634 5626 if (!reflection->isComposited()) { 5635 LayoutRect childUnionBounds = reflection->calculateLayerBounds(this, nullptr, descendantFlags);5627 LayoutRect childUnionBounds = reflection->calculateLayerBounds(this, reflection->offsetFromAncestor(this), descendantFlags); 5636 5628 unionBounds.unite(childUnionBounds); 5637 5629 } … … 5649 5641 RenderLayer* curLayer = negZOrderList->at(i); 5650 5642 if (flags & IncludeCompositedDescendants || !curLayer->isComposited()) { 5651 LayoutRect childUnionBounds = curLayer->calculateLayerBounds(this, nullptr, descendantFlags);5643 LayoutRect childUnionBounds = curLayer->calculateLayerBounds(this, curLayer->offsetFromAncestor(this), descendantFlags); 5652 5644 unionBounds.unite(childUnionBounds); 5653 5645 } … … 5661 5653 // The RenderNamedFlowThread is ignored when we calculate the bounds of the RenderView. 5662 5654 if ((flags & IncludeCompositedDescendants || !curLayer->isComposited()) && !curLayer->isFlowThreadCollectingGraphicsLayersUnderRegions()) { 5663 LayoutRect childUnionBounds = curLayer->calculateLayerBounds(this, nullptr, descendantFlags);5655 LayoutRect childUnionBounds = curLayer->calculateLayerBounds(this, curLayer->offsetFromAncestor(this), descendantFlags); 5664 5656 unionBounds.unite(childUnionBounds); 5665 5657 } … … 5675 5667 ASSERT(!curLayer->isFlowThreadCollectingGraphicsLayersUnderRegions()); 5676 5668 if (flags & IncludeCompositedDescendants || !curLayer->isComposited()) { 5677 LayoutRect curAbsBounds = curLayer->calculateLayerBounds(this, nullptr, descendantFlags);5669 LayoutRect curAbsBounds = curLayer->calculateLayerBounds(this, curLayer->offsetFromAncestor(this), descendantFlags); 5678 5670 unionBounds.unite(curAbsBounds); 5679 5671 } … … 5694 5686 unionBounds = affineTrans->mapRect(unionBounds); 5695 5687 } 5696 5697 LayoutSize offsetFromAncestor; 5698 if (offsetFromRoot) 5699 offsetFromAncestor = *offsetFromRoot; 5700 else 5701 offsetFromAncestor = this->offsetFromAncestor(ancestorLayer); 5702 unionBounds.move(offsetFromAncestor); 5703 5688 unionBounds.move(offsetFromRoot); 5704 5689 return unionBounds; 5705 5690 } -
trunk/Source/WebCore/rendering/RenderLayer.h
r170273 r170282 701 701 // Pass offsetFromRoot if known. 702 702 void calculateRects(const ClipRectsContext&, const LayoutRect& paintDirtyRect, LayoutRect& layerBounds, 703 ClipRect& backgroundRect, ClipRect& foregroundRect, ClipRect& outlineRect, const LayoutSize * offsetFromRoot = nullptr) const;703 ClipRect& backgroundRect, ClipRect& foregroundRect, ClipRect& outlineRect, const LayoutSize& offsetFromRoot) const; 704 704 705 705 // Compute and cache clip rects computed with the given layer as the root … … 720 720 721 721 // Pass offsetFromRoot if known. 722 bool intersectsDamageRect(const LayoutRect& layerBounds, const LayoutRect& damageRect, const RenderLayer* rootLayer, const LayoutSize * offsetFromRoot = nullptr, const LayoutRect* cachedBoundingBox = nullptr) const;722 bool intersectsDamageRect(const LayoutRect& layerBounds, const LayoutRect& damageRect, const RenderLayer* rootLayer, const LayoutSize& offsetFromRoot, const LayoutRect* cachedBoundingBox = nullptr) const; 723 723 724 724 enum CalculateLayerBoundsFlag { … … 736 736 737 737 // Bounding box relative to some ancestor layer. Pass offsetFromRoot if known. 738 LayoutRect boundingBox(const RenderLayer* rootLayer, CalculateLayerBoundsFlags = 0, const LayoutSize* offsetFromRoot = nullptr) const;738 LayoutRect boundingBox(const RenderLayer* rootLayer, const LayoutSize& offsetFromRoot = LayoutSize(), CalculateLayerBoundsFlags = 0) const; 739 739 // Bounding box in the coordinates of this layer. 740 740 LayoutRect localBoundingBox(CalculateLayerBoundsFlags = 0) const; … … 745 745 746 746 // Bounds used for layer overlap testing in RenderLayerCompositor. 747 LayoutRect overlapBounds() const { return overlapBoundsIncludeChildren() ? calculateLayerBounds(this ) : localBoundingBox(); }747 LayoutRect overlapBounds() const { return overlapBoundsIncludeChildren() ? calculateLayerBounds(this, LayoutSize()) : localBoundingBox(); } 748 748 749 749 #if ENABLE(CSS_FILTERS) … … 756 756 757 757 // Can pass offsetFromRoot if known. 758 LayoutRect calculateLayerBounds(const RenderLayer* ancestorLayer, const LayoutSize * offsetFromRoot = nullptr, CalculateLayerBoundsFlags = DefaultCalculateLayerBoundsFlags) const;758 LayoutRect calculateLayerBounds(const RenderLayer* ancestorLayer, const LayoutSize& offsetFromRoot, CalculateLayerBoundsFlags = DefaultCalculateLayerBoundsFlags) const; 759 759 760 760 // Return a cached repaint rect, computed relative to the layer renderer's containerForRepaint. … … 1002 1002 void collectFragments(LayerFragments&, const RenderLayer* rootLayer, const LayoutRect& dirtyRect, 1003 1003 PaginationInclusionMode, 1004 ClipRectsType, OverlayScrollbarSizeRelevancy inOverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize,1005 ShouldRespectOverflowClip = RespectOverflowClip, const LayoutSize* offsetFromRoot = nullptr,const LayoutRect* layerBoundingBox = nullptr, ShouldApplyRootOffsetToFragments = IgnoreRootOffsetForFragments);1006 void updatePaintingInfoForFragments(LayerFragments&, const LayerPaintingInfo&, PaintLayerFlags, bool shouldPaintContent, const LayoutSize *offsetFromRoot);1004 ClipRectsType, OverlayScrollbarSizeRelevancy inOverlayScrollbarSizeRelevancy, ShouldRespectOverflowClip, const LayoutSize& offsetFromRoot, 1005 const LayoutRect* layerBoundingBox = nullptr, ShouldApplyRootOffsetToFragments = IgnoreRootOffsetForFragments); 1006 void updatePaintingInfoForFragments(LayerFragments&, const LayerPaintingInfo&, PaintLayerFlags, bool shouldPaintContent, const LayoutSize& offsetFromRoot); 1007 1007 void paintBackgroundForFragments(const LayerFragments&, GraphicsContext*, GraphicsContext* transparencyLayerContext, 1008 1008 const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, const LayerPaintingInfo&, PaintBehavior, RenderObject* paintingRootForRenderer); -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r170220 r170282 976 976 if (!canBeComposited(layer)) 977 977 return LayoutRect(); 978 return layer.calculateLayerBounds(&ancestorLayer, nullptr, RenderLayer::DefaultCalculateLayerBoundsFlags | RenderLayer::ExcludeHiddenDescendants | RenderLayer::DontConstrainForMask);978 return layer.calculateLayerBounds(&ancestorLayer, layer.offsetFromAncestor(&ancestorLayer), RenderLayer::DefaultCalculateLayerBoundsFlags | RenderLayer::ExcludeHiddenDescendants | RenderLayer::DontConstrainForMask); 979 979 } 980 980 … … 2651 2651 // Fixed position elements that are invisible in the current view don't get their own layer. 2652 2652 LayoutRect viewBounds = m_renderView.frameView().viewportConstrainedVisibleContentRect(); 2653 LayoutRect layerBounds = layer.calculateLayerBounds(&layer, 0, RenderLayer::UseLocalClipRectIfPossible | RenderLayer::IncludeLayerFilterOutsets | RenderLayer::UseFragmentBoxesExcludingCompositing2653 LayoutRect layerBounds = layer.calculateLayerBounds(&layer, LayoutSize(), RenderLayer::UseLocalClipRectIfPossible | RenderLayer::IncludeLayerFilterOutsets | RenderLayer::UseFragmentBoxesExcludingCompositing 2654 2654 | RenderLayer::ExcludeHiddenDescendants | RenderLayer::DontConstrainForMask | RenderLayer::IncludeCompositedDescendants); 2655 2655 // Map to m_renderView to ignore page scale. -
trunk/Source/WebCore/rendering/RenderTreeAsText.cpp
r168967 r170282 742 742 LayoutRect layerBounds; 743 743 ClipRect damageRect, clipRectToApply, outlineRect; 744 l->calculateRects(RenderLayer::ClipRectsContext(rootLayer, TemporaryClipRects), paintDirtyRect, layerBounds, damageRect, clipRectToApply, outlineRect );744 l->calculateRects(RenderLayer::ClipRectsContext(rootLayer, TemporaryClipRects), paintDirtyRect, layerBounds, damageRect, clipRectToApply, outlineRect, l->offsetFromAncestor(rootLayer)); 745 745 746 746 // Ensure our lists are up-to-date. 747 747 l->updateLayerListsIfNeeded(); 748 748 749 bool shouldPaint = (behavior & RenderAsTextShowAllLayers) ? true : l->intersectsDamageRect(layerBounds, damageRect.rect(), rootLayer );749 bool shouldPaint = (behavior & RenderAsTextShowAllLayers) ? true : l->intersectsDamageRect(layerBounds, damageRect.rect(), rootLayer, l->offsetFromAncestor(rootLayer)); 750 750 Vector<RenderLayer*>* negList = l->negZOrderList(); 751 751 bool paintsBackgroundSeparately = negList && negList->size() > 0;
Note:
See TracChangeset
for help on using the changeset viewer.