Index: Source/platform/graphics/skia/NativeImageSkia.cpp |
diff --git a/Source/platform/graphics/skia/NativeImageSkia.cpp b/Source/platform/graphics/skia/NativeImageSkia.cpp |
index f3a4967b05698379378b1cc40e87f525a0348bfa..4d96445ef2ac636ea694476c8930d2814d5cebea 100644 |
--- a/Source/platform/graphics/skia/NativeImageSkia.cpp |
+++ b/Source/platform/graphics/skia/NativeImageSkia.cpp |
@@ -375,12 +375,14 @@ void NativeImageSkia::draw(GraphicsContext* context, const SkRect& srcRect, cons |
paint.setLooper(context->drawLooper()); |
paint.setAntiAlias(shouldDrawAntiAliased(context, destRect)); |
- ResamplingMode resampling; |
+ bool isLazyDecoded = DeferredImageDecoder::isLazyDecoded(bitmap()); |
+ |
+ ResamplingMode resampling = AwesomeResampling; |
if (context->isAccelerated()) { |
resampling = LinearResampling; |
} else if (context->printing()) { |
resampling = NoResampling; |
- } else { |
+ } else if (!isLazyDecoded) { |
// Take into account scale applied to the canvas when computing sampling mode (e.g. CSS scale or page scale). |
SkRect destRectTarget = destRect; |
SkMatrix totalMatrix = context->getTotalMatrix(); |
@@ -400,7 +402,6 @@ void NativeImageSkia::draw(GraphicsContext* context, const SkRect& srcRect, cons |
} |
resampling = limitResamplingMode(context, resampling); |
- bool isLazyDecoded = DeferredImageDecoder::isLazyDecoded(bitmap()); |
// FIXME: Bicubic filtering in Skia is only applied to defer-decoded images |
// as an experiment. Once this filtering code path becomes stable we should |
// turn this on for all cases, including non-defer-decoded images. |
@@ -469,18 +470,19 @@ void NativeImageSkia::drawPattern( |
float destBitmapWidth = SkScalarToFloat(destRectTarget.width()); |
float destBitmapHeight = SkScalarToFloat(destRectTarget.height()); |
+ bool isLazyDecoded = DeferredImageDecoder::isLazyDecoded(bitmap()); |
+ |
// Compute the resampling mode. |
- ResamplingMode resampling; |
+ ResamplingMode resampling = AwesomeResampling; |
Stephen White
2014/05/07 18:16:31
Same here.
reveman
2014/05/07 19:00:46
Done.
|
if (context->isAccelerated() || context->printing()) |
resampling = LinearResampling; |
- else |
+ else if (!isLazyDecoded) |
resampling = computeResamplingMode(totalMatrix, normSrcRect.width(), normSrcRect.height(), destBitmapWidth, destBitmapHeight); |
resampling = limitResamplingMode(context, resampling); |
SkMatrix shaderTransform; |
RefPtr<SkShader> shader; |
- bool isLazyDecoded = DeferredImageDecoder::isLazyDecoded(bitmap()); |
// Bicubic filter is only applied to defer-decoded images, see |
// NativeImageSkia::draw for details. |
bool useBicubicFilter = resampling == AwesomeResampling && isLazyDecoded; |