| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 if (areaElement.imageElement() != m_renderImage.node()) | 47 if (areaElement.imageElement() != m_renderImage.node()) |
| 48 return; | 48 return; |
| 49 | 49 |
| 50 // Even if the theme handles focus ring drawing for entire elements, it won'
t do it for | 50 // Even if the theme handles focus ring drawing for entire elements, it won'
t do it for |
| 51 // an area within an image, so we don't call LayoutTheme::supportsFocusRing
here. | 51 // an area within an image, so we don't call LayoutTheme::supportsFocusRing
here. |
| 52 | 52 |
| 53 Path path = areaElement.computePath(&m_renderImage); | 53 Path path = areaElement.computePath(&m_renderImage); |
| 54 if (path.isEmpty()) | 54 if (path.isEmpty()) |
| 55 return; | 55 return; |
| 56 | 56 |
| 57 RenderStyle* areaElementStyle = areaElement.computedStyle(); | 57 const RenderStyle* areaElementStyle = areaElement.computedStyle(); |
| 58 unsigned short outlineWidth = areaElementStyle->outlineWidth(); | 58 unsigned short outlineWidth = areaElementStyle->outlineWidth(); |
| 59 if (!outlineWidth) | 59 if (!outlineWidth) |
| 60 return; | 60 return; |
| 61 | 61 |
| 62 IntRect focusRect = m_renderImage.absoluteContentBox(); | 62 IntRect focusRect = m_renderImage.absoluteContentBox(); |
| 63 | 63 |
| 64 RenderDrawingRecorder drawingRecorder(paintInfo.context, m_renderImage, pain
tInfo.phase, focusRect); | 64 RenderDrawingRecorder drawingRecorder(paintInfo.context, m_renderImage, pain
tInfo.phase, focusRect); |
| 65 if (drawingRecorder.canUseCachedDrawing()) | 65 if (drawingRecorder.canUseCachedDrawing()) |
| 66 return; | 66 return; |
| 67 | 67 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 138 |
| 139 InterpolationQuality previousInterpolationQuality = context->imageInterpolat
ionQuality(); | 139 InterpolationQuality previousInterpolationQuality = context->imageInterpolat
ionQuality(); |
| 140 context->setImageInterpolationQuality(interpolationQuality); | 140 context->setImageInterpolationQuality(interpolationQuality); |
| 141 context->drawImage(image.get(), alignedRect, SkXfermode::kSrcOver_Mode, m_re
nderImage.shouldRespectImageOrientation()); | 141 context->drawImage(image.get(), alignedRect, SkXfermode::kSrcOver_Mode, m_re
nderImage.shouldRespectImageOrientation()); |
| 142 context->setImageInterpolationQuality(previousInterpolationQuality); | 142 context->setImageInterpolationQuality(previousInterpolationQuality); |
| 143 | 143 |
| 144 InspectorInstrumentation::didPaintImage(&m_renderImage); | 144 InspectorInstrumentation::didPaintImage(&m_renderImage); |
| 145 } | 145 } |
| 146 | 146 |
| 147 } // namespace blink | 147 } // namespace blink |
| OLD | NEW |