| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "core/paint/ImagePainter.h" | 6 #include "core/paint/ImagePainter.h" |
| 7 | 7 |
| 8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
| 9 #include "core/dom/Element.h" | 9 #include "core/dom/Element.h" |
| 10 #include "core/editing/FrameSelection.h" | 10 #include "core/editing/FrameSelection.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 InspectorInstrumentation::willPaintImage(&m_renderImage); | 193 InspectorInstrumentation::willPaintImage(&m_renderImage); |
| 194 | 194 |
| 195 InterpolationQuality previousInterpolationQuality = context->imageInterpolat
ionQuality(); | 195 InterpolationQuality previousInterpolationQuality = context->imageInterpolat
ionQuality(); |
| 196 context->setImageInterpolationQuality(interpolationQuality); | 196 context->setImageInterpolationQuality(interpolationQuality); |
| 197 context->drawImage(image.get(), alignedRect, CompositeSourceOver, m_renderIm
age.shouldRespectImageOrientation()); | 197 context->drawImage(image.get(), alignedRect, CompositeSourceOver, m_renderIm
age.shouldRespectImageOrientation()); |
| 198 context->setImageInterpolationQuality(previousInterpolationQuality); | 198 context->setImageInterpolationQuality(previousInterpolationQuality); |
| 199 | 199 |
| 200 InspectorInstrumentation::didPaintImage(&m_renderImage); | 200 InspectorInstrumentation::didPaintImage(&m_renderImage); |
| 201 } | 201 } |
| 202 | 202 |
| 203 void ImagePainter::paintBoxDecorationBackground(PaintInfo& paintInfo, const Layo
utPoint& paintOffset) |
| 204 { |
| 205 // Don't anti-alias the background of an image. See crbug.com/423834 for the
reason why. |
| 206 bool oldShouldAntialias = paintInfo.context->shouldAntialias(); |
| 207 paintInfo.context->setShouldAntialias(false); |
| 208 BoxPainter(m_renderImage).paintBoxDecorationBackground(paintInfo, paintOffse
t); |
| 209 paintInfo.context->setShouldAntialias(oldShouldAntialias); |
| 210 } |
| 211 |
| 203 } // namespace blink | 212 } // namespace blink |
| OLD | NEW |