Changeset 117187 in webkit
- Timestamp:
- May 15, 2012 4:52:58 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r117175 r117187 1 2012-05-15 Keyar Hood <keyar@chromium.org> 2 3 Skia does not respect a specified InterpolationQuality 4 https://bugs.webkit.org/show_bug.cgi?id=86249 5 6 Reviewed by Stephen White. 7 8 Now expecting the following to tests to have an IMAGE failure: 9 svg/custom/pointer-events-image-css-transform.svg 10 svg/custom/pointer-events-image.svg 11 * platform/chromium/test_expectations.txt: 12 1 13 2012-05-15 Philippe Normand <pnormand@igalia.com> 2 14 -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r117128 r117187 1294 1294 BUGWK85107 : svg/as-image/svg-as-relative-image-with-explicit-size.html = PASS IMAGE 1295 1295 1296 // Tests need rebaseling. 1297 // Failed due to changes used to fix bug 82804 while maintaining test 1298 // consistency. 1299 BUGWK86486 : svg/custom/pointer-events-image-css-transform.svg = IMAGE 1300 BUGWK86486 : svg/custom/pointer-events-image.svg = IMAGE 1301 1296 1302 // ----------------------------------------------------------------- 1297 1303 // End SVG TESTS -
trunk/Source/WebCore/ChangeLog
r117185 r117187 1 2012-05-15 Keyar Hood <keyar@chromium.org> 2 3 Skia does not respect a specified InterpolationQuality 4 https://bugs.webkit.org/show_bug.cgi?id=86249 5 6 Reviewed by Stephen White. 7 8 The added functionality is not exposed to higher layers of webkit. 9 Tests will be added that will exercise these changes when bug 82804 is 10 fixed. 11 12 * platform/graphics/GraphicsContext.cpp: 13 (WebCore::GraphicsContext::drawImage): 14 (WebCore::GraphicsContext::drawImageBuffer): 15 Code to have the useLowQualityScale cause the InterpolationQuality be 16 be set to low for Chromium but remain as none for other platforms. 17 * platform/graphics/skia/ImageSkia.cpp: 18 (WebCore::limitResamplingMode): Added 19 (WebCore): 20 (WebCore::paintSkBitmap): 21 (WebCore::Image::drawPattern): 22 We now limit the resampling choice based on what InterpolationQuality 23 is set as. InterpolationNone restricts resampling to RESAMPLE_NONE, 24 InterpolationLow and InterpolationMedium restricts resampling to 25 RESAMPLE_LINEAR. InterpolationHigh and InterpolationDefault do not 26 change the resampling. 27 28 Furthermore, the choice on how to set the filter bitmap flag in 29 paintSkBitmap was made to be consistent with that in 30 Image::drawPattern. 31 32 1 33 2012-05-15 Jeffrey Pfau <jpfau@apple.com> 2 34 -
trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp
r113486 r117187 483 483 if (useLowQualityScale) { 484 484 previousInterpolationQuality = imageInterpolationQuality(); 485 #if PLATFORM(CHROMIUM) 486 setImageInterpolationQuality(InterpolationLow); 487 #else 485 488 // FIXME (49002): Should be InterpolationLow 486 489 setImageInterpolationQuality(InterpolationNone); 490 #endif 487 491 } 488 492 … … 573 577 if (useLowQualityScale) { 574 578 InterpolationQuality previousInterpolationQuality = imageInterpolationQuality(); 579 #if PLATFORM(CHROMIUM) 580 setImageInterpolationQuality(InterpolationLow); 581 #else 575 582 // FIXME (49002): Should be InterpolationLow 576 583 setImageInterpolationQuality(InterpolationNone); 584 #endif 577 585 image->draw(this, styleColorSpace, FloatRect(dest.location(), FloatSize(tw, th)), FloatRect(src.location(), FloatSize(tsw, tsh)), op, useLowQualityScale); 578 586 setImageInterpolationQuality(previousInterpolationQuality); -
trunk/Source/WebCore/platform/graphics/skia/ImageSkia.cpp
r116907 r117187 147 147 148 148 // Everything else gets resampled. 149 // If the platform context permits high quality interpolation, use it.150 149 // High quality interpolation only enabled for scaling and translation. 151 if (platformContext->interpolationQuality() == InterpolationHigh 152 && !(platformContext->canvas()->getTotalMatrix().getType() & (SkMatrix::kAffine_Mask | SkMatrix::kPerspective_Mask))) 150 if (!(platformContext->canvas()->getTotalMatrix().getType() & (SkMatrix::kAffine_Mask | SkMatrix::kPerspective_Mask))) 153 151 return RESAMPLE_AWESOME; 154 152 155 153 return RESAMPLE_LINEAR; 154 } 155 156 static ResamplingMode limitResamplingMode(PlatformContextSkia* platformContext, ResamplingMode resampling) 157 { 158 switch (platformContext->interpolationQuality()) { 159 case InterpolationNone: 160 return RESAMPLE_NONE; 161 case InterpolationMedium: 162 // For now we treat InterpolationMedium and InterpolationLow the same. 163 case InterpolationLow: 164 if (resampling == RESAMPLE_AWESOME) 165 return RESAMPLE_LINEAR; 166 break; 167 case InterpolationHigh: 168 case InterpolationDefault: 169 break; 170 } 171 172 return resampling; 156 173 } 157 174 … … 225 242 SkPaint paint; 226 243 paint.setXfermodeMode(compOp); 227 paint.setFilterBitmap(true);228 244 paint.setAlpha(platformContext->getNormalizedAlpha()); 229 245 paint.setLooper(platformContext->getDrawLooper()); … … 239 255 resampling = platformContext->printing() ? RESAMPLE_NONE : 240 256 computeResamplingMode(platformContext, bitmap, srcRect.width(), srcRect.height(), SkScalarToFloat(destRect.width()), SkScalarToFloat(destRect.height())); 241 if (resampling == RESAMPLE_AWESOME) { 257 if (resampling == RESAMPLE_NONE) { 258 // FIXME: This is to not break tests (it results in the filter bitmap flag 259 // being set to true). We need to decide if we respect RESAMPLE_NONE 260 // being returned from computeResamplingMode. 261 resampling = RESAMPLE_LINEAR; 262 } 263 resampling = limitResamplingMode(platformContext, resampling); 264 paint.setFilterBitmap(resampling == RESAMPLE_LINEAR); 265 if (resampling == RESAMPLE_AWESOME) 242 266 drawResampledBitmap(*canvas, paint, bitmap, srcRect, destRect); 243 }else {267 else { 244 268 // No resampling necessary, we can just draw the bitmap. We want to 245 269 // filter it if we decided to do linear interpolation above, or if there … … 335 359 else 336 360 resampling = computeResamplingMode(context->platformContext(), *bitmap, srcRect.width(), srcRect.height(), destBitmapWidth, destBitmapHeight); 361 resampling = limitResamplingMode(context->platformContext(), resampling); 337 362 338 363 // Load the transform WebKit requested.
Note: See TracChangeset
for help on using the changeset viewer.