Commit 7f0d00f2 authored by commit-queue@webkit.org's avatar commit-queue@webkit.org
Browse files

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):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70118 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent f7800465
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 James Robinson <jamesr@chromium.org>
 
Remove test expectations entries for tests that consistently pass.
<html>
<head>
<style>
div {
-webkit-transform: scale(2.7937);
background-image: url('./resources/pixel-crack-image-background-webkit-transform-scale.png');
background-position: 16px 16px;
height: 16px;
width: 16px;
position:absolute;
}
</style>
<script type = "text/javascript">
function runTest()
{
for (var j=6; j<=35; ++j)
for (var i=1; i<=40; ++i) {
var div = document.createElement('div');
div.style.left = i*12;
div.style.top = j*12;
document.body.appendChild(div);
}
}
</script>
</head>
<body onload="runTest()">
<p>
Test pixel cracks when background sprite is transformed with scale. Need to run pixel test to verify if it is successful.
</p>
</body>
</html>
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):
2010-10-19 Evan Martin <evan@chromium.org>
 
Reviewed by Tony Chang.
......@@ -185,7 +185,7 @@ void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& destRect, const F
// containing only the portion we want to display. We need to do this because high-quality
// interpolation smoothes sharp edges, causing pixels from outside the source rect to bleed
// into the destination rect. See <rdar://problem/6112909>.
shouldUseSubimage = (interpolationQuality == kCGInterpolationHigh || interpolationQuality == kCGInterpolationDefault) && srcRect.size() != destRect.size();
shouldUseSubimage = (interpolationQuality == kCGInterpolationHigh || interpolationQuality == kCGInterpolationDefault) && (srcRect.size() != destRect.size() || !ctxt->getCTM().isIdentityOrTranslationOrFlipped());
float xScale = srcRect.width() / destRect.width();
float yScale = srcRect.height() / destRect.height();
if (shouldUseSubimage) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment