Changeset 87387 in webkit
- Timestamp:
- May 26, 2011 8:34:48 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r87385 r87387 1 2011-05-25 Simon Fraser <simon.fraser@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 Always antialias table borders when scaling 6 https://bugs.webkit.org/show_bug.cgi?id=61502 7 8 Pixel tests for the drawing of collapsed table borders, column rules 9 and inline outlines when scaled. 10 11 * fast/borders/border-antialiasing.html: Added. 12 * platform/mac/fast/borders/border-antialiasing-expected.png: Added. 13 * platform/mac/fast/borders/border-antialiasing-expected.txt: Added. 14 1 15 2011-05-26 Csaba Osztrogonác <ossy@webkit.org> 2 16 -
trunk/Source/WebCore/ChangeLog
r87383 r87387 1 2011-05-25 Simon Fraser <simon.fraser@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 Always antialias borders, outlines and rules when scaling 6 https://bugs.webkit.org/show_bug.cgi?id=61502 7 8 r84273 changed the behavior of drawLineForBoxSide() to never antialias by default. 9 This actually disabled antialiasing in some circumstances where it used to be enabled, 10 for example collapsed table border drawing. 11 12 Fix by allowing antialiasing for collapsed table borders, column rules and span 13 outlines when the context is scaled. 14 15 Test: fast/borders/border-antialiasing.html 16 17 * rendering/RenderBlock.cpp: 18 (WebCore::RenderBlock::paintColumnRules): 19 * rendering/RenderInline.cpp: 20 (WebCore::RenderInline::paintOutline): 21 (WebCore::RenderInline::paintOutlineForLine): 22 * rendering/RenderTableCell.cpp: 23 (WebCore::RenderTableCell::paintCollapsedBorder): 24 1 25 2011-05-26 Vsevolod Vlasov <vsevik@chromium.org> 2 26 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r87303 r87387 2274 2274 void RenderBlock::paintColumnRules(PaintInfo& paintInfo, int tx, int ty) 2275 2275 { 2276 if (paintInfo.context->paintingDisabled()) 2277 return; 2278 2276 2279 const Color& ruleColor = style()->visitedDependentColor(CSSPropertyWebkitColumnRuleColor); 2277 2280 bool ruleTransparent = style()->columnRuleIsTransparent(); … … 2289 2292 int ruleAdd = logicalLeftOffsetForContent(); 2290 2293 int ruleLogicalLeft = style()->isLeftToRightDirection() ? 0 : contentLogicalWidth(); 2294 2295 const AffineTransform& currentCTM = paintInfo.context->getCTM(); 2296 bool antialias = !currentCTM.isIdentityOrTranslationOrFlipped(); 2297 2291 2298 for (unsigned i = 0; i < colCount; i++) { 2292 2299 IntRect colRect = columnRectAt(colInfo, i); … … 2310 2317 int ruleBottom = isHorizontalWritingMode() ? ruleTop + contentHeight() : ruleTop + ruleWidth; 2311 2318 drawLineForBoxSide(paintInfo.context, ruleLeft, ruleTop, ruleRight, ruleBottom, 2312 style()->isLeftToRightDirection() ? BSLeft : BSRight, ruleColor, ruleStyle, 0, 0 );2319 style()->isLeftToRightDirection() ? BSLeft : BSRight, ruleColor, ruleStyle, 0, 0, antialias); 2313 2320 } 2314 2321 -
trunk/Source/WebCore/rendering/RenderInline.cpp
r87303 r87387 1380 1380 } 1381 1381 1382 if (graphicsContext->paintingDisabled()) 1383 return; 1384 1382 1385 if (styleToUse->outlineStyleIsAuto() || styleToUse->outlineStyle() == BNONE) 1383 1386 return; … … 1423 1426 int ow = styleToUse->outlineWidth(); 1424 1427 EBorderStyle os = styleToUse->outlineStyle(); 1428 1429 const AffineTransform& currentCTM = graphicsContext->getCTM(); 1430 bool antialias = !currentCTM.isIdentityOrTranslationOrFlipped(); 1425 1431 1426 1432 int offset = style()->outlineOffset(); … … 1440 1446 outlineColor, os, 1441 1447 (lastline.isEmpty() || thisline.x() < lastline.x() || (lastline.maxX() - 1) <= thisline.x() ? ow : -ow), 1442 (nextline.isEmpty() || thisline.x() <= nextline.x() || (nextline.maxX() - 1) <= thisline.x() ? ow : -ow)); 1448 (nextline.isEmpty() || thisline.x() <= nextline.x() || (nextline.maxX() - 1) <= thisline.x() ? ow : -ow), 1449 antialias); 1443 1450 1444 1451 // right edge … … 1451 1458 outlineColor, os, 1452 1459 (lastline.isEmpty() || lastline.maxX() < thisline.maxX() || (thisline.maxX() - 1) <= lastline.x() ? ow : -ow), 1453 (nextline.isEmpty() || nextline.maxX() <= thisline.maxX() || (thisline.maxX() - 1) <= nextline.x() ? ow : -ow)); 1460 (nextline.isEmpty() || nextline.maxX() <= thisline.maxX() || (thisline.maxX() - 1) <= nextline.x() ? ow : -ow), 1461 antialias); 1454 1462 // upper edge 1455 1463 if (thisline.x() < lastline.x()) … … 1458 1466 t - ow, 1459 1467 min(r+ow, (lastline.isEmpty() ? 1000000 : tx + lastline.x())), 1460 t 1468 t, 1461 1469 BSTop, outlineColor, os, 1462 1470 ow, 1463 (!lastline.isEmpty() && tx + lastline.x() + 1 < r + ow) ? -ow : ow); 1471 (!lastline.isEmpty() && tx + lastline.x() + 1 < r + ow) ? -ow : ow, 1472 antialias); 1464 1473 1465 1474 if (lastline.maxX() < thisline.maxX()) … … 1468 1477 t - ow, 1469 1478 r + ow, 1470 t 1479 t, 1471 1480 BSTop, outlineColor, os, 1472 1481 (!lastline.isEmpty() && l - ow < tx + lastline.maxX()) ? -ow : ow, 1473 ow );1482 ow, antialias); 1474 1483 1475 1484 // lower edge … … 1482 1491 BSBottom, outlineColor, os, 1483 1492 ow, 1484 (!nextline.isEmpty() && tx + nextline.x() + 1 < r + ow) ? -ow : ow); 1493 (!nextline.isEmpty() && tx + nextline.x() + 1 < r + ow) ? -ow : ow, 1494 antialias); 1485 1495 1486 1496 if (nextline.maxX() < thisline.maxX()) … … 1492 1502 BSBottom, outlineColor, os, 1493 1503 (!nextline.isEmpty() && l - ow < tx + nextline.maxX()) ? -ow : ow, 1494 ow );1504 ow, antialias); 1495 1505 } 1496 1506 -
trunk/Source/WebCore/rendering/RenderTableCell.cpp
r87303 r87387 915 915 void RenderTableCell::paintCollapsedBorder(GraphicsContext* graphicsContext, const IntRect& paintRect) 916 916 { 917 if (!table()->currentBorderStyle() )917 if (!table()->currentBorderStyle() || graphicsContext->paintingDisabled()) 918 918 return; 919 919 … … 951 951 borders.addBorder(leftVal, BSLeft, renderLeft, x, y, x + leftWidth, y + h, leftStyle); 952 952 borders.addBorder(rightVal, BSRight, renderRight, x + w - rightWidth, y, x + w, y + h, rightStyle); 953 954 const AffineTransform& currentCTM = graphicsContext->getCTM(); 955 bool antialias = !currentCTM.isIdentityOrTranslationOrFlipped(); 953 956 954 957 for (CollapsedBorder* border = borders.nextBorder(); border; border = borders.nextBorder()) { 955 958 if (border->borderValue == *table()->currentBorderStyle()) 956 959 drawLineForBoxSide(graphicsContext, border->x1, border->y1, border->x2, border->y2, border->side, 957 border->borderValue.color(), border->style, 0, 0 );960 border->borderValue.color(), border->style, 0, 0, antialias); 958 961 } 959 962 }
Note: See TracChangeset
for help on using the changeset viewer.