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

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

Issue 412353003: Remove convertToSkiaFilterLevel() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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
Index: Source/platform/graphics/skia/NativeImageSkia.cpp
diff --git a/Source/platform/graphics/skia/NativeImageSkia.cpp b/Source/platform/graphics/skia/NativeImageSkia.cpp
index 618669d9e6dfbd78fbadf9fe6febb6389bd18238..1952f6b951dfb05d047ef6497c1f33b34ea0c0c6 100644
--- a/Source/platform/graphics/skia/NativeImageSkia.cpp
+++ b/Source/platform/graphics/skia/NativeImageSkia.cpp
@@ -262,9 +262,10 @@ void NativeImageSkia::drawPattern(
// Bicubic filter is only applied to defer-decoded images, see
// NativeImageSkia::draw for details.
bool useBicubicFilter = resampling == InterpolationHigh && isLazyDecoded;
f(malita) 2014/07/25 15:20:03 I just realized that we don't need useBicubicFilte
-
+ bool isResampled = false;
f(malita) 2014/07/25 15:06:36 Instead of a new flag, I think it would be clearer
if (resampling == InterpolationHigh && !useBicubicFilter) {
// Do nice resampling.
+ isResampled = true;
float scaleX = destBitmapWidth / normSrcRect.width();
float scaleY = destBitmapHeight / normSrcRect.height();
SkRect scaledSrcRect;
@@ -310,7 +311,7 @@ void NativeImageSkia::drawPattern(
paint.setShader(shader.get());
paint.setXfermode(WebCoreCompositeToSkiaComposite(compositeOp, blendMode).get());
paint.setColorFilter(context->colorFilter());
- paint.setFilterLevel(convertToSkiaFilterLevel(useBicubicFilter, resampling));
+ paint.setFilterLevel(isResampled ? SkPaint::kNone_FilterLevel : static_cast<SkPaint::FilterLevel>(resampling));
if (isLazyDecoded)
PlatformInstrumentation::didDrawLazyPixelRef(bitmap().getGenerationID());

Powered by Google App Engine
This is Rietveld 408576698