Changeset 68574 in webkit
- Timestamp:
- Sep 28, 2010 3:26:00 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r68568 r68574 1 2010-09-28 W. James MacLean <wjmaclean@chromium.org> 2 3 Reviewed by James Robinson. 4 5 Scaled Resized images are blurred when sent to Skia 6 https://bugs.webkit.org/show_bug.cgi?id=42370 7 8 * platform/chromium-linux/svg/custom/image-rescale-expected.checksum: Added. 9 * platform/chromium-linux/svg/custom/image-rescale-expected.png: Added. 10 * platform/chromium-linux/svg/custom/image-rescale-expected.txt: Added. 11 * platform/chromium/test_expectations.txt: 12 * platform/mac/svg/custom/image-rescale-expected.checksum: Added. 13 * platform/mac/svg/custom/image-rescale-expected.png: Added. 14 * platform/mac/svg/custom/image-rescale-expected.txt: Added. 15 * svg/custom/image-rescale.svg: Added. 16 * svg/custom/resources/image-rescale.jpg: Added. 17 1 18 2010-09-28 Matthew Delaney <mdelaney@apple.com> 2 19 -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r68543 r68574 836 836 BUGWK44514 MAC : fast/backgrounds/svg-as-background-6.html = IMAGE 837 837 BUGWK44514 MAC : svg/zoom/page/zoom-mask-with-percentages.svg = IMAGE 838 839 // Will require rebaseline. 840 BUGWK42370 WIN MAC : svg/custom/image-rescale.svg = FAIL 838 841 839 842 // ----------------------------------------------------------------- -
trunk/WebCore/ChangeLog
r68571 r68574 1 2010-09-28 W. James MacLean <wjmaclean@chromium.org> 2 3 Reviewed by James Robinson. 4 5 Scaled Resized images are blurred when sent to Skia 6 https://bugs.webkit.org/show_bug.cgi?id=42370 7 8 This patch modifies ImageSkia.cpp to fix the calculation of resampled 9 bitmap sizes so as to include the transform matrix of the canvas. 10 11 Test: svg/custom/image-rescale.svg 12 13 * platform/graphics/skia/ImageSkia.cpp: 14 (WebCore::computeResamplingMode): 15 (WebCore::drawResampledBitmap): 16 1 17 2010-09-28 James Robinson <jamesr@chromium.org> 2 18 -
trunk/WebCore/platform/graphics/skia/ImageSkia.cpp
r68000 r68574 144 144 // Everything else gets resampled. 145 145 // If the platform context permits high quality interpolation, use it. 146 if (platformContext->interpolationQuality() == InterpolationHigh) 146 // High quality interpolation only enabled for scaling and translation. 147 if (platformContext->interpolationQuality() == InterpolationHigh 148 && !(platformContext->canvas()->getTotalMatrix().getType() & (SkMatrix::kAffine_Mask | SkMatrix::kPerspective_Mask))) 147 149 return RESAMPLE_AWESOME; 148 150 … … 174 176 175 177 // We will always draw in integer sizes, so round the destination rect. 178 // First we need to apply canvas transformation matrix to get desired size of 179 // resampled image. 180 SkRect destRectTransformed; 181 canvas.getTotalMatrix().mapRect(&destRectTransformed, destRect); 176 182 SkIRect destRectRounded; 177 destRect .round(&destRectRounded);183 destRectTransformed.round(&destRectRounded); 178 184 SkIRect resizedImageRect = // Represents the size of the resized image. 179 185 { 0, 0, destRectRounded.width(), destRectRounded.height() }; … … 189 195 SkRect destBitmapSubsetSk; 190 196 ClipRectToCanvas(canvas, destRect, &destBitmapSubsetSk); 191 destBitmapSubsetSk.offset(-destRect.fLeft, -destRect.fTop); 197 // Determine size of resampled image based on clipped destination rect. 198 SkRect destBitmapSubsetSkTransformed; 199 canvas.getTotalMatrix().mapRect(&destBitmapSubsetSkTransformed, destBitmapSubsetSk); 200 destBitmapSubsetSkTransformed.offset(-destBitmapSubsetSkTransformed.fLeft, -destBitmapSubsetSkTransformed.fTop); 192 201 193 202 // The matrix inverting, etc. could have introduced rounding error which … … 197 206 // data. 198 207 SkIRect destBitmapSubsetSkI; 199 destBitmapSubsetSk .roundOut(&destBitmapSubsetSkI);208 destBitmapSubsetSkTransformed.roundOut(&destBitmapSubsetSkI); 200 209 if (!destBitmapSubsetSkI.intersect(resizedImageRect)) 201 210 return; // Resized image does not intersect.
Note: See TracChangeset
for help on using the changeset viewer.