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

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: 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..cab5404a337ab624e6464788a034aac0c5e1d6e3 100644
--- a/Source/platform/graphics/skia/NativeImageSkia.cpp
+++ b/Source/platform/graphics/skia/NativeImageSkia.cpp
@@ -375,11 +375,15 @@ void NativeImageSkia::draw(GraphicsContext* context, const SkRect& srcRect, cons
paint.setLooper(context->drawLooper());
paint.setAntiAlias(shouldDrawAntiAliased(context, destRect));
+ bool isLazyDecoded = DeferredImageDecoder::isLazyDecoded(bitmap());
+
ResamplingMode resampling;
Alpha Left Google 2014/05/06 19:05:28 I suggest this be changed to default to AwsomeResa
reveman 2014/05/07 14:32:05 Done.
if (context->isAccelerated()) {
resampling = LinearResampling;
} else if (context->printing()) {
resampling = NoResampling;
+ } else if (isLazyDecoded) {
+ resampling = AwesomeResampling;
Alpha Left Google 2014/05/06 19:05:28 Reading this code again. I think this code is corr
reveman 2014/05/07 14:32:05 Done.
Stephen White 2014/05/07 18:16:31 Sorry, but I disagree. I much prefer the way David
reveman 2014/05/07 19:00:46 Done.
} else {
// Take into account scale applied to the canvas when computing sampling mode (e.g. CSS scale or page scale).
SkRect destRectTarget = destRect;
@@ -400,7 +404,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,10 +472,14 @@ void NativeImageSkia::drawPattern(
float destBitmapWidth = SkScalarToFloat(destRectTarget.width());
float destBitmapHeight = SkScalarToFloat(destRectTarget.height());
+ bool isLazyDecoded = DeferredImageDecoder::isLazyDecoded(bitmap());
+
// Compute the resampling mode.
ResamplingMode resampling;
Alpha Left Google 2014/05/06 19:05:28 Same here. Default to AwsomeResampling please.
reveman 2014/05/07 14:32:05 Done.
if (context->isAccelerated() || context->printing())
resampling = LinearResampling;
+ else if (isLazyDecoded)
+ resampling = AwesomeResampling;
else
Alpha Left Google 2014/05/06 19:05:28 I suggest this be else if (!isLazyDecoded).
reveman 2014/05/07 14:32:05 Done.
resampling = computeResamplingMode(totalMatrix, normSrcRect.width(), normSrcRect.height(), destBitmapWidth, destBitmapHeight);
resampling = limitResamplingMode(context, resampling);
@@ -480,7 +487,6 @@ void NativeImageSkia::drawPattern(
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