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

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

Issue 336693005: Add image-rendering: pixelated. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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..1aa23b1323f013123e407ad7c3ee5f95934c1d7c 100644
--- a/Source/core/rendering/RenderHTMLCanvas.cpp
+++ b/Source/core/rendering/RenderHTMLCanvas.cpp
@@ -67,7 +67,18 @@ 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;
+ InterpolationQuality interpolationQuality;
+ switch (style()->imageRendering()) {
+ case ImageRenderingOptimizeContrast:
+ interpolationQuality = InterpolationLow;
+ break;
+ case ImageRenderingPixelated:
+ interpolationQuality = InterpolationNone;
+ break;
+ default:
+ interpolationQuality = CanvasDefaultInterpolationQuality;
+ }
+
InterpolationQuality previousInterpolationQuality = context->imageInterpolationQuality();
context->setImageInterpolationQuality(interpolationQuality);
toHTMLCanvasElement(node())->paint(context, paintRect);

Powered by Google App Engine
This is Rietveld 408576698