Changeset 201040 in webkit
- Timestamp:
- May 17, 2016 2:02:01 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r201038 r201040 1 2016-05-17 Dave Hyatt <hyatt@apple.com> 2 3 Optimize layer repaint rect computation and painting. 4 https://bugs.webkit.org/show_bug.cgi?id=157631 5 6 Reviewed by Zalan Bujtas. 7 8 This patch changes the computation of repaint rects to be for self-painting layers 9 only. In addition, hasBoxDecorations() has been changed to hasVisibleBoxDecorations(), 10 and it will no longer be set for transparent borders. 11 12 For scrolling layer position updating, visually empty layers have their repaint rects 13 cleared, and we don't compute repaint rects during the scroll. We would like to do this 14 all the time, but computeRepaintRects can be called at times when the visually empty 15 state is stale/unknown. For now we limit it to scrolling, since we know that the layer's 16 visually empty state is correct. 17 18 * rendering/InlineFlowBox.cpp: 19 (WebCore::InlineFlowBox::paintBoxDecorations): 20 * rendering/RenderBlock.cpp: 21 (WebCore::RenderBlock::paintObject): 22 * rendering/RenderBlockLineLayout.cpp: 23 (WebCore::RenderBlockFlow::layoutRunsAndFloats): 24 * rendering/RenderBox.cpp: 25 (WebCore::RenderBox::updateFromStyle): 26 (WebCore::RenderBox::paintBoxDecorations): 27 * rendering/RenderBoxModelObject.cpp: 28 (WebCore::RenderBoxModelObject::willBeDestroyed): 29 (WebCore::RenderBoxModelObject::hasVisibleBoxDecorationStyle): 30 (WebCore::RenderBoxModelObject::updateFromStyle): 31 (WebCore::RenderBoxModelObject::hasBoxDecorationStyle): Deleted. 32 * rendering/RenderBoxModelObject.h: 33 * rendering/RenderElement.cpp: 34 (WebCore::RenderElement::styleWillChange): 35 (WebCore::mustRepaintBackgroundOrBorder): 36 * rendering/RenderImage.cpp: 37 (WebCore::RenderImage::imageChanged): 38 * rendering/RenderInline.cpp: 39 (WebCore::RenderInline::styleDidChange): 40 * rendering/RenderLayer.cpp: 41 (WebCore::RenderLayer::RenderLayer): 42 (WebCore::RenderLayer::updateLayerPositions): 43 (WebCore::RenderLayer::repaintRectIncludingNonCompositingDescendants): 44 (WebCore::RenderLayer::computeRepaintRects): 45 (WebCore::RenderLayer::clearRepaintRects): 46 (WebCore::RenderLayer::updateLayerPositionsAfterScroll): 47 (WebCore::RenderLayer::scrollTo): 48 (WebCore::RenderLayer::calculateClipRects): 49 * rendering/RenderLayer.h: 50 * rendering/RenderLayerBacking.cpp: 51 (WebCore::RenderLayerBacking::updateDrawsContent): 52 (WebCore::RenderLayerBacking::compositingOpacity): 53 (WebCore::hasVisibleBoxDecorations): 54 (WebCore::canCreateTiledImage): 55 (WebCore::hasVisibleBoxDecorationsOrBackgroundImage): 56 (WebCore::supportsDirectBoxDecorationsComposition): 57 (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer): 58 (WebCore::RenderLayerBacking::containsPaintedContent): 59 (WebCore::RenderLayerBacking::isDirectlyCompositedImage): 60 (WebCore::hasBoxDecorations): Deleted. 61 (WebCore::hasBoxDecorationsOrBackgroundImage): Deleted. 62 * rendering/RenderLayerModelObject.cpp: 63 (WebCore::RenderLayerModelObject::styleDidChange): 64 * rendering/RenderNamedFlowFragment.cpp: 65 (WebCore::RenderNamedFlowFragment::setObjectStyleInRegion): 66 * rendering/RenderObject.h: 67 (WebCore::RenderObject::hasVisibleBoxDecorations): 68 (WebCore::RenderObject::setFloating): 69 (WebCore::RenderObject::setInline): 70 (WebCore::RenderObject::computeBackgroundIsKnownToBeObscured): 71 (WebCore::RenderObject::setSelectionStateIfNeeded): 72 (WebCore::RenderObject::setHasVisibleBoxDecorations): 73 (WebCore::RenderObject::invalidateBackgroundObscurationStatus): 74 (WebCore::RenderObject::hasBoxDecorations): Deleted. 75 (WebCore::RenderObject::setHasBoxDecorations): Deleted. 76 * rendering/RenderReplaced.cpp: 77 (WebCore::RenderReplaced::paint): 78 * rendering/RenderTable.cpp: 79 (WebCore::RenderTable::paintObject): 80 (WebCore::RenderTable::paintBoxDecorations): 81 * rendering/RenderTableCell.cpp: 82 (WebCore::RenderTableCell::styleDidChange): 83 * rendering/RenderWidget.cpp: 84 (WebCore::RenderWidget::paint): 85 * rendering/style/BorderData.h: 86 (WebCore::BorderData::hasBorder): 87 (WebCore::BorderData::hasVisibleBorder): 88 (WebCore::BorderData::hasFill): 89 (WebCore::BorderData::hasBorderRadius): 90 * rendering/style/RenderStyle.h: 91 * rendering/svg/RenderSVGRoot.cpp: 92 (WebCore::RenderSVGRoot::layout): 93 (WebCore::RenderSVGRoot::styleDidChange): 94 1 95 2016-05-17 Filip Pizlo <fpizlo@apple.com> 2 96 -
trunk/Source/WebCore/rendering/InlineFlowBox.cpp
r200098 r201040 1367 1367 // You can use p::first-line to specify a background. If so, the root line boxes for 1368 1368 // a line may actually have to paint a background. 1369 if (parent() && !renderer().has BoxDecorations())1369 if (parent() && !renderer().hasVisibleBoxDecorations()) 1370 1370 return; 1371 1371 const RenderStyle& lineStyle = this->lineStyle(); … … 1386 1386 // :first-line cannot be used to put borders on a line. Always paint borders with our 1387 1387 // non-first-line style. 1388 if (!parent() || !renderer().style().has BorderDecoration())1388 if (!parent() || !renderer().style().hasVisibleBorderDecoration()) 1389 1389 return; 1390 1390 const NinePieceImage& borderImage = renderer().style().borderImage(); -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r200736 r201040 1540 1540 // 1. paint background, borders etc 1541 1541 if ((paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChildBlockBackground) && style().visibility() == VISIBLE) { 1542 if (has BoxDecorations()) {1542 if (hasVisibleBoxDecorations()) { 1543 1543 bool didClipToRegion = false; 1544 1544 -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r200220 r201040 1260 1260 if (layoutState.isFullLayout() && hasInlineChild && !selfNeedsLayout()) { 1261 1261 setNeedsLayout(MarkOnlyThis); // Mark as needing a full layout to force us to repaint. 1262 if (!view().doingFullRepaint() && has Layer()) {1262 if (!view().doingFullRepaint() && hasSelfPaintingLayer() && layer()->hasComputedRepaintRect()) { 1263 1263 // Because we waited until we were already inside layout to discover 1264 1264 // that the block really needed a full layout, we missed our chance to repaint the layer -
trunk/Source/WebCore/rendering/RenderBox.cpp
r200931 r201040 495 495 // The root and the RenderView always paint their backgrounds/borders. 496 496 if (isDocElementRenderer || isViewObject) 497 setHas BoxDecorations(true);497 setHasVisibleBoxDecorations(true); 498 498 499 499 setFloating(!isOutOfFlowPositioned() && styleToUse.isFloating()); … … 1370 1370 1371 1371 // The theme will tell us whether or not we should also paint the CSS border. 1372 if (bleedAvoidance != BackgroundBleedBackgroundOverBorder && (!style().hasAppearance() || (borderOrBackgroundPaintingIsNeeded && theme().paintBorderOnly(*this, paintInfo, paintRect))) && style().has BorderDecoration())1372 if (bleedAvoidance != BackgroundBleedBackgroundOverBorder && (!style().hasAppearance() || (borderOrBackgroundPaintingIsNeeded && theme().paintBorderOnly(*this, paintInfo, paintRect))) && style().hasVisibleBorderDecoration()) 1373 1373 paintBorder(paintInfo, paintRect, style(), bleedAvoidance); 1374 1374 -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r200671 r201040 194 194 } 195 195 196 bool RenderBoxModelObject::has BoxDecorationStyle() const197 { 198 return hasBackground() || style().has BorderDecoration() || style().hasAppearance() || style().boxShadow();196 bool RenderBoxModelObject::hasVisibleBoxDecorationStyle() const 197 { 198 return hasBackground() || style().hasVisibleBorderDecoration() || style().hasAppearance() || style().boxShadow(); 199 199 } 200 200 … … 206 206 // we only check for bits that could possibly be set to true. 207 207 const RenderStyle& styleToUse = style(); 208 setHas BoxDecorations(hasBoxDecorationStyle());208 setHasVisibleBoxDecorations(hasVisibleBoxDecorationStyle()); 209 209 setInline(styleToUse.isDisplayInlineType()); 210 210 setPositionState(styleToUse.position()); -
trunk/Source/WebCore/rendering/RenderBoxModelObject.h
r200041 r201040 246 246 LayoutPoint adjustedPositionRelativeToOffsetParent(const LayoutPoint&) const; 247 247 248 bool has BoxDecorationStyle() const;248 bool hasVisibleBoxDecorationStyle() const; 249 249 BackgroundImageGeometry calculateBackgroundImageGeometry(const RenderLayerModelObject* paintContainer, const FillLayer&, const LayoutPoint& paintOffset, 250 250 const LayoutRect& paintRect, RenderElement* = nullptr) const; -
trunk/Source/WebCore/rendering/RenderElement.cpp
r200953 r201040 861 861 } 862 862 setHorizontalWritingMode(true); 863 setHas BoxDecorations(false);863 setHasVisibleBoxDecorations(false); 864 864 setHasOverflowClip(false); 865 865 setHasTransformRelatedProperty(false); … … 1258 1258 1259 1259 // If we don't have a background/border/mask, then nothing to do. 1260 if (!renderer.has BoxDecorations())1260 if (!renderer.hasVisibleBoxDecorations()) 1261 1261 return false; 1262 1262 -
trunk/Source/WebCore/rendering/RenderImage.cpp
r200486 r201040 226 226 return; 227 227 228 if (has BoxDecorations() || hasMask() || hasShapeOutside())228 if (hasVisibleBoxDecorations() || hasMask() || hasShapeOutside()) 229 229 RenderReplaced::imageChanged(newImage, rect); 230 230 -
trunk/Source/WebCore/rendering/RenderInline.cpp
r200953 r201040 205 205 206 206 if (!alwaysCreateLineBoxes()) { 207 bool alwaysCreateLineBoxes = hasSelfPaintingLayer() || has BoxDecorations() || newStyle.hasPadding() || newStyle.hasMargin() || hasOutline();207 bool alwaysCreateLineBoxes = hasSelfPaintingLayer() || hasVisibleBoxDecorations() || newStyle.hasBorder() || newStyle.hasPadding() || newStyle.hasMargin() || hasOutline(); 208 208 if (oldStyle && alwaysCreateLineBoxes) { 209 209 dirtyLineBoxes(false); -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r200915 r201040 306 306 #endif 307 307 , m_hasFilterInfo(false) 308 , m_hasComputedRepaintRect(false) 308 309 #if ENABLE(CSS_COMPOSITING) 309 310 , m_blendMode(BlendModeNormal) … … 510 511 // FIXME: Should ASSERT that value calculated for m_outlineBox using the cached offset is the same 511 512 // as the value not using the cached offset, but we can't due to https://bugs.webkit.org/show_bug.cgi?id=37048 512 if ( flags & CheckForRepaint) {513 if ((flags & CheckForRepaint) && m_hasComputedRepaintRect) { 513 514 if (!renderer().view().printing()) { 514 515 bool didRepaint = false; … … 595 596 continue; 596 597 597 repaintRect.unite (child->repaintRectIncludingNonCompositingDescendants());598 repaintRect.uniteIfNonZero(child->repaintRectIncludingNonCompositingDescendants()); 598 599 } 599 600 return repaintRect; … … 786 787 ASSERT(!m_visibleContentStatusDirty); 787 788 789 if (!isSelfPaintingLayer()) { 790 clearRepaintRects(); 791 return; 792 } 793 794 m_hasComputedRepaintRect = true; 788 795 m_repaintRect = renderer().clippedOverflowRectForRepaint(repaintContainer); 789 796 m_outlineBox = renderer().outlineBoundsForRepaint(repaintContainer, geometryMap); … … 804 811 void RenderLayer::clearRepaintRects() 805 812 { 806 ASSERT(!m_hasVisibleContent);807 813 ASSERT(!m_visibleContentStatusDirty); 808 814 815 m_hasComputedRepaintRect = false; 809 816 m_repaintRect = LayoutRect(); 810 817 m_outlineBox = LayoutRect(); … … 846 853 flags |= HasChangedAncestor; 847 854 848 if (geometryMap)849 geometryMap->pushMappingsToAncestor(this, parent());850 851 855 if (flags & HasChangedAncestor || flags & HasSeenViewportConstrainedAncestor || flags & IsOverflowScroll) 852 856 clearClipRects(); … … 857 861 if (renderer().hasOverflowClip()) 858 862 flags |= HasSeenAncestorWithOverflowClip; 859 860 if (flags & HasSeenViewportConstrainedAncestor 861 || (flags & IsOverflowScroll && flags & HasSeenAncestorWithOverflowClip)) { 862 // FIXME: We could track the repaint container as we walk down the tree. 863 computeRepaintRects(renderer().containerForRepaint(), geometryMap); 863 864 bool shouldComputeRepaintRects = (flags & HasSeenViewportConstrainedAncestor || (flags & IsOverflowScroll && flags & HasSeenAncestorWithOverflowClip)) && isSelfPaintingLayer(); 865 bool isVisuallyEmpty = !isVisuallyNonEmpty(); 866 bool shouldPushAndPopMappings = geometryMap && ((shouldComputeRepaintRects && !isVisuallyEmpty) || firstChild()); 867 if (shouldPushAndPopMappings) 868 geometryMap->pushMappingsToAncestor(this, parent()); 869 870 if (shouldComputeRepaintRects) { 871 // When scrolling, we don't compute repaint rects for visually non-empty layers. 872 if (isVisuallyEmpty) 873 clearRepaintRects(); 874 else // FIXME: We could track the repaint container as we walk down the tree. 875 computeRepaintRects(renderer().containerForRepaint(), geometryMap); 864 876 } else { 865 877 // Check that our cached rects are correct. 866 ASSERT( m_repaintRect == renderer().clippedOverflowRectForRepaint(renderer().containerForRepaint()));867 ASSERT( m_outlineBox == renderer().outlineBoundsForRepaint(renderer().containerForRepaint(), geometryMap));878 ASSERT(!m_hasComputedRepaintRect || (m_repaintRect == renderer().clippedOverflowRectForRepaint(renderer().containerForRepaint()))); 879 ASSERT(!m_hasComputedRepaintRect || m_outlineBox == renderer().outlineBoundsForRepaint(renderer().containerForRepaint())); 868 880 } 869 881 … … 882 894 } 883 895 884 if ( geometryMap)896 if (shouldPushAndPopMappings) 885 897 geometryMap->popMappingsToAncestor(parent()); 886 898 … … 2412 2424 // The caret rect needs to be invalidated after scrolling 2413 2425 frame.selection().setCaretRectNeedsUpdate(); 2414 2415 FloatQuad quadForFakeMouseMoveEvent = FloatQuad(m_repaintRect); 2426 2427 LayoutRect rectForRepaint = m_hasComputedRepaintRect ? m_repaintRect : renderer().clippedOverflowRectForRepaint(repaintContainer); 2428 2429 FloatQuad quadForFakeMouseMoveEvent = FloatQuad(rectForRepaint); 2416 2430 if (repaintContainer) 2417 2431 quadForFakeMouseMoveEvent = repaintContainer->localToAbsoluteQuad(quadForFakeMouseMoveEvent); … … 2424 2438 // Just schedule a full repaint of our object. 2425 2439 if (requiresRepaint) 2426 renderer().repaintUsingContainer(repaintContainer, m_repaintRect);2440 renderer().repaintUsingContainer(repaintContainer, rectForRepaint); 2427 2441 2428 2442 // Schedule the scroll and scroll-related DOM events. … … 6501 6515 } 6502 6516 6503 static bool has BoxDecorationsOrBackground(const RenderElement& renderer)6504 { 6505 return renderer.has BoxDecorations() || renderer.style().hasOutline();6517 static bool hasVisibleBoxDecorationsOrBackground(const RenderElement& renderer) 6518 { 6519 return renderer.hasVisibleBoxDecorations() || renderer.style().hasOutline(); 6506 6520 } 6507 6521 … … 6534 6548 continue; 6535 6549 6536 if (has BoxDecorationsOrBackground(renderElementChild))6550 if (hasVisibleBoxDecorationsOrBackground(renderElementChild)) 6537 6551 return true; 6538 6552 … … 6552 6566 } 6553 6567 6554 bool RenderLayer::has BoxDecorationsOrBackground() const6555 { 6556 return WebCore::has BoxDecorationsOrBackground(renderer());6568 bool RenderLayer::hasVisibleBoxDecorationsOrBackground() const 6569 { 6570 return WebCore::hasVisibleBoxDecorationsOrBackground(renderer()); 6557 6571 } 6558 6572 … … 6562 6576 return false; 6563 6577 6564 return has BoxDecorationsOrBackground() || hasOverflowControls();6578 return hasVisibleBoxDecorationsOrBackground() || hasOverflowControls(); 6565 6579 } 6566 6580 … … 6575 6589 return true; 6576 6590 6577 if (has BoxDecorationsOrBackground())6591 if (hasVisibleBoxDecorationsOrBackground()) 6578 6592 return true; 6579 6593 -
trunk/Source/WebCore/rendering/RenderLayer.h
r200915 r201040 387 387 void dirtyVisibleContentStatus(); 388 388 389 bool has BoxDecorationsOrBackground() const;389 bool hasVisibleBoxDecorationsOrBackground() const; 390 390 bool hasVisibleBoxDecorations() const; 391 391 // Returns true if this layer has visible content (ignoring any child layers). … … 539 539 540 540 // Return a cached repaint rect, computed relative to the layer renderer's containerForRepaint. 541 LayoutRect repaintRect() const { return m_repaintRect; } 541 bool hasComputedRepaintRect() const { return m_hasComputedRepaintRect; } 542 LayoutRect repaintRect() const { ASSERT(hasComputedRepaintRect()); return m_repaintRect; } 542 543 LayoutRect repaintRectIncludingNonCompositingDescendants() const; 543 544 … … 1069 1070 1070 1071 bool m_hasFilterInfo : 1; 1072 1073 bool m_hasComputedRepaintRect : 1; 1071 1074 1072 1075 #if ENABLE(CSS_COMPOSITING) -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r200671 r201040 1230 1230 // m_scrollingLayer never has backing store. 1231 1231 // m_scrollingContentsLayer only needs backing store if the scrolled contents need to paint. 1232 bool hasNonScrollingPaintedContent = m_owningLayer.hasVisibleContent() && m_owningLayer.has BoxDecorationsOrBackground();1232 bool hasNonScrollingPaintedContent = m_owningLayer.hasVisibleContent() && m_owningLayer.hasVisibleBoxDecorationsOrBackground(); 1233 1233 m_graphicsLayer->setDrawsContent(hasNonScrollingPaintedContent); 1234 1234 … … 1676 1676 1677 1677 // FIXME: Code is duplicated in RenderLayer. Also, we should probably not consider filters a box decoration here. 1678 static inline bool has BoxDecorations(const RenderStyle& style)1679 { 1680 return style.has Border() || style.hasBorderRadius() || style.hasOutline() || style.hasAppearance() || style.boxShadow() || style.hasFilter();1678 static inline bool hasVisibleBoxDecorations(const RenderStyle& style) 1679 { 1680 return style.hasVisibleBorder() || style.hasBorderRadius() || style.hasOutline() || style.hasAppearance() || style.boxShadow() || style.hasFilter(); 1681 1681 } 1682 1682 … … 1713 1713 } 1714 1714 1715 static bool has BoxDecorationsOrBackgroundImage(const RenderStyle& style)1716 { 1717 if (has BoxDecorations(style))1715 static bool hasVisibleBoxDecorationsOrBackgroundImage(const RenderStyle& style) 1716 { 1717 if (hasVisibleBoxDecorations(style)) 1718 1718 return true; 1719 1719 … … 1811 1811 return false; 1812 1812 1813 if (has BoxDecorationsOrBackgroundImage(style))1813 if (hasVisibleBoxDecorationsOrBackgroundImage(style)) 1814 1814 return false; 1815 1815 … … 1896 1896 // Reject anything that has a border, a border-radius or outline, 1897 1897 // or is not a simple background (no background, or solid color). 1898 if (has BoxDecorationsOrBackgroundImage(rootObject->style()))1898 if (hasVisibleBoxDecorationsOrBackgroundImage(rootObject->style())) 1899 1899 return false; 1900 1900 … … 1907 1907 return false; 1908 1908 1909 if (has BoxDecorationsOrBackgroundImage(bodyRenderer->style()))1909 if (hasVisibleBoxDecorationsOrBackgroundImage(bodyRenderer->style())) 1910 1910 return false; 1911 1911 } … … 1980 1980 #if ENABLE(VIDEO) 1981 1981 if (is<RenderVideo>(renderer()) && downcast<RenderVideo>(renderer()).shouldDisplayVideo()) 1982 return m_owningLayer.has BoxDecorationsOrBackground() || (!(downcast<RenderVideo>(renderer()).supportsAcceleratedRendering()) && m_requiresOwnBackingStore);1982 return m_owningLayer.hasVisibleBoxDecorationsOrBackground() || (!(downcast<RenderVideo>(renderer()).supportsAcceleratedRendering()) && m_requiresOwnBackingStore); 1983 1983 #endif 1984 1984 1985 1985 #if ENABLE(WEBGL) || ENABLE(ACCELERATED_2D_CANVAS) 1986 1986 if (is<RenderHTMLCanvas>(renderer()) && canvasCompositingStrategy(renderer()) == CanvasAsLayerContents) 1987 return m_owningLayer.has BoxDecorationsOrBackground();1987 return m_owningLayer.hasVisibleBoxDecorationsOrBackground(); 1988 1988 #endif 1989 1989 … … 1995 1995 bool RenderLayerBacking::isDirectlyCompositedImage() const 1996 1996 { 1997 if (!is<RenderImage>(renderer()) || m_owningLayer.has BoxDecorationsOrBackground() || m_owningLayer.paintsWithFilters() || renderer().hasClip())1997 if (!is<RenderImage>(renderer()) || m_owningLayer.hasVisibleBoxDecorationsOrBackground() || m_owningLayer.paintsWithFilters() || renderer().hasClip()) 1998 1998 return false; 1999 1999 -
trunk/Source/WebCore/rendering/RenderLayerModelObject.cpp
r200116 r201040 162 162 setHasReflection(false); 163 163 // Repaint the about to be destroyed self-painting layer when style change also triggers repaint. 164 if (layer()->isSelfPaintingLayer() && layer()->repaintStatus() == NeedsFullRepaint )164 if (layer()->isSelfPaintingLayer() && layer()->repaintStatus() == NeedsFullRepaint && layer()->hasComputedRepaintRect()) 165 165 repaintUsingContainer(containerForRepaint(), layer()->repaintRect()); 166 166 layer()->removeOnlyThisLayer(); // calls destroyLayer() which clears m_layer -
trunk/Source/WebCore/rendering/RenderNamedFlowFragment.cpp
r200098 r201040 393 393 downcast<RenderElement>(*object).setStyleInternal(WTFMove(*styleInRegion)); 394 394 395 if (is<RenderBoxModelObject>(*object) && !object->has BoxDecorations()) {396 bool has BoxDecorations = is<RenderTableCell>(*object)395 if (is<RenderBoxModelObject>(*object) && !object->hasVisibleBoxDecorations()) { 396 bool hasVisibleBoxDecorations = is<RenderTableCell>(*object) 397 397 || object->style().hasBackground() 398 || object->style().has Border()398 || object->style().hasVisibleBorder() 399 399 || object->style().hasAppearance() 400 400 || object->style().boxShadow(); 401 object->setHas BoxDecorations(hasBoxDecorations);401 object->setHasVisibleBoxDecorations(hasVisibleBoxDecorations); 402 402 } 403 403 -
trunk/Source/WebCore/rendering/RenderObject.h
r200953 r201040 519 519 HasBoxDecorationsAndBackgroundMayBeVisible, 520 520 }; 521 bool has BoxDecorations() const { return m_bitfields.boxDecorationState() != NoBoxDecorations; }521 bool hasVisibleBoxDecorations() const { return m_bitfields.boxDecorationState() != NoBoxDecorations; } 522 522 bool backgroundIsKnownToBeObscured(const LayoutPoint& paintOffset); 523 523 bool hasEntirelyFixedBackground() const; … … 602 602 void setInline(bool b = true) { m_bitfields.setIsInline(b); } 603 603 604 void setHas BoxDecorations(bool = true);604 void setHasVisibleBoxDecorations(bool = true); 605 605 void invalidateBackgroundObscurationStatus(); 606 606 virtual bool computeBackgroundIsKnownToBeObscured(const LayoutPoint&) { return false; } … … 1126 1126 } 1127 1127 1128 inline void RenderObject::setHas BoxDecorations(bool b)1128 inline void RenderObject::setHasVisibleBoxDecorations(bool b) 1129 1129 { 1130 1130 if (!b) { … … 1132 1132 return; 1133 1133 } 1134 if (has BoxDecorations())1134 if (hasVisibleBoxDecorations()) 1135 1135 return; 1136 1136 m_bitfields.setBoxDecorationState(HasBoxDecorationsAndBackgroundObscurationStatusInvalid); … … 1139 1139 inline void RenderObject::invalidateBackgroundObscurationStatus() 1140 1140 { 1141 if (!has BoxDecorations())1141 if (!hasVisibleBoxDecorations()) 1142 1142 return; 1143 1143 m_bitfields.setBoxDecorationState(HasBoxDecorationsAndBackgroundObscurationStatusInvalid); -
trunk/Source/WebCore/rendering/RenderReplaced.cpp
r200486 r201040 146 146 LayoutPoint adjustedPaintOffset = paintOffset + location(); 147 147 148 if (has BoxDecorations() && paintInfo.phase == PaintPhaseForeground)148 if (hasVisibleBoxDecorations() && paintInfo.phase == PaintPhaseForeground) 149 149 paintBoxDecorations(paintInfo, adjustedPaintOffset); 150 150 -
trunk/Source/WebCore/rendering/RenderTable.cpp
r200098 r201040 690 690 { 691 691 PaintPhase paintPhase = paintInfo.phase; 692 if ((paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChildBlockBackground) && has BoxDecorations() && style().visibility() == VISIBLE)692 if ((paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChildBlockBackground) && hasVisibleBoxDecorations() && style().visibility() == VISIBLE) 693 693 paintBoxDecorations(paintInfo, paintOffset); 694 694 … … 769 769 paintBoxShadow(paintInfo, rect, style(), Inset); 770 770 771 if (style().has BorderDecoration() && !collapseBorders())771 if (style().hasVisibleBorderDecoration() && !collapseBorders()) 772 772 paintBorder(paintInfo, rect, style()); 773 773 } -
trunk/Source/WebCore/rendering/RenderTableCell.cpp
r200041 r201040 411 411 412 412 RenderBlockFlow::styleDidChange(diff, oldStyle); 413 setHas BoxDecorations(true);413 setHasVisibleBoxDecorations(true); // FIXME: Optimize this to only set to true if necessary. 414 414 415 415 if (parent() && section() && oldStyle && style().height() != oldStyle->height()) -
trunk/Source/WebCore/rendering/RenderWidget.cpp
r200041 r201040 255 255 LayoutPoint adjustedPaintOffset = paintOffset + location(); 256 256 257 if (has BoxDecorations() && (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection))257 if (hasVisibleBoxDecorations() && (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection)) 258 258 paintBoxDecorations(paintInfo, adjustedPaintOffset); 259 259 -
trunk/Source/WebCore/rendering/style/BorderData.h
r192970 r201040 47 47 return m_left.nonZero(!haveImage) || m_right.nonZero(!haveImage) || m_top.nonZero(!haveImage) || m_bottom.nonZero(!haveImage); 48 48 } 49 50 bool hasVisibleBorder() const 51 { 52 bool haveImage = m_image.hasImage(); 53 return m_left.isVisible(!haveImage) || m_right.isVisible(!haveImage) || m_top.isVisible(!haveImage) || m_bottom.isVisible(!haveImage); 54 } 49 55 50 56 bool hasFill() const … … 52 58 return m_image.hasImage() && m_image.fill(); 53 59 } 54 60 55 61 bool hasBorderRadius() const 56 62 { -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r200660 r201040 555 555 bool hasBorder() const { return surround->border.hasBorder(); } 556 556 bool hasBorderFill() const { return surround->border.hasFill(); } 557 bool hasBorderDecoration() const { return hasBorder() || hasBorderFill(); } 557 bool hasVisibleBorderDecoration() const { return hasVisibleBorder() || hasBorderFill(); } 558 bool hasVisibleBorder() const { return surround->border.hasVisibleBorder(); } 558 559 bool hasPadding() const { return !surround->padding.isZero(); } 559 560 bool hasOffset() const { return !surround->offset.isZero(); } -
trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp
r200041 r201040 205 205 206 206 updateLayerTransform(); 207 m_hasBoxDecorations = isDocumentElementRenderer() ? has BoxDecorationStyle() : hasBoxDecorations();207 m_hasBoxDecorations = isDocumentElementRenderer() ? hasVisibleBoxDecorationStyle() : hasVisibleBoxDecorations(); 208 208 invalidateBackgroundObscurationStatus(); 209 209 … … 306 306 // Box decorations may have appeared/disappeared - recompute status. 307 307 if (diff == StyleDifferenceRepaint) 308 m_hasBoxDecorations = has BoxDecorationStyle();308 m_hasBoxDecorations = hasVisibleBoxDecorationStyle(); 309 309 310 310 RenderReplaced::styleDidChange(diff, oldStyle);
Note: See TracChangeset
for help on using the changeset viewer.