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

Unified Diff: Source/core/rendering/RenderHTMLCanvas.cpp

Issue 336693005: Add image-rendering: pixelated. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Don't add 'pixelated' to devtools. Created 6 years, 6 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/core/rendering/RenderHTMLCanvas.cpp
diff --git a/Source/core/rendering/RenderHTMLCanvas.cpp b/Source/core/rendering/RenderHTMLCanvas.cpp
index 41a294209064a7e9999a021ad08e49db18a7d5c8..fd7f60230c7435f9abba554dd66900afabd1f2f3 100644
--- a/Source/core/rendering/RenderHTMLCanvas.cpp
+++ b/Source/core/rendering/RenderHTMLCanvas.cpp
@@ -68,6 +68,13 @@ void RenderHTMLCanvas::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& pa
// FIXME: InterpolationNone should be used if ImageRenderingOptimizeContrast is set.
// See bug for more details: crbug.com/353716.
InterpolationQuality interpolationQuality = style()->imageRendering() == ImageRenderingOptimizeContrast ? InterpolationLow : CanvasDefaultInterpolationQuality;
+
+ // FIXME: This ImageRenderingPixelated should only be InterpolationNone when
+ // upscaling. It should be the same as ImageRenderingAuto when downscaling.
+ // See crbug.com/386944.
+ if (style()->imageRendering() == ImageRenderingPixelated)
+ interpolationQuality = InterpolationNone;
+
InterpolationQuality previousInterpolationQuality = context->imageInterpolationQuality();
context->setImageInterpolationQuality(interpolationQuality);
toHTMLCanvasElement(node())->paint(context, paintRect);
« no previous file with comments | « Source/core/rendering/ImageQualityController.cpp ('k') | Source/core/rendering/style/RenderStyleConstants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698