Changeset 89970 in webkit
- Timestamp:
- Jun 28, 2011 3:41:36 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r89969 r89970 1 2011-06-28 Levi Weintraub <leviw@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Switch paintFillLayer* to new layout types 6 https://bugs.webkit.org/show_bug.cgi?id=63570 7 8 Switching painFillLayer* to layout type abstraction from more integral types. 9 10 No new tests as this is just moving to an abstraction. 11 12 * rendering/InlineFlowBox.cpp: 13 (WebCore::InlineFlowBox::paintFillLayers): 14 (WebCore::InlineFlowBox::paintFillLayer): 15 * rendering/InlineFlowBox.h: 16 * rendering/RenderBox.cpp: 17 (WebCore::RenderBox::paintFillLayers): 18 (WebCore::RenderBox::paintFillLayer): 19 * rendering/RenderBox.h: 20 * rendering/RenderBoxModelObject.cpp: 21 (WebCore::RenderBoxModelObject::paintFillLayerExtended): 22 * rendering/RenderBoxModelObject.h: 23 * rendering/RenderObject.h: 24 1 25 2011-06-28 Luke Macpherson <macpherson@chromium.org> 2 26 -
trunk/Source/WebCore/rendering/InlineFlowBox.cpp
r89704 r89970 1017 1017 } 1018 1018 1019 void InlineFlowBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, const IntRect& rect, CompositeOperator op)1019 void InlineFlowBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, const LayoutRect& rect, CompositeOperator op) 1020 1020 { 1021 1021 if (!fillLayer) … … 1025 1025 } 1026 1026 1027 void InlineFlowBox::paintFillLayer(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, const IntRect& rect, CompositeOperator op)1027 void InlineFlowBox::paintFillLayer(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, const LayoutRect& rect, CompositeOperator op) 1028 1028 { 1029 1029 StyleImage* img = fillLayer->image(); … … 1038 1038 // as though you had one single line. This means each line has to pick up the background where 1039 1039 // the previous line left off. 1040 int logicalOffsetOnLine = 0;1041 int totalLogicalWidth;1040 LayoutUnit logicalOffsetOnLine = 0; 1041 LayoutUnit totalLogicalWidth; 1042 1042 if (renderer()->style()->direction() == LTR) { 1043 1043 for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox()) … … 1053 1053 totalLogicalWidth += curr->logicalWidth(); 1054 1054 } 1055 int stripX = rect.x() - (isHorizontal() ? logicalOffsetOnLine : 0);1056 int stripY = rect.y() - (isHorizontal() ? 0 : logicalOffsetOnLine);1057 int stripWidth = isHorizontal() ? totalLogicalWidth : width();1058 int stripHeight = isHorizontal() ? height() : totalLogicalWidth;1055 LayoutUnit stripX = rect.x() - (isHorizontal() ? logicalOffsetOnLine : 0); 1056 LayoutUnit stripY = rect.y() - (isHorizontal() ? 0 : logicalOffsetOnLine); 1057 LayoutUnit stripWidth = isHorizontal() ? totalLogicalWidth : width(); 1058 LayoutUnit stripHeight = isHorizontal() ? height() : totalLogicalWidth; 1059 1059 1060 1060 GraphicsContextStateSaver stateSaver(*paintInfo.context); 1061 paintInfo.context->clip( IntRect(rect.x(), rect.y(), width(), height()));1062 boxModelObject()->paintFillLayerExtended(paintInfo, c, fillLayer, IntRect(stripX, stripY, stripWidth, stripHeight), BackgroundBleedNone, this, rect.size(), op);1061 paintInfo.context->clip(LayoutRect(rect.x(), rect.y(), width(), height())); 1062 boxModelObject()->paintFillLayerExtended(paintInfo, c, fillLayer, LayoutRect(stripX, stripY, stripWidth, stripHeight), BackgroundBleedNone, this, rect.size(), op); 1063 1063 } 1064 1064 } -
trunk/Source/WebCore/rendering/InlineFlowBox.h
r89704 r89970 106 106 virtual void paintBoxDecorations(PaintInfo&, const IntPoint&); 107 107 virtual void paintMask(PaintInfo&, const IntPoint&); 108 void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, const IntRect&, CompositeOperator = CompositeSourceOver);109 void paintFillLayer(const PaintInfo&, const Color&, const FillLayer*, const IntRect&, CompositeOperator = CompositeSourceOver);108 void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, CompositeOperator = CompositeSourceOver); 109 void paintFillLayer(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, CompositeOperator = CompositeSourceOver); 110 110 void paintBoxShadow(GraphicsContext*, RenderStyle*, ShadowStyle, const IntRect&); 111 111 virtual void paint(PaintInfo&, const IntPoint&, int lineTop, int lineBottom); -
trunk/Source/WebCore/rendering/RenderBox.cpp
r89754 r89970 978 978 } 979 979 980 void RenderBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, const IntRect& rect,980 void RenderBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, const LayoutRect& rect, 981 981 BackgroundBleedAvoidance bleedAvoidance, CompositeOperator op, RenderObject* backgroundObject) 982 982 { … … 988 988 } 989 989 990 void RenderBox::paintFillLayer(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, const IntRect& rect,990 void RenderBox::paintFillLayer(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, const LayoutRect& rect, 991 991 BackgroundBleedAvoidance bleedAvoidance, CompositeOperator op, RenderObject* backgroundObject) 992 992 { -
trunk/Source/WebCore/rendering/RenderBox.h
r89754 r89970 418 418 virtual void updateBoxModelInfoFromStyle(); 419 419 420 void paintFillLayer(const PaintInfo&, const Color&, const FillLayer*, const IntRect&, BackgroundBleedAvoidance, CompositeOperator, RenderObject* backgroundObject);421 void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, const IntRect&, BackgroundBleedAvoidance = BackgroundBleedNone, CompositeOperator = CompositeSourceOver, RenderObject* backgroundObject = 0);420 void paintFillLayer(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, BackgroundBleedAvoidance, CompositeOperator, RenderObject* backgroundObject); 421 void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, BackgroundBleedAvoidance = BackgroundBleedNone, CompositeOperator = CompositeSourceOver, RenderObject* backgroundObject = 0); 422 422 423 423 void paintMaskImages(const PaintInfo&, const IntRect&); -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r89475 r89970 590 590 } 591 591 592 void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, const Color& color, const FillLayer* bgLayer, const IntRect& rect,593 BackgroundBleedAvoidance bleedAvoidance, InlineFlowBox* box, const IntSize& boxSize, CompositeOperator op, RenderObject* backgroundObject)592 void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, const Color& color, const FillLayer* bgLayer, const LayoutRect& rect, 593 BackgroundBleedAvoidance bleedAvoidance, InlineFlowBox* box, const LayoutSize& boxSize, CompositeOperator op, RenderObject* backgroundObject) 594 594 { 595 595 GraphicsContext* context = paintInfo.context; … … 647 647 } 648 648 649 int bLeft = includeLeftEdge ? borderLeft() : 0;650 int bRight = includeRightEdge ? borderRight() : 0;651 int pLeft = includeLeftEdge ? paddingLeft() : 0;652 int pRight = includeRightEdge ? paddingRight() : 0;649 LayoutUnit bLeft = includeLeftEdge ? borderLeft() : 0; 650 LayoutUnit bRight = includeRightEdge ? borderRight() : 0; 651 LayoutUnit pLeft = includeLeftEdge ? paddingLeft() : 0; 652 LayoutUnit pRight = includeRightEdge ? paddingRight() : 0; 653 653 654 654 GraphicsContextStateSaver clipWithScrollingStateSaver(*context, clippedWithLocalScrolling); 655 IntRect scrolledPaintRect = rect;655 LayoutRect scrolledPaintRect = rect; 656 656 if (clippedWithLocalScrolling) { 657 657 // Clip to the overflow area. … … 659 659 660 660 // Adjust the paint rect to reflect a scrolled content box with borders at the ends. 661 IntSize offset = layer()->scrolledContentOffset();661 LayoutSize offset = layer()->scrolledContentOffset(); 662 662 scrolledPaintRect.move(-offset); 663 663 scrolledPaintRect.setWidth(bLeft + layer()->scrollWidth() + bRight); … … 669 669 // Clip to the padding or content boxes as necessary. 670 670 bool includePadding = bgLayer->clip() == ContentFillBox; 671 IntRect clipRect = IntRect(scrolledPaintRect.x() + bLeft + (includePadding ? pLeft : 0),671 LayoutRect clipRect = LayoutRect(scrolledPaintRect.x() + bLeft + (includePadding ? pLeft : 0), 672 672 scrolledPaintRect.y() + borderTop() + (includePadding ? paddingTop() : 0), 673 673 scrolledPaintRect.width() - bLeft - bRight - (includePadding ? pLeft + pRight : 0), … … 679 679 // First figure out how big the mask has to be. It should be no bigger than what we need 680 680 // to actually render, so we should intersect the dirty rect with the border box of the background. 681 IntRect maskRect = rect;681 LayoutRect maskRect = rect; 682 682 maskRect.intersect(paintInfo.rect); 683 683 … … 695 695 if (box) { 696 696 RootInlineBox* root = box->root(); 697 box->paint(info, IntPoint(scrolledPaintRect.x() - box->x(), scrolledPaintRect.y() - box->y()), root->lineTop(), root->lineBottom());697 box->paint(info, LayoutPoint(scrolledPaintRect.x() - box->x(), scrolledPaintRect.y() - box->y()), root->lineTop(), root->lineBottom()); 698 698 } else { 699 IntSize localOffset = isBox() ? toRenderBox(this)->locationOffset() : IntSize();699 LayoutSize localOffset = isBox() ? toRenderBox(this)->locationOffset() : LayoutSize(); 700 700 paint(info, scrolledPaintRect.location() - localOffset); 701 701 } … … 739 739 // Paint the color first underneath all images. 740 740 if (!bgLayer->next()) { 741 IntRect backgroundRect(scrolledPaintRect);741 LayoutRect backgroundRect(scrolledPaintRect); 742 742 backgroundRect.intersect(paintInfo.rect); 743 743 // If we have an alpha and we are painting the root element, go ahead and blend with the base background color. … … 764 764 // no progressive loading of the background image 765 765 if (shouldPaintBackgroundImage) { 766 IntRect destRect;767 IntPoint phase;768 IntSize tileSize;766 LayoutRect destRect; 767 LayoutPoint phase; 768 LayoutSize tileSize; 769 769 770 770 calculateBackgroundImageGeometry(bgLayer, scrolledPaintRect, destRect, phase, tileSize); 771 IntPoint destOrigin = destRect.location();771 LayoutPoint destOrigin = destRect.location(); 772 772 destRect.intersect(paintInfo.rect); 773 773 if (!destRect.isEmpty()) { -
trunk/Source/WebCore/rendering/RenderBoxModelObject.h
r86384 r89970 122 122 bool paintNinePieceImage(GraphicsContext*, const IntRect&, const RenderStyle*, const NinePieceImage&, CompositeOperator = CompositeSourceOver); 123 123 void paintBoxShadow(GraphicsContext*, const IntRect&, const RenderStyle*, ShadowStyle, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true); 124 void paintFillLayerExtended(const PaintInfo&, const Color&, const FillLayer*, const IntRect&, BackgroundBleedAvoidance, InlineFlowBox* = 0, const IntSize& = IntSize(), CompositeOperator = CompositeSourceOver, RenderObject* backgroundObject = 0);124 void paintFillLayerExtended(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, BackgroundBleedAvoidance, InlineFlowBox* = 0, const LayoutSize& = LayoutSize(), CompositeOperator = CompositeSourceOver, RenderObject* backgroundObject = 0); 125 125 126 126 // Overridden by subclasses to determine line height and baseline position. -
trunk/Source/WebCore/rendering/RenderObject.h
r89754 r89970 31 31 #include "Element.h" 32 32 #include "FloatQuad.h" 33 #include "LayoutTypes.h" 33 34 #include "PaintPhase.h" 34 35 #include "RenderObjectChildList.h"
Note: See TracChangeset
for help on using the changeset viewer.