Changeset 88190 in webkit
- Timestamp:
- Jun 6, 2011 2:35:56 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r88189 r88190 1 2011-06-06 Levi Weintraub <leviw@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Switch paintOutline, paintContinuationOutlines, and paintOutlineForLine to use IntPoint 6 https://bugs.webkit.org/show_bug.cgi?id=62137 7 8 Switching paintOutline, paintContinuationOutlines, and paintOutlineForLine to take an IntPoint 9 representing the paint offset instead of a pair of ints. 10 11 No new tests as this is simple refactoring. 12 13 * rendering/RenderBlock.cpp: 14 (WebCore::RenderBlock::paintObject): 15 (WebCore::RenderBlock::paintContinuationOutlines): 16 * rendering/RenderBlock.h: 17 * rendering/RenderInline.cpp: 18 (WebCore::RenderInline::paintOutline): 19 (WebCore::RenderInline::paintOutlineForLine): 20 * rendering/RenderInline.h: 21 * rendering/RenderLineBoxList.cpp: 22 (WebCore::RenderLineBoxList::paint): 23 1 24 2011-06-06 Emil A Eklund <eae@chromium.org> 2 25 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r88189 r88190 2527 2527 cb->addContinuationWithOutline(inlineRenderer); 2528 2528 else if (!inlineRenderer->firstLineBox()) 2529 inlineRenderer->paintOutline(paintInfo.context, paintOffset.x() - x() + inlineRenderer->containingBlock()->x(), 2530 paintOffset.y() - y() + inlineRenderer->containingBlock()->y()); 2531 } 2532 paintContinuationOutlines(paintInfo, paintOffset.x(), paintOffset.y()); 2529 inlineRenderer->paintOutline(paintInfo.context, paintOffset - locationOffset() + inlineRenderer->containingBlock()->location()); 2530 } 2531 paintContinuationOutlines(paintInfo, paintOffset); 2533 2532 } 2534 2533 … … 2661 2660 } 2662 2661 2663 void RenderBlock::paintContinuationOutlines(PaintInfo& info, int tx, int ty)2662 void RenderBlock::paintContinuationOutlines(PaintInfo& info, const IntPoint& paintOffset) 2664 2663 { 2665 2664 ContinuationOutlineTableMap* table = continuationOutlineTable(); … … 2670 2669 if (!continuations) 2671 2670 return; 2672 2671 2672 IntPoint accumulatedPaintOffset = paintOffset; 2673 2673 // Paint each continuation outline. 2674 2674 ListHashSet<RenderInline*>::iterator end = continuations->end(); … … 2677 2677 RenderInline* flow = *it; 2678 2678 RenderBlock* block = flow->containingBlock(); 2679 for ( ; block && block != this; block = block->containingBlock()) { 2680 tx += block->x(); 2681 ty += block->y(); 2682 } 2679 for ( ; block && block != this; block = block->containingBlock()) 2680 accumulatedPaintOffset.move(block->location()); 2683 2681 ASSERT(block); 2684 flow->paintOutline(info.context, tx, ty);2682 flow->paintOutline(info.context, accumulatedPaintOffset); 2685 2683 } 2686 2684 -
trunk/Source/WebCore/rendering/RenderBlock.h
r88176 r88190 633 633 void setDesiredColumnCountAndWidth(int count, int width); 634 634 635 void paintContinuationOutlines(PaintInfo&, int tx, int ty);635 void paintContinuationOutlines(PaintInfo&, const IntPoint&); 636 636 637 637 virtual IntRect localCaretRect(InlineBox*, int caretOffset, int* extraWidthToEndOfLine = 0); -
trunk/Source/WebCore/rendering/RenderInline.cpp
r87989 r88190 1367 1367 } 1368 1368 1369 void RenderInline::paintOutline(GraphicsContext* graphicsContext, int tx, int ty)1369 void RenderInline::paintOutline(GraphicsContext* graphicsContext, const IntPoint& paintOffset) 1370 1370 { 1371 1371 if (!hasOutline()) … … 1376 1376 if (!theme()->supportsFocusRing(styleToUse)) { 1377 1377 // Only paint the focus ring by hand if the theme isn't able to draw the focus ring. 1378 paintFocusRing(graphicsContext, IntPoint(tx, ty), styleToUse);1378 paintFocusRing(graphicsContext, paintOffset, styleToUse); 1379 1379 } 1380 1380 } … … 1409 1409 1410 1410 for (unsigned i = 1; i < rects.size() - 1; i++) 1411 paintOutlineForLine(graphicsContext, tx, ty, rects.at(i - 1), rects.at(i), rects.at(i + 1), outlineColor);1411 paintOutlineForLine(graphicsContext, paintOffset, rects.at(i - 1), rects.at(i), rects.at(i + 1), outlineColor); 1412 1412 1413 1413 // FIXME: Using a transparency layer for rgba outlines exacerbates an existing SKIA bug. The #if … … 1419 1419 } 1420 1420 1421 void RenderInline::paintOutlineForLine(GraphicsContext* graphicsContext, int tx, int ty,1421 void RenderInline::paintOutlineForLine(GraphicsContext* graphicsContext, const IntPoint& paintOffset, 1422 1422 const IntRect& lastline, const IntRect& thisline, const IntRect& nextline, 1423 1423 const Color outlineColor) … … 1432 1432 int offset = style()->outlineOffset(); 1433 1433 1434 int t = ty+ thisline.y() - offset;1435 int l = tx+ thisline.x() - offset;1436 int b = ty+ thisline.maxY() + offset;1437 int r = tx+ thisline.maxX() + offset;1434 int t = paintOffset.y() + thisline.y() - offset; 1435 int l = paintOffset.x() + thisline.x() - offset; 1436 int b = paintOffset.y() + thisline.maxY() + offset; 1437 int r = paintOffset.x() + thisline.maxX() + offset; 1438 1438 1439 1439 // left edge … … 1465 1465 l - ow, 1466 1466 t - ow, 1467 min(r+ow, (lastline.isEmpty() ? 1000000 : tx+ lastline.x())),1467 min(r+ow, (lastline.isEmpty() ? 1000000 : paintOffset.x() + lastline.x())), 1468 1468 t, 1469 1469 BSTop, outlineColor, os, 1470 1470 ow, 1471 (!lastline.isEmpty() && tx+ lastline.x() + 1 < r + ow) ? -ow : ow,1471 (!lastline.isEmpty() && paintOffset.x() + lastline.x() + 1 < r + ow) ? -ow : ow, 1472 1472 antialias); 1473 1473 1474 1474 if (lastline.maxX() < thisline.maxX()) 1475 1475 drawLineForBoxSide(graphicsContext, 1476 max(lastline.isEmpty() ? -1000000 : tx+ lastline.maxX(), l - ow),1476 max(lastline.isEmpty() ? -1000000 : paintOffset.x() + lastline.maxX(), l - ow), 1477 1477 t - ow, 1478 1478 r + ow, 1479 1479 t, 1480 1480 BSTop, outlineColor, os, 1481 (!lastline.isEmpty() && l - ow < tx+ lastline.maxX()) ? -ow : ow,1481 (!lastline.isEmpty() && l - ow < paintOffset.x() + lastline.maxX()) ? -ow : ow, 1482 1482 ow, antialias); 1483 1483 … … 1487 1487 l - ow, 1488 1488 b, 1489 min(r + ow, !nextline.isEmpty() ? tx+ nextline.x() + 1 : 1000000),1489 min(r + ow, !nextline.isEmpty() ? paintOffset.x() + nextline.x() + 1 : 1000000), 1490 1490 b + ow, 1491 1491 BSBottom, outlineColor, os, 1492 1492 ow, 1493 (!nextline.isEmpty() && tx+ nextline.x() + 1 < r + ow) ? -ow : ow,1493 (!nextline.isEmpty() && paintOffset.x() + nextline.x() + 1 < r + ow) ? -ow : ow, 1494 1494 antialias); 1495 1495 1496 1496 if (nextline.maxX() < thisline.maxX()) 1497 1497 drawLineForBoxSide(graphicsContext, 1498 max(!nextline.isEmpty() ? tx+ nextline.maxX() : -1000000, l - ow),1498 max(!nextline.isEmpty() ? paintOffset.x() + nextline.maxX() : -1000000, l - ow), 1499 1499 b, 1500 1500 r + ow, 1501 1501 b + ow, 1502 1502 BSBottom, outlineColor, os, 1503 (!nextline.isEmpty() && l - ow < tx+ nextline.maxX()) ? -ow : ow,1503 (!nextline.isEmpty() && l - ow < paintOffset.x() + nextline.maxX()) ? -ow : ow, 1504 1504 ow, antialias); 1505 1505 } -
trunk/Source/WebCore/rendering/RenderInline.h
r87302 r88190 77 77 78 78 virtual void addFocusRingRects(Vector<IntRect>&, const IntPoint&); 79 void paintOutline(GraphicsContext*, int tx, int ty);79 void paintOutline(GraphicsContext*, const IntPoint&); 80 80 81 81 using RenderBoxModelObject::continuation; … … 163 163 static RenderInline* cloneInline(RenderInline* src); 164 164 165 void paintOutlineForLine(GraphicsContext*, int tx, int ty, const IntRect& prevLine, const IntRect& thisLine,165 void paintOutlineForLine(GraphicsContext*, const IntPoint&, const IntRect& prevLine, const IntRect& thisLine, 166 166 const IntRect& nextLine, const Color); 167 167 RenderBoxModelObject* continuationBefore(RenderObject* beforeChild); -
trunk/Source/WebCore/rendering/RenderLineBoxList.cpp
r87825 r88190 268 268 for (ListHashSet<RenderInline*>::iterator it = info.outlineObjects->begin(); it != end; ++it) { 269 269 RenderInline* flow = *it; 270 flow->paintOutline(info.context, tx, ty);270 flow->paintOutline(info.context, IntPoint(tx, ty)); 271 271 } 272 272 info.outlineObjects->clear();
Note: See TracChangeset
for help on using the changeset viewer.