https://bugs.webkit.org/show_bug.cgi?id=68666
Reviewed by Dan Bernstein.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintColumnRules): Call shouldAntialiasLines.
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintBorder): Ditto.
(WebCore::RenderBoxModelObject::shouldAntialiasLines): Added.
* rendering/RenderBoxModelObject.h: Added shouldAntialiasLines function.
* rendering/RenderInline.cpp:
(WebCore::RenderInline::paintOutlineForLine): Call shouldAntialiasLines.
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::paintCollapsedBorder): Ditto.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95777
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-09-22 Darin Adler <darin@apple.com>
+
+ Refactor checks for antialiasing lines to share a single function
+ https://bugs.webkit.org/show_bug.cgi?id=68666
+
+ Reviewed by Dan Bernstein.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::paintColumnRules): Call shouldAntialiasLines.
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::RenderBoxModelObject::paintBorder): Ditto.
+ (WebCore::RenderBoxModelObject::shouldAntialiasLines): Added.
+ * rendering/RenderBoxModelObject.h: Added shouldAntialiasLines function.
+ * rendering/RenderInline.cpp:
+ (WebCore::RenderInline::paintOutlineForLine): Call shouldAntialiasLines.
+ * rendering/RenderTableCell.cpp:
+ (WebCore::RenderTableCell::paintCollapsedBorder): Ditto.
+
2011-09-22 Antoine Labour <piman@chromium.org>
Remove unused members from LayerChromium.
LayoutUnit ruleAdd = logicalLeftOffsetForContent();
LayoutUnit ruleLogicalLeft = style()->isLeftToRightDirection() ? 0 : contentLogicalWidth();
- const AffineTransform& currentCTM = paintInfo.context->getCTM();
- bool antialias = !currentCTM.isIdentityOrTranslationOrFlipped();
+ bool antialias = shouldAntialiasLines(paintInfo.context);
for (unsigned i = 0; i < colCount; i++) {
LayoutRect colRect = columnRectAt(colInfo, i);
RoundedRect outerBorder = style->getRoundedBorderFor(rect, includeLogicalLeftEdge, includeLogicalRightEdge);
RoundedRect innerBorder = style->getRoundedInnerBorderFor(rect, includeLogicalLeftEdge, includeLogicalRightEdge);
- const AffineTransform& currentCTM = graphicsContext->getCTM();
- // FIXME: this isn't quite correct. We may want to antialias when scaled by a non-integral value, or when the translation is non-integral.
- bool antialias = !currentCTM.isIdentityOrTranslationOrFlipped();
-
bool haveAlphaColor = false;
bool haveAllSolidEdges = true;
bool allEdgesVisible = true;
graphicsContext->clipOutRoundedRect(innerBorder);
}
+ bool antialias = shouldAntialiasLines(graphicsContext);
if (haveAlphaColor)
paintTranslucentBorderSides(graphicsContext, style, outerBorder, innerBorder, edges, bleedAvoidance, includeLogicalLeftEdge, includeLogicalRightEdge, antialias);
else
}
}
+bool RenderBoxModelObject::shouldAntialiasLines(GraphicsContext* context)
+{
+ // FIXME: We may want to not antialias when scaled by an integral value,
+ // and we may want to antialias when translated by a non-integral value.
+ return !context->getCTM().isIdentityOrTranslationOrFlipped();
+}
+
} // namespace WebCore
RenderBoxModelObject* continuation() const;
void setContinuation(RenderBoxModelObject*);
+ static bool shouldAntialiasLines(GraphicsContext*);
+
private:
virtual bool isBoxModelObject() const { return true; }
LayoutUnit outlineWidth = styleToUse->outlineWidth();
EBorderStyle outlineStyle = styleToUse->outlineStyle();
- const AffineTransform& currentCTM = graphicsContext->getCTM();
- bool antialias = !currentCTM.isIdentityOrTranslationOrFlipped();
+ bool antialias = shouldAntialiasLines(graphicsContext);
LayoutUnit offset = style()->outlineOffset();
borders.addBorder(leftVal, BSLeft, renderLeft, x, y, x + leftWidth, y + h, leftStyle);
borders.addBorder(rightVal, BSRight, renderRight, x + w - rightWidth, y, x + w, y + h, rightStyle);
- const AffineTransform& currentCTM = graphicsContext->getCTM();
- bool antialias = !currentCTM.isIdentityOrTranslationOrFlipped();
+ bool antialias = shouldAntialiasLines(graphicsContext);
for (CollapsedBorder* border = borders.nextBorder(); border; border = borders.nextBorder()) {
if (border->borderValue == *table()->currentBorderStyle())