Changeset 88176 in webkit
- Timestamp:
- Jun 6, 2011 11:43:40 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r88175 r88176 1 2011-06-06 Levi Weintraub <leviw@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Switch paintContents, paintColumnContents, paintColumnRules, and paintSelection to use IntPoint 6 https://bugs.webkit.org/show_bug.cgi?id=62134 7 8 Switching paintContents, paintColumnContents, paintColumnRules, and paintSelection to take an 9 IntPoint representing the paint offset instead of a pair of ints. 10 11 No new tests as this simple refactoring. 12 13 * rendering/RenderBlock.cpp: 14 (WebCore::RenderBlock::paintColumnRules): 15 (WebCore::RenderBlock::paintColumnContents): 16 (WebCore::RenderBlock::paintContents): 17 (WebCore::RenderBlock::paintObject): 18 (WebCore::RenderBlock::paintSelection): 19 * rendering/RenderBlock.h: 20 1 21 2011-06-06 Yael Aharon <yael.aharon@nokia.com> 2 22 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r88172 r88176 2270 2270 } 2271 2271 2272 void RenderBlock::paintColumnRules(PaintInfo& paintInfo, int tx, int ty)2272 void RenderBlock::paintColumnRules(PaintInfo& paintInfo, const IntPoint& paintOffset) 2273 2273 { 2274 2274 if (paintInfo.context->paintingDisabled()) … … 2310 2310 // Now paint the column rule. 2311 2311 if (i < colCount - 1) { 2312 int ruleLeft = isHorizontalWritingMode() ? tx + ruleLogicalLeft - ruleWidth / 2 + ruleAdd : tx+ borderBefore() + paddingBefore();2312 int ruleLeft = isHorizontalWritingMode() ? paintOffset.x() + ruleLogicalLeft - ruleWidth / 2 + ruleAdd : paintOffset.x() + borderBefore() + paddingBefore(); 2313 2313 int ruleRight = isHorizontalWritingMode() ? ruleLeft + ruleWidth : ruleLeft + contentWidth(); 2314 int ruleTop = isHorizontalWritingMode() ? ty + borderTop() + paddingTop() : ty+ ruleLogicalLeft - ruleWidth / 2 + ruleAdd;2314 int ruleTop = isHorizontalWritingMode() ? paintOffset.y() + borderTop() + paddingTop() : paintOffset.y() + ruleLogicalLeft - ruleWidth / 2 + ruleAdd; 2315 2315 int ruleBottom = isHorizontalWritingMode() ? ruleTop + contentHeight() : ruleTop + ruleWidth; 2316 2316 drawLineForBoxSide(paintInfo.context, ruleLeft, ruleTop, ruleRight, ruleBottom, … … 2322 2322 } 2323 2323 2324 void RenderBlock::paintColumnContents(PaintInfo& paintInfo, int tx, int ty, bool paintingFloats)2324 void RenderBlock::paintColumnContents(PaintInfo& paintInfo, const IntPoint& paintOffset, bool paintingFloats) 2325 2325 { 2326 2326 // We need to do multiple passes, breaking up our child painting into strips. … … 2337 2337 int logicalLeftOffset = (isHorizontalWritingMode() ? colRect.x() : colRect.y()) - logicalLeftOffsetForContent(); 2338 2338 IntSize offset = isHorizontalWritingMode() ? IntSize(logicalLeftOffset, currLogicalTopOffset) : IntSize(currLogicalTopOffset, logicalLeftOffset); 2339 colRect.move (tx, ty);2339 colRect.moveBy(paintOffset); 2340 2340 PaintInfo info(paintInfo); 2341 2341 info.rect.intersect(colRect); … … 2349 2349 2350 2350 // Adjust our x and y when painting. 2351 int finalX = tx + offset.width(); 2352 int finalY = ty + offset.height(); 2351 IntPoint adjustedPaintOffset = paintOffset + offset; 2353 2352 if (paintingFloats) 2354 paintFloats(info, IntPoint(finalX, finalY), paintInfo.phase == PaintPhaseSelection || paintInfo.phase == PaintPhaseTextClip);2353 paintFloats(info, adjustedPaintOffset, paintInfo.phase == PaintPhaseSelection || paintInfo.phase == PaintPhaseTextClip); 2355 2354 else 2356 paintContents(info, finalX, finalY);2355 paintContents(info, adjustedPaintOffset); 2357 2356 } 2358 2357 … … 2365 2364 } 2366 2365 2367 void RenderBlock::paintContents(PaintInfo& paintInfo, int tx, int ty)2366 void RenderBlock::paintContents(PaintInfo& paintInfo, const IntPoint& paintOffset) 2368 2367 { 2369 2368 // Avoid painting descendants of the root element when stylesheets haven't loaded. This eliminates FOUC. … … 2374 2373 2375 2374 if (childrenInline()) 2376 m_lineBoxes.paint(this, paintInfo, tx, ty);2375 m_lineBoxes.paint(this, paintInfo, paintOffset.x(), paintOffset.y()); 2377 2376 else 2378 paintChildren(paintInfo, IntPoint(tx, ty));2377 paintChildren(paintInfo, paintOffset); 2379 2378 } 2380 2379 … … 2467 2466 paintBoxDecorations(paintInfo, paintOffset); 2468 2467 if (hasColumns()) 2469 paintColumnRules(paintInfo, paintOffset .x(), paintOffset.y());2468 paintColumnRules(paintInfo, paintOffset); 2470 2469 } 2471 2470 … … 2487 2486 if (paintPhase != PaintPhaseSelfOutline) { 2488 2487 if (hasColumns()) 2489 paintColumnContents(paintInfo, scrolledOffset .x(), scrolledOffset.y());2488 paintColumnContents(paintInfo, scrolledOffset); 2490 2489 else 2491 paintContents(paintInfo, scrolledOffset .x(), scrolledOffset.y());2490 paintContents(paintInfo, scrolledOffset); 2492 2491 } 2493 2492 … … 2496 2495 bool isPrinting = document()->printing(); 2497 2496 if (!isPrinting && !hasColumns()) 2498 paintSelection(paintInfo, scrolledOffset .x(), scrolledOffset.y()); // Fill in gaps in selection on lines and between blocks.2497 paintSelection(paintInfo, scrolledOffset); // Fill in gaps in selection on lines and between blocks. 2499 2498 2500 2499 // 4. paint floats. 2501 2500 if (paintPhase == PaintPhaseFloat || paintPhase == PaintPhaseSelection || paintPhase == PaintPhaseTextClip) { 2502 2501 if (hasColumns()) 2503 paintColumnContents(paintInfo, scrolledOffset .x(), scrolledOffset.y(), true);2502 paintColumnContents(paintInfo, scrolledOffset, true); 2504 2503 else 2505 2504 paintFloats(paintInfo, scrolledOffset, paintPhase == PaintPhaseSelection || paintPhase == PaintPhaseTextClip); … … 2741 2740 } 2742 2741 2743 void RenderBlock::paintSelection(PaintInfo& paintInfo, int tx, int ty)2742 void RenderBlock::paintSelection(PaintInfo& paintInfo, const IntPoint& paintOffset) 2744 2743 { 2745 2744 if (shouldPaintSelectionGaps() && paintInfo.phase == PaintPhaseForeground) { … … 2749 2748 GraphicsContextStateSaver stateSaver(*paintInfo.context); 2750 2749 2751 IntRect gapRectsBounds = selectionGaps(this, IntPoint(tx, ty), IntSize(), lastTop, lastLeft, lastRight, &paintInfo);2750 IntRect gapRectsBounds = selectionGaps(this, paintOffset, IntSize(), lastTop, lastLeft, lastRight, &paintInfo); 2752 2751 if (!gapRectsBounds.isEmpty()) { 2753 2752 if (RenderLayer* layer = enclosingLayer()) { 2754 gapRectsBounds.move (IntSize(-tx, -ty));2753 gapRectsBounds.moveBy(-paintOffset); 2755 2754 if (!hasLayer()) { 2756 2755 IntRect localBounds(gapRectsBounds); -
trunk/Source/WebCore/rendering/RenderBlock.h
r88172 r88176 561 561 562 562 void paintFloats(PaintInfo&, const IntPoint&, bool preservePhase = false); 563 void paintContents(PaintInfo&, int tx, int ty);564 void paintColumnContents(PaintInfo&, int tx, int ty, bool paintFloats = false);565 void paintColumnRules(PaintInfo&, int tx, int ty);563 void paintContents(PaintInfo&, const IntPoint&); 564 void paintColumnContents(PaintInfo&, const IntPoint&, bool paintFloats = false); 565 void paintColumnRules(PaintInfo&, const IntPoint&); 566 566 void paintChildren(PaintInfo&, const IntPoint&); 567 567 void paintEllipsisBoxes(PaintInfo&, const IntPoint&); 568 void paintSelection(PaintInfo&, int tx, int ty);568 void paintSelection(PaintInfo&, const IntPoint&); 569 569 void paintCaret(PaintInfo&, const IntPoint&, CaretType); 570 570
Note: See TracChangeset
for help on using the changeset viewer.