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

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

Issue 336693005: Add image-rendering: pixelated. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update svg test 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;
Mike Lawther (Google) 2014/06/20 04:26:50 These should really be the same, ie InterpolationN
jackhou 2014/06/20 07:14:44 Done.
jackhou 2014/06/20 08:35:42 I realized this would require updating all the tes
+ break;
+ case ImageRenderingPixelated:
+ interpolationQuality = InterpolationNone;
Mike Lawther (Google) 2014/06/20 04:26:50 Strictly according to spec, we only use nearest ne
jackhou 2014/06/20 07:14:44 Done.
+ 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