Changeset 95778 in webkit


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

Remove unneeded type conversion from background bleed code
https://bugs.webkit.org/show_bug.cgi?id=68669

Reviewed by Geoffrey Garen.

  • rendering/RenderBoxModelObject.cpp:

(WebCore::backgroundRectAdjustedForBleedAvoidance): Use ceil instead of ceilf
and eliminate superflous conversion to float and use of FloatSize. Also added
a "why" comment.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r95777 r95778  
     12011-09-22  Darin Adler  <darin@apple.com>
     2
     3        Remove unneeded type conversion from background bleed code
     4        https://bugs.webkit.org/show_bug.cgi?id=68669
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        * rendering/RenderBoxModelObject.cpp:
     9        (WebCore::backgroundRectAdjustedForBleedAvoidance): Use ceil instead of ceilf
     10        and eliminate superflous conversion to float and use of FloatSize. Also added
     11        a "why" comment.
     12
    1132011-09-22  Darin Adler  <darin@apple.com>
    214
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r95777 r95778  
    587587        return borderRect;
    588588
     589    // We shrink the rectangle by one pixel on each side because the bleed is one pixel maximum.
     590    AffineTransform transform = context->getCTM();
    589591    LayoutRect adjustedRect = borderRect;
    590     // We need to shrink the border by one device pixel on each side.
    591     AffineTransform ctm = context->getCTM();
    592     FloatSize contextScale(static_cast<float>(ctm.xScale()), static_cast<float>(ctm.yScale()));
    593     adjustedRect.inflateX(-ceilf(1 / contextScale.width()));
    594     adjustedRect.inflateY(-ceilf(1 / contextScale.height()));
     592    adjustedRect.inflateX(-ceil(1 / transform.xScale()));
     593    adjustedRect.inflateY(-ceil(1 / transform.yScale()));
    595594    return adjustedRect;
    596595}
Note: See TracChangeset for help on using the changeset viewer.