Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1688)

Unified Diff: Source/platform/graphics/skia/NativeImageSkia.cpp

Issue 262263003: Always use AwesomeResampling for lazy decoded images. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: address review feedback Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698