Changeset 70118 in webkit


Ignore:
Timestamp:
Oct 19, 2010 6:44:08 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2010-10-19 Yongjun Zhang <yongjun_zhang@apple.com>

Reviewed by Dan Bernstein.

Pixel cracks when using background image sprite on transformed element at certain scales.
https://bugs.webkit.org/show_bug.cgi?id=47868

  • fast/images/pixel-crack-image-background-webkit-transform-scale.html: Added.
  • fast/images/resources/pixel-crack-image-background-webkit-transform-scale.png: Added.
  • platform/mac/fast/images/pixel-crack-image-background-webkit-transform-scale-expected.checksum: Added.
  • platform/mac/fast/images/pixel-crack-image-background-webkit-transform-scale-expected.png: Added.
  • platform/mac/fast/images/pixel-crack-image-background-webkit-transform-scale-expected.txt: Added.

2010-10-19 Yongjun Zhang <yongjun_zhang@apple.com>

Reviewed by Dan Bernstein.

Pixel cracks when using background image sprite on transformed element at certain scales.
https://bugs.webkit.org/show_bug.cgi?id=47868

The pixel bleeding happens when the current context has scale and interpolation is kCGInterpolationHigh
or kCGInterpolationDefault. If the source rect size is smaller than the intrinsic image size, some
pixels outside of the clip rect will also be used to interpolate the color value for clip edges, which
results in unwanted thin lines around the painted area. We need to use sub-image patch to get rid of
the artifacts in this case.

Test: fast/images/pixel-crack-image-background-webkit-transform-scale.html

  • platform/graphics/cg/ImageCG.cpp: (WebCore::BitmapImage::draw):
Location:
trunk
Files:
5 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r70116 r70118  
     12010-10-19  Yongjun Zhang  <yongjun_zhang@apple.com>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        Pixel cracks when using background image sprite on transformed element at certain scales.
     6        https://bugs.webkit.org/show_bug.cgi?id=47868
     7
     8        * fast/images/pixel-crack-image-background-webkit-transform-scale.html: Added.
     9        * fast/images/resources/pixel-crack-image-background-webkit-transform-scale.png: Added.
     10        * platform/mac/fast/images/pixel-crack-image-background-webkit-transform-scale-expected.checksum: Added.
     11        * platform/mac/fast/images/pixel-crack-image-background-webkit-transform-scale-expected.png: Added.
     12        * platform/mac/fast/images/pixel-crack-image-background-webkit-transform-scale-expected.txt: Added.
     13
    1142010-10-19  James Robinson  <jamesr@chromium.org>
    215
  • trunk/WebCore/ChangeLog

    r70114 r70118  
     12010-10-19  Yongjun Zhang  <yongjun_zhang@apple.com>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        Pixel cracks when using background image sprite on transformed element at certain scales.
     6        https://bugs.webkit.org/show_bug.cgi?id=47868
     7
     8        The pixel bleeding happens when the current context has scale and interpolation is kCGInterpolationHigh
     9        or kCGInterpolationDefault.  If the source rect size is smaller than the intrinsic image size,  some
     10        pixels outside of the clip rect will also be used to interpolate the color value for clip edges, which
     11        results in unwanted thin lines around the painted area.  We need to use sub-image patch to get rid of
     12        the artifacts in this case.
     13
     14        Test: fast/images/pixel-crack-image-background-webkit-transform-scale.html
     15
     16        * platform/graphics/cg/ImageCG.cpp:
     17        (WebCore::BitmapImage::draw):
     18
    1192010-10-19  Evan Martin  <evan@chromium.org>
    220
  • trunk/WebCore/platform/graphics/cg/ImageCG.cpp

    r69261 r70118  
    186186        // interpolation smoothes sharp edges, causing pixels from outside the source rect to bleed
    187187        // into the destination rect. See <rdar://problem/6112909>.
    188         shouldUseSubimage = (interpolationQuality == kCGInterpolationHigh || interpolationQuality == kCGInterpolationDefault) && srcRect.size() != destRect.size();
     188        shouldUseSubimage = (interpolationQuality == kCGInterpolationHigh || interpolationQuality == kCGInterpolationDefault) && (srcRect.size() != destRect.size() || !ctxt->getCTM().isIdentityOrTranslationOrFlipped());
    189189        float xScale = srcRect.width() / destRect.width();
    190190        float yScale = srcRect.height() / destRect.height();
Note: See TracChangeset for help on using the changeset viewer.