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" |
11 #include "core/frame/LocalFrame.h" | 11 #include "core/frame/LocalFrame.h" |
12 #include "core/html/HTMLAreaElement.h" | 12 #include "core/html/HTMLAreaElement.h" |
13 #include "core/html/HTMLImageElement.h" | 13 #include "core/html/HTMLImageElement.h" |
14 #include "core/layout/LayoutImage.h" | 14 #include "core/layout/LayoutImage.h" |
| 15 #include "core/layout/LayoutReplaced.h" |
15 #include "core/layout/PaintInfo.h" | 16 #include "core/layout/PaintInfo.h" |
16 #include "core/layout/TextRunConstructor.h" | 17 #include "core/layout/TextRunConstructor.h" |
17 #include "core/page/Page.h" | 18 #include "core/page/Page.h" |
18 #include "core/paint/BoxPainter.h" | 19 #include "core/paint/BoxPainter.h" |
19 #include "core/paint/RenderDrawingRecorder.h" | 20 #include "core/paint/RenderDrawingRecorder.h" |
20 #include "core/rendering/RenderReplaced.h" | |
21 #include "platform/geometry/LayoutPoint.h" | 21 #include "platform/geometry/LayoutPoint.h" |
22 #include "platform/graphics/Path.h" | 22 #include "platform/graphics/Path.h" |
23 | 23 |
24 namespace blink { | 24 namespace blink { |
25 | 25 |
26 void ImagePainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOff
set) | 26 void ImagePainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOff
set) |
27 { | 27 { |
28 m_layoutImage.RenderReplaced::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 (document.printing() || !document.frame()->selection().isFocusedAndActive
()) |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 | 133 |
134 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage", "
data", InspectorPaintImageEvent::data(m_layoutImage)); | 134 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage", "
data", InspectorPaintImageEvent::data(m_layoutImage)); |
135 | 135 |
136 InterpolationQuality previousInterpolationQuality = context->imageInterpolat
ionQuality(); | 136 InterpolationQuality previousInterpolationQuality = context->imageInterpolat
ionQuality(); |
137 context->setImageInterpolationQuality(interpolationQuality); | 137 context->setImageInterpolationQuality(interpolationQuality); |
138 context->drawImage(image.get(), alignedRect, SkXfermode::kSrcOver_Mode, m_la
youtImage.shouldRespectImageOrientation()); | 138 context->drawImage(image.get(), alignedRect, SkXfermode::kSrcOver_Mode, m_la
youtImage.shouldRespectImageOrientation()); |
139 context->setImageInterpolationQuality(previousInterpolationQuality); | 139 context->setImageInterpolationQuality(previousInterpolationQuality); |
140 } | 140 } |
141 | 141 |
142 } // namespace blink | 142 } // namespace blink |
OLD | NEW |