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

Unified Diff: Source/core/rendering/svg/RenderSVGImage.cpp

Issue 201513003: Implement InterpolationMedium to filter animated images (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: only ode change Created 6 years, 9 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/core/rendering/RenderImage.cpp ('k') | Source/platform/graphics/GraphicsContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/RenderSVGImage.cpp
diff --git a/Source/core/rendering/svg/RenderSVGImage.cpp b/Source/core/rendering/svg/RenderSVGImage.cpp
index 584bacb409ec7963422dba16a0fd8ba42417adf4..9f82cc600ee4df0cff6db7400a17af560a0ba95f 100644
--- a/Source/core/rendering/svg/RenderSVGImage.cpp
+++ b/Source/core/rendering/svg/RenderSVGImage.cpp
@@ -168,11 +168,14 @@ void RenderSVGImage::paintForeground(PaintInfo& paintInfo)
SVGImageElement* imageElement = toSVGImageElement(element());
imageElement->preserveAspectRatio()->currentValue()->transformRect(destRect, srcRect);
- bool useLowQualityScaling = false;
+ InterpolationQuality interpolationQuality = InterpolationDefault;
if (style()->svgStyle()->bufferedRendering() != BR_STATIC)
- useLowQualityScaling = ImageQualityController::imageQualityController()->shouldPaintAtLowQuality(paintInfo.context, this, image.get(), image.get(), LayoutSize(destRect.size()));
+ interpolationQuality = ImageQualityController::imageQualityController()->chooseInterpolationQuality(paintInfo.context, this, image.get(), image.get(), LayoutSize(destRect.size()));
- paintInfo.context->drawImage(image.get(), destRect, srcRect, CompositeSourceOver, DoNotRespectImageOrientation, useLowQualityScaling);
+ InterpolationQuality previousInterpolationQuality = paintInfo.context->imageInterpolationQuality();
+ paintInfo.context->setImageInterpolationQuality(interpolationQuality);
+ paintInfo.context->drawImage(image.get(), destRect, srcRect, CompositeSourceOver);
+ paintInfo.context->setImageInterpolationQuality(previousInterpolationQuality);
}
void RenderSVGImage::invalidateBufferedForeground()
« no previous file with comments | « Source/core/rendering/RenderImage.cpp ('k') | Source/platform/graphics/GraphicsContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698