Commit 446797c7 authored by fmalita@chromium.org's avatar fmalita@chromium.org

Remove unneeded flags from NativeImageSkia::drawPattern()

Minor cleanup: some suggestions didn't make it in the final version of
https://codereview.chromium.org/412353003/

R=schenney@chromium.org

Review URL: https://codereview.chromium.org/428573003

git-svn-id: svn://svn.chromium.org/blink/trunk@179039 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 4d5ed398
...@@ -258,14 +258,13 @@ void NativeImageSkia::drawPattern( ...@@ -258,14 +258,13 @@ void NativeImageSkia::drawPattern(
localMatrix.setTranslate(SkFloatToScalar(adjustedX), SkFloatToScalar(adjustedY)); localMatrix.setTranslate(SkFloatToScalar(adjustedX), SkFloatToScalar(adjustedY));
RefPtr<SkShader> shader; RefPtr<SkShader> shader;
SkPaint::FilterLevel filterLevel = static_cast<SkPaint::FilterLevel>(resampling);
// Bicubic filter is only applied to defer-decoded images, see // Bicubic filter is only applied to defer-decoded images, see
// NativeImageSkia::draw for details. // NativeImageSkia::draw for details.
bool useBicubicFilter = resampling == InterpolationHigh && isLazyDecoded; if (resampling == InterpolationHigh && !isLazyDecoded) {
bool isResampled = false;
if (resampling == InterpolationHigh && !useBicubicFilter) {
// Do nice resampling. // Do nice resampling.
isResampled = true; filterLevel = SkPaint::kNone_FilterLevel;
float scaleX = destBitmapWidth / normSrcRect.width(); float scaleX = destBitmapWidth / normSrcRect.width();
float scaleY = destBitmapHeight / normSrcRect.height(); float scaleY = destBitmapHeight / normSrcRect.height();
SkRect scaledSrcRect; SkRect scaledSrcRect;
...@@ -311,7 +310,7 @@ void NativeImageSkia::drawPattern( ...@@ -311,7 +310,7 @@ void NativeImageSkia::drawPattern(
paint.setShader(shader.get()); paint.setShader(shader.get());
paint.setXfermode(WebCoreCompositeToSkiaComposite(compositeOp, blendMode).get()); paint.setXfermode(WebCoreCompositeToSkiaComposite(compositeOp, blendMode).get());
paint.setColorFilter(context->colorFilter()); paint.setColorFilter(context->colorFilter());
paint.setFilterLevel(isResampled ? SkPaint::kNone_FilterLevel : static_cast<SkPaint::FilterLevel>(resampling)); paint.setFilterLevel(filterLevel);
if (isLazyDecoded) if (isLazyDecoded)
PlatformInstrumentation::didDrawLazyPixelRef(bitmap().getGenerationID()); PlatformInstrumentation::didDrawLazyPixelRef(bitmap().getGenerationID());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment