Changeset 95129 in webkit


Ignore:
Timestamp:
Sep 14, 2011, 3:24:23 PM (14 years ago)
Author:
hyatt@apple.com
Message:

https://bugs.webkit.org/show_bug.cgi?id=52736

Tiles were not being properly centered within border image sides for the "repeat"
keyword. This patch fixes the buggy math behind the pattern tiling to actually get
the initial phases correct.

Source/WebCore:

Reviewed by Sam Weinig.

Added new tests in fast/borders and updated broken existing tests.

  • platform/graphics/Image.cpp:

(WebCore::Image::drawTiled):

LayoutTests:

Reviewed by Sam Weinig.

  • fast/borders/border-image-massive-scale.html: Added.
  • fast/borders/border-image-scaled-gradient.html: Added.
  • platform/mac/fast/borders/border-image-massive-scale-expected.png: Added.
  • platform/mac/fast/borders/border-image-massive-scale-expected.txt: Added.
  • platform/mac/fast/borders/border-image-outset-expected.png:
  • platform/mac/fast/borders/border-image-outset-in-shorthand-expected.png:
  • platform/mac/fast/borders/border-image-outset-split-inline-expected.png:
  • platform/mac/fast/borders/border-image-outset-split-inline-vertical-lr-expected.png:
  • platform/mac/fast/borders/border-image-scaled-gradient-expected.png: Added.
  • platform/mac/fast/borders/border-image-scaled-gradient-expected.txt: Added.
  • platform/mac/fast/borders/border-image-side-reduction-expected.png:
Location:
trunk
Files:
6 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r95126 r95129  
     12011-09-14  David Hyatt  <hyatt@apple.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=52736
     4
     5        Tiles were not being properly centered within border image sides for the "repeat"
     6        keyword. This patch fixes the buggy math behind the pattern tiling to actually get
     7        the initial phases correct.
     8
     9        Reviewed by Sam Weinig.
     10
     11        * fast/borders/border-image-massive-scale.html: Added.
     12        * fast/borders/border-image-scaled-gradient.html: Added.
     13        * platform/mac/fast/borders/border-image-massive-scale-expected.png: Added.
     14        * platform/mac/fast/borders/border-image-massive-scale-expected.txt: Added.
     15        * platform/mac/fast/borders/border-image-outset-expected.png:
     16        * platform/mac/fast/borders/border-image-outset-in-shorthand-expected.png:
     17        * platform/mac/fast/borders/border-image-outset-split-inline-expected.png:
     18        * platform/mac/fast/borders/border-image-outset-split-inline-vertical-lr-expected.png:
     19        * platform/mac/fast/borders/border-image-scaled-gradient-expected.png: Added.
     20        * platform/mac/fast/borders/border-image-scaled-gradient-expected.txt: Added.
     21        * platform/mac/fast/borders/border-image-side-reduction-expected.png:
     22
    1232011-09-14  Jeremy Apthorp  <jeremya@chromium.org>
    224
  • trunk/Source/WebCore/ChangeLog

    r95128 r95129  
     12011-09-14  David Hyatt  <hyatt@apple.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=52736
     4
     5        Tiles were not being properly centered within border image sides for the "repeat"
     6        keyword. This patch fixes the buggy math behind the pattern tiling to actually get
     7        the initial phases correct.
     8
     9        Reviewed by Sam Weinig.
     10       
     11        Added new tests in fast/borders and updated broken existing tests.
     12
     13        * platform/graphics/Image.cpp:
     14        (WebCore::Image::drawTiled):
     15
    1162011-09-14  Anders Carlsson  <andersca@apple.com>
    217
  • trunk/Source/WebCore/platform/graphics/Image.cpp

    r95121 r95129  
    154154    float hPhase = tileScaleFactor.width() * srcRect.x();
    155155    float vPhase = tileScaleFactor.height() * srcRect.y();
     156    float scaledTileWidth = tileScaleFactor.width() * srcRect.width();
     157    float scaledTileHeight = tileScaleFactor.height() * srcRect.height();
    156158    if (hRule == Image::RepeatTile)
    157         hPhase -= fmodf(dstRect.width(), tileScaleFactor.width() * srcRect.width()) / 2.0f;
     159        hPhase -= (dstRect.width() - scaledTileWidth) / 2;
    158160    if (vRule == Image::RepeatTile)
    159         vPhase -= fmodf(dstRect.height(), tileScaleFactor.height() * srcRect.height()) / 2.0f;
     161        vPhase -= (dstRect.height() - scaledTileHeight) / 2;
    160162    FloatPoint patternPhase(dstRect.x() - hPhase, dstRect.y() - vPhase);
    161163   
Note: See TracChangeset for help on using the changeset viewer.