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

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

Issue 428573003: Remove unneeded flags from NativeImageSkia::drawPattern() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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
« 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 1952f6b951dfb05d047ef6497c1f33b34ea0c0c6..b2f56642eeff57398394b23b204af52dd0df838b 100644
--- a/Source/platform/graphics/skia/NativeImageSkia.cpp
+++ b/Source/platform/graphics/skia/NativeImageSkia.cpp
@@ -258,14 +258,13 @@ void NativeImageSkia::drawPattern(
localMatrix.setTranslate(SkFloatToScalar(adjustedX), SkFloatToScalar(adjustedY));
RefPtr<SkShader> shader;
+ SkPaint::FilterLevel filterLevel = static_cast<SkPaint::FilterLevel>(resampling);
// 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) {
+ if (resampling == InterpolationHigh && !isLazyDecoded) {
// Do nice resampling.
- isResampled = true;
+ filterLevel = SkPaint::kNone_FilterLevel;
float scaleX = destBitmapWidth / normSrcRect.width();
float scaleY = destBitmapHeight / normSrcRect.height();
SkRect scaledSrcRect;
@@ -311,7 +310,7 @@ void NativeImageSkia::drawPattern(
paint.setShader(shader.get());
paint.setXfermode(WebCoreCompositeToSkiaComposite(compositeOp, blendMode).get());
paint.setColorFilter(context->colorFilter());
- paint.setFilterLevel(isResampled ? SkPaint::kNone_FilterLevel : static_cast<SkPaint::FilterLevel>(resampling));
+ paint.setFilterLevel(filterLevel);
if (isLazyDecoded)
PlatformInstrumentation::didDrawLazyPixelRef(bitmap().getGenerationID());
« 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