Changeset 46002 in webkit
- Timestamp:
- Jul 16, 2009, 5:47:47 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r45999 r46002 1 2009-07-16 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Simon Fraser. 4 5 REGRESSION (r41238) Repainted portion of a scaled image does not line up with full image 6 https://bugs.webkit.org/show_bug.cgi?id=26747 7 rdar://problem/7009243 8 9 * fast/repaint/background-misaligned.html: Added. 10 * platform/mac/fast/backgrounds/size/backgroundSize15-expected.checksum: 11 * platform/mac/fast/backgrounds/size/backgroundSize15-expected.png: 12 * platform/mac/fast/borders/border-image-rotate-transform-expected.checksum: 13 * platform/mac/fast/borders/border-image-rotate-transform-expected.png: 14 * platform/mac/fast/repaint/background-misaligned-expected.checksum: Added. 15 * platform/mac/fast/repaint/background-misaligned-expected.png: Added. 16 * platform/mac/fast/repaint/background-misaligned-expected.txt: Added. 17 1 18 2009-07-16 Adam Barth <abarth@webkit.org> 2 19 -
trunk/LayoutTests/platform/mac/fast/backgrounds/size/backgroundSize15-expected.checksum
r38121 r46002 1 89976d505fed69efe0567a33826f55e5 1 53b43a341ede2d5fa5bd7466300e5e3a -
trunk/LayoutTests/platform/mac/fast/borders/border-image-rotate-transform-expected.checksum
r38008 r46002 1 d125613bee8d4934e96c382f8ff1d2e4 1 0cf932e7fd01d2f2d35a2173d17c6bc7 -
trunk/WebCore/ChangeLog
r46001 r46002 1 2009-07-16 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Simon Fraser. 4 5 REGRESSION (r41238) Repainted portion of a scaled image does not line up with full image 6 https://bugs.webkit.org/show_bug.cgi?id=26747 7 rdar://problem/7009243 8 9 Test: fast/repaint/background-misaligned.html 10 11 * platform/graphics/Image.cpp: 12 (WebCore::Image::drawTiled): Moved a variable definition closer to where 13 it is used. 14 * platform/graphics/cg/ImageCG.cpp: 15 (WebCore::BitmapImage::draw): In the subimage code path, compute a 16 pixel-aligned source rect, because the subiamge is always pixel-aligned 17 in source space, and adjust the destination rect to preserve the 18 source -> destination mapping. Clip to the (original) destination rect 19 to prevent bleeding out. 20 1 21 2009-07-16 Jeremy Orlow <jorlow@chromium.org> 2 22 -
trunk/WebCore/platform/graphics/Image.cpp
r40761 r46002 120 120 FloatSize scale(scaledTileSize.width() / intrinsicTileSize.width(), 121 121 scaledTileSize.height() / intrinsicTileSize.height()); 122 TransformationMatrix patternTransform = TransformationMatrix().scaleNonUniform(scale.width(), scale.height());123 122 124 123 FloatRect oneTileRect; … … 138 137 } 139 138 139 TransformationMatrix patternTransform = TransformationMatrix().scaleNonUniform(scale.width(), scale.height()); 140 140 FloatRect tileRect(FloatPoint(), intrinsicTileSize); 141 141 drawPattern(ctxt, tileRect, patternTransform, oneTileRect.location(), op, destRect); -
trunk/WebCore/platform/graphics/cg/ImageCG.cpp
r45780 r46002 167 167 // into the destination rect. See <rdar://problem/6112909>. 168 168 shouldUseSubimage = (interpolationQuality == kCGInterpolationHigh || interpolationQuality == kCGInterpolationDefault) && srcRect.size() != destRect.size(); 169 float xScale = srcRect.width() / destRect.width(); 170 float yScale = srcRect.height() / destRect.height(); 169 171 if (shouldUseSubimage) { 170 image = CGImageCreateWithImageInRect(image, srcRect); 172 FloatRect subimageRect = srcRect; 173 float leftPadding = srcRect.x() - floorf(srcRect.x()); 174 float topPadding = srcRect.y() - floorf(srcRect.y()); 175 176 subimageRect.move(-leftPadding, -topPadding); 177 adjustedDestRect.move(-leftPadding / xScale, -topPadding / yScale); 178 179 subimageRect.setWidth(ceilf(subimageRect.width() + leftPadding)); 180 adjustedDestRect.setWidth(subimageRect.width() / xScale); 181 182 subimageRect.setHeight(ceilf(subimageRect.height() + topPadding)); 183 adjustedDestRect.setHeight(subimageRect.height() / yScale); 184 185 image = CGImageCreateWithImageInRect(image, subimageRect); 171 186 if (currHeight < srcRect.bottom()) { 172 187 ASSERT(CGImageGetHeight(image) == currHeight - CGRectIntegral(srcRect).origin.y); 173 adjustedDestRect.setHeight( destRect.height() / srcRect.height() * CGImageGetHeight(image));188 adjustedDestRect.setHeight(CGImageGetHeight(image) / yScale); 174 189 } 175 190 } else { 176 float xScale = srcRect.width() / destRect.width();177 float yScale = srcRect.height() / destRect.height();178 179 191 adjustedDestRect.setLocation(FloatPoint(destRect.x() - srcRect.x() / xScale, destRect.y() - srcRect.y() / yScale)); 180 192 adjustedDestRect.setSize(FloatSize(selfSize.width() / xScale, selfSize.height() / yScale)); 181 182 CGContextClipToRect(context, destRect);183 193 } 194 195 CGContextClipToRect(context, destRect); 184 196 } 185 197 … … 188 200 adjustedDestRect.setHeight(adjustedDestRect.height() * currHeight / selfSize.height()); 189 201 202 ctxt->setCompositeOperation(compositeOp); 203 190 204 // Flip the coords. 191 ctxt->setCompositeOperation(compositeOp);192 CGContextTranslateCTM(context, adjustedDestRect.x(), adjustedDestRect.bottom());193 205 CGContextScaleCTM(context, 1, -1); 194 adjustedDestRect.set Location(FloatPoint());206 adjustedDestRect.setY(-adjustedDestRect.bottom()); 195 207 196 208 // Draw the image.
Note:
See TracChangeset
for help on using the changeset viewer.