Changeset 95777 in webkit


Ignore:
Timestamp:
Sep 22, 2011 8:00:38 PM (13 years ago)
Author:
Darin Adler
Message:

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.

Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r95776 r95777  
     12011-09-22  Darin Adler  <darin@apple.com>
     2
     3        Refactor checks for antialiasing lines to share a single function
     4        https://bugs.webkit.org/show_bug.cgi?id=68666
     5
     6        Reviewed by Dan Bernstein.
     7
     8        * rendering/RenderBlock.cpp:
     9        (WebCore::RenderBlock::paintColumnRules): Call shouldAntialiasLines.
     10        * rendering/RenderBoxModelObject.cpp:
     11        (WebCore::RenderBoxModelObject::paintBorder): Ditto.
     12        (WebCore::RenderBoxModelObject::shouldAntialiasLines): Added.
     13        * rendering/RenderBoxModelObject.h: Added shouldAntialiasLines function.
     14        * rendering/RenderInline.cpp:
     15        (WebCore::RenderInline::paintOutlineForLine): Call shouldAntialiasLines.
     16        * rendering/RenderTableCell.cpp:
     17        (WebCore::RenderTableCell::paintCollapsedBorder): Ditto.
     18
    1192011-09-22  Antoine Labour  <piman@chromium.org>
    220
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r95756 r95777  
    23432343    LayoutUnit ruleLogicalLeft = style()->isLeftToRightDirection() ? 0 : contentLogicalWidth();
    23442344
    2345     const AffineTransform& currentCTM = paintInfo.context->getCTM();
    2346     bool antialias = !currentCTM.isIdentityOrTranslationOrFlipped();
     2345    bool antialias = shouldAntialiasLines(paintInfo.context);
    23472346
    23482347    for (unsigned i = 0; i < colCount; i++) {
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r95697 r95777  
    15381538    RoundedRect innerBorder = style->getRoundedInnerBorderFor(rect, includeLogicalLeftEdge, includeLogicalRightEdge);
    15391539
    1540     const AffineTransform& currentCTM = graphicsContext->getCTM();
    1541     // 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.
    1542     bool antialias = !currentCTM.isIdentityOrTranslationOrFlipped();
    1543    
    15441540    bool haveAlphaColor = false;
    15451541    bool haveAllSolidEdges = true;
     
    16271623    }
    16281624
     1625    bool antialias = shouldAntialiasLines(graphicsContext);   
    16291626    if (haveAlphaColor)
    16301627        paintTranslucentBorderSides(graphicsContext, style, outerBorder, innerBorder, edges, bleedAvoidance, includeLogicalLeftEdge, includeLogicalRightEdge, antialias);
     
    24762473}
    24772474
     2475bool RenderBoxModelObject::shouldAntialiasLines(GraphicsContext* context)
     2476{
     2477    // FIXME: We may want to not antialias when scaled by an integral value,
     2478    // and we may want to antialias when translated by a non-integral value.
     2479    return !context->getCTM().isIdentityOrTranslationOrFlipped();
     2480}
     2481
    24782482} // namespace WebCore
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.h

    r93435 r95777  
    190190    RenderBoxModelObject* continuation() const;
    191191    void setContinuation(RenderBoxModelObject*);
     192
     193    static bool shouldAntialiasLines(GraphicsContext*);
    192194
    193195private:
  • trunk/Source/WebCore/rendering/RenderInline.cpp

    r95721 r95777  
    14221422    EBorderStyle outlineStyle = styleToUse->outlineStyle();
    14231423
    1424     const AffineTransform& currentCTM = graphicsContext->getCTM();
    1425     bool antialias = !currentCTM.isIdentityOrTranslationOrFlipped();
     1424    bool antialias = shouldAntialiasLines(graphicsContext);
    14261425
    14271426    LayoutUnit offset = style()->outlineOffset();
  • trunk/Source/WebCore/rendering/RenderTableCell.cpp

    r95573 r95777  
    945945    borders.addBorder(rightVal, BSRight, renderRight, x + w - rightWidth, y, x + w, y + h, rightStyle);
    946946
    947     const AffineTransform& currentCTM = graphicsContext->getCTM();
    948     bool antialias = !currentCTM.isIdentityOrTranslationOrFlipped();
     947    bool antialias = shouldAntialiasLines(graphicsContext);
    949948   
    950949    for (CollapsedBorder* border = borders.nextBorder(); border; border = borders.nextBorder()) {
Note: See TracChangeset for help on using the changeset viewer.