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

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: also removed function from header file 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
« no previous file with comments | « Source/platform/graphics/GraphicsContext.cpp ('k') | Source/platform/graphics/skia/SkiaUtils.h » ('j') | 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 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;
-
+ bool isResampled = false;
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());
« no previous file with comments | « Source/platform/graphics/GraphicsContext.cpp ('k') | Source/platform/graphics/skia/SkiaUtils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698