Changeset 89974 in webkit
- Timestamp:
- Jun 28, 2011 4:36:28 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r89970 r89974 1 2011-06-28 Levi Weintraub <leviw@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Switch PaintMask* to new layout types 6 https://bugs.webkit.org/show_bug.cgi?id=63576 7 8 Switching paintMask* 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::paintMask): 14 * rendering/InlineFlowBox.h: 15 * rendering/RenderBox.cpp: 16 (WebCore::RenderBox::paintMask): 17 (WebCore::RenderBox::paintMaskImages): 18 * rendering/RenderBox.h: 19 * rendering/RenderFieldset.cpp: 20 (WebCore::RenderFieldset::paintMask): 21 * rendering/RenderFieldset.h: 22 * rendering/RenderTable.cpp: 23 (WebCore::RenderTable::paintMask): 24 * rendering/RenderTable.h: 25 * rendering/RenderTableCell.cpp: 26 (WebCore::RenderTableCell::paintMask): 27 * rendering/RenderTableCell.h: 28 1 29 2011-06-28 Levi Weintraub <leviw@chromium.org> 2 30 -
trunk/Source/WebCore/rendering/InlineFlowBox.cpp
r89970 r89974 1164 1164 } 1165 1165 1166 void InlineFlowBox::paintMask(PaintInfo& paintInfo, const IntPoint& paintOffset)1166 void InlineFlowBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset) 1167 1167 { 1168 1168 if (!paintInfo.shouldPaintWithinRoot(renderer()) || renderer()->style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask) … … 1170 1170 1171 1171 // Pixel snap mask painting. 1172 IntRect frameRect = roundedFrameRect();1172 LayoutRect frameRect = roundedFrameRect(); 1173 1173 1174 1174 constrainToLineTopAndBottomIfNeeded(frameRect); 1175 1175 1176 1176 // Move x/y to our coordinates. 1177 IntRect localRect(frameRect);1177 LayoutRect localRect(frameRect); 1178 1178 flipForWritingMode(localRect); 1179 IntPoint adjustedPaintOffset = paintOffset + localRect.location();1179 LayoutPoint adjustedPaintOffset = paintOffset + localRect.location(); 1180 1180 1181 1181 const NinePieceImage& maskNinePieceImage = renderer()->style()->maskBoxImage(); … … 1198 1198 } 1199 1199 1200 IntRect paintRect = IntRect(adjustedPaintOffset, frameRect.size());1200 LayoutRect paintRect = LayoutRect(adjustedPaintOffset, frameRect.size()); 1201 1201 paintFillLayers(paintInfo, Color(), renderer()->style()->maskLayers(), paintRect, compositeOp); 1202 1202 … … 1208 1208 // cases only a single call to draw is required. 1209 1209 if (!prevLineBox() && !nextLineBox()) { 1210 boxModelObject()->paintNinePieceImage(paintInfo.context, IntRect(adjustedPaintOffset, frameRect.size()), renderer()->style(), maskNinePieceImage, compositeOp);1210 boxModelObject()->paintNinePieceImage(paintInfo.context, LayoutRect(adjustedPaintOffset, frameRect.size()), renderer()->style(), maskNinePieceImage, compositeOp); 1211 1211 } else { 1212 1212 // We have a mask image that spans multiple lines. 1213 1213 // We need to adjust _tx and _ty by the width of all previous lines. 1214 int logicalOffsetOnLine = 0;1214 LayoutUnit logicalOffsetOnLine = 0; 1215 1215 for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox()) 1216 1216 logicalOffsetOnLine += curr->logicalWidth(); 1217 int totalLogicalWidth = logicalOffsetOnLine;1217 LayoutUnit totalLogicalWidth = logicalOffsetOnLine; 1218 1218 for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox()) 1219 1219 totalLogicalWidth += curr->logicalWidth(); 1220 int stripX = adjustedPaintOffset.x() - (isHorizontal() ? logicalOffsetOnLine : 0);1221 int stripY = adjustedPaintOffset.y() - (isHorizontal() ? 0 : logicalOffsetOnLine);1222 int stripWidth = isHorizontal() ? totalLogicalWidth : frameRect.width();1223 int stripHeight = isHorizontal() ? frameRect.height() : totalLogicalWidth;1220 LayoutUnit stripX = adjustedPaintOffset.x() - (isHorizontal() ? logicalOffsetOnLine : 0); 1221 LayoutUnit stripY = adjustedPaintOffset.y() - (isHorizontal() ? 0 : logicalOffsetOnLine); 1222 LayoutUnit stripWidth = isHorizontal() ? totalLogicalWidth : frameRect.width(); 1223 LayoutUnit stripHeight = isHorizontal() ? frameRect.height() : totalLogicalWidth; 1224 1224 1225 1225 GraphicsContextStateSaver stateSaver(*paintInfo.context); 1226 1226 paintInfo.context->clip(paintRect); 1227 boxModelObject()->paintNinePieceImage(paintInfo.context, IntRect(stripX, stripY, stripWidth, stripHeight), renderer()->style(), maskNinePieceImage, compositeOp);1227 boxModelObject()->paintNinePieceImage(paintInfo.context, LayoutRect(stripX, stripY, stripWidth, stripHeight), renderer()->style(), maskNinePieceImage, compositeOp); 1228 1228 } 1229 1229 -
trunk/Source/WebCore/rendering/InlineFlowBox.h
r89970 r89974 105 105 106 106 virtual void paintBoxDecorations(PaintInfo&, const IntPoint&); 107 virtual void paintMask(PaintInfo&, const IntPoint&);107 virtual void paintMask(PaintInfo&, const LayoutPoint&); 108 108 void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, CompositeOperator = CompositeSourceOver); 109 109 void paintFillLayer(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, CompositeOperator = CompositeSourceOver); -
trunk/Source/WebCore/rendering/RenderBox.cpp
r89970 r89974 879 879 } 880 880 881 void RenderBox::paintMask(PaintInfo& paintInfo, const IntPoint& paintOffset)881 void RenderBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset) 882 882 { 883 883 if (!paintInfo.shouldPaintWithinRoot(this) || style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask || paintInfo.context->paintingDisabled()) 884 884 return; 885 885 886 IntRect paintRect = IntRect(paintOffset, size());886 LayoutRect paintRect = LayoutRect(paintOffset, size()); 887 887 888 888 // border-fit can adjust where we paint our border and background. If set, we snugly fit our line box descendants. (The iChat … … 893 893 } 894 894 895 void RenderBox::paintMaskImages(const PaintInfo& paintInfo, const IntRect& paintRect)895 void RenderBox::paintMaskImages(const PaintInfo& paintInfo, const LayoutRect& paintRect) 896 896 { 897 897 // Figure out if we need to push a transparency layer to render our mask. -
trunk/Source/WebCore/rendering/RenderBox.h
r89970 r89974 355 355 virtual void paintObject(PaintInfo&, const IntPoint&) { ASSERT_NOT_REACHED(); } 356 356 virtual void paintBoxDecorations(PaintInfo&, const IntPoint&); 357 virtual void paintMask(PaintInfo&, const IntPoint&);357 virtual void paintMask(PaintInfo&, const LayoutPoint&); 358 358 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0); 359 359 … … 421 421 void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, BackgroundBleedAvoidance = BackgroundBleedNone, CompositeOperator = CompositeSourceOver, RenderObject* backgroundObject = 0); 422 422 423 void paintMaskImages(const PaintInfo&, const IntRect&);423 void paintMaskImages(const PaintInfo&, const LayoutRect&); 424 424 425 425 #if PLATFORM(MAC) -
trunk/Source/WebCore/rendering/RenderFieldset.cpp
r88087 r89974 169 169 } 170 170 171 void RenderFieldset::paintMask(PaintInfo& paintInfo, const IntPoint& paintOffset)171 void RenderFieldset::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset) 172 172 { 173 173 if (style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask) 174 174 return; 175 175 176 IntRect paintRect = IntRect(paintOffset, size());176 LayoutRect paintRect = LayoutRect(paintOffset, size()); 177 177 RenderBox* legend = findLegend(); 178 178 if (!legend) … … 183 183 // https://bugs.webkit.org/show_bug.cgi?id=47236 184 184 if (style()->isHorizontalWritingMode()) { 185 int yOff = (legend->y() > 0) ? 0 : (legend->height() - borderTop()) / 2;185 LayoutUnit yOff = (legend->y() > 0) ? 0 : (legend->height() - borderTop()) / 2; 186 186 paintRect.expand(0, -yOff); 187 187 paintRect.move(0, yOff); 188 188 } else { 189 int xOff = (legend->x() > 0) ? 0 : (legend->width() - borderLeft()) / 2;189 LayoutUnit xOff = (legend->x() > 0) ? 0 : (legend->width() - borderLeft()) / 2; 190 190 paintRect.expand(-xOff, 0); 191 191 paintRect.move(xOff, 0); -
trunk/Source/WebCore/rendering/RenderFieldset.h
r88087 r89974 46 46 47 47 virtual void paintBoxDecorations(PaintInfo&, const IntPoint&); 48 virtual void paintMask(PaintInfo&, const IntPoint&);48 virtual void paintMask(PaintInfo&, const LayoutPoint&); 49 49 }; 50 50 -
trunk/Source/WebCore/rendering/RenderTable.cpp
r88319 r89974 573 573 } 574 574 575 void RenderTable::paintMask(PaintInfo& paintInfo, const IntPoint& paintOffset)575 void RenderTable::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset) 576 576 { 577 577 if (style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask) 578 578 return; 579 579 580 IntRect rect(paintOffset, size());580 LayoutRect rect(paintOffset, size()); 581 581 subtractCaptionRect(rect); 582 582 -
trunk/Source/WebCore/rendering/RenderTable.h
r88319 r89974 218 218 virtual void paintObject(PaintInfo&, const IntPoint&); 219 219 virtual void paintBoxDecorations(PaintInfo&, const IntPoint&); 220 virtual void paintMask(PaintInfo&, const IntPoint&);220 virtual void paintMask(PaintInfo&, const LayoutPoint&); 221 221 virtual void layout(); 222 222 virtual void computePreferredLogicalWidths(); -
trunk/Source/WebCore/rendering/RenderTableCell.cpp
r88250 r89974 1020 1020 } 1021 1021 1022 void RenderTableCell::paintMask(PaintInfo& paintInfo, const IntPoint& paintOffset)1022 void RenderTableCell::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset) 1023 1023 { 1024 1024 if (style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask) … … 1029 1029 return; 1030 1030 1031 paintMaskImages(paintInfo, IntRect(paintOffset, size()));1031 paintMaskImages(paintInfo, LayoutRect(paintOffset, size())); 1032 1032 } 1033 1033 -
trunk/Source/WebCore/rendering/RenderTableCell.h
r88250 r89974 144 144 145 145 virtual void paintBoxDecorations(PaintInfo&, const IntPoint&); 146 virtual void paintMask(PaintInfo&, const IntPoint&);146 virtual void paintMask(PaintInfo&, const LayoutPoint&); 147 147 148 148 virtual IntSize offsetFromContainer(RenderObject*, const IntPoint&) const;
Note: See TracChangeset
for help on using the changeset viewer.