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 17 matching lines...) Expand all Loading... |
28 m_layoutImage.LayoutReplaced::paint(paintInfo, paintOffset); | 28 m_layoutImage.LayoutReplaced::paint(paintInfo, paintOffset); |
29 | 29 |
30 if (paintInfo.phase == PaintPhaseOutline) | 30 if (paintInfo.phase == PaintPhaseOutline) |
31 paintAreaElementFocusRing(paintInfo); | 31 paintAreaElementFocusRing(paintInfo); |
32 } | 32 } |
33 | 33 |
34 void ImagePainter::paintAreaElementFocusRing(const PaintInfo& paintInfo) | 34 void ImagePainter::paintAreaElementFocusRing(const PaintInfo& paintInfo) |
35 { | 35 { |
36 Document& document = m_layoutImage.document(); | 36 Document& document = m_layoutImage.document(); |
37 | 37 |
38 if (document.printing() || !document.frame()->selection().isFocusedAndActive
()) | 38 if (paintInfo.printing() || !document.frame()->selection().isFocusedAndActiv
e()) |
39 return; | 39 return; |
40 | 40 |
41 Element* focusedElement = document.focusedElement(); | 41 Element* focusedElement = document.focusedElement(); |
42 if (!isHTMLAreaElement(focusedElement)) | 42 if (!isHTMLAreaElement(focusedElement)) |
43 return; | 43 return; |
44 | 44 |
45 HTMLAreaElement& areaElement = toHTMLAreaElement(*focusedElement); | 45 HTMLAreaElement& areaElement = toHTMLAreaElement(*focusedElement); |
46 if (areaElement.imageElement() != m_layoutImage.node()) | 46 if (areaElement.imageElement() != m_layoutImage.node()) |
47 return; | 47 return; |
48 | 48 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 | 136 |
137 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage", "
data", InspectorPaintImageEvent::data(m_layoutImage)); | 137 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage", "
data", InspectorPaintImageEvent::data(m_layoutImage)); |
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_la
youtImage.shouldRespectImageOrientation()); | 141 context->drawImage(image.get(), alignedRect, SkXfermode::kSrcOver_Mode, m_la
youtImage.shouldRespectImageOrientation()); |
142 context->setImageInterpolationQuality(previousInterpolationQuality); | 142 context->setImageInterpolationQuality(previousInterpolationQuality); |
143 } | 143 } |
144 | 144 |
145 } // namespace blink | 145 } // namespace blink |
OLD | NEW |