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

Unified Diff: Source/core/paint/ImagePainter.cpp

Issue 711163002: Don't anti-alias backgrounds of images. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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/paint/ImagePainter.cpp
diff --git a/Source/core/paint/ImagePainter.cpp b/Source/core/paint/ImagePainter.cpp
index 447ccd52abc0db56d7030db011ac1c2e4d8a1e30..6af6f15962d024a6839110b8bec50a5fe789c252 100644
--- a/Source/core/paint/ImagePainter.cpp
+++ b/Source/core/paint/ImagePainter.cpp
@@ -200,4 +200,13 @@ void ImagePainter::paintIntoRect(GraphicsContext* context, const LayoutRect& rec
InspectorInstrumentation::didPaintImage(&m_renderImage);
}
+void ImagePainter::paintBoxDecorationBackground(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
+{
+ // Don't anti-alias the background of an image. See crbug.com/423834 for the reason why.
+ bool oldShouldAntialias = paintInfo.context->shouldAntialias();
+ paintInfo.context->setShouldAntialias(false);
+ BoxPainter(m_renderImage).paintBoxDecorationBackground(paintInfo, paintOffset);
+ paintInfo.context->setShouldAntialias(oldShouldAntialias);
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698