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/InlinePainter.h" | 6 #include "core/paint/InlinePainter.h" |
7 | 7 |
8 #include "core/paint/BoxPainter.h" | 8 #include "core/paint/BoxPainter.h" |
| 9 #include "core/paint/DrawingRecorder.h" |
9 #include "core/paint/LineBoxListPainter.h" | 10 #include "core/paint/LineBoxListPainter.h" |
10 #include "core/paint/ObjectPainter.h" | 11 #include "core/paint/ObjectPainter.h" |
11 #include "core/rendering/GraphicsContextAnnotator.h" | 12 #include "core/rendering/GraphicsContextAnnotator.h" |
12 #include "core/rendering/PaintInfo.h" | 13 #include "core/rendering/PaintInfo.h" |
| 14 #include "core/rendering/RenderBlock.h" |
13 #include "core/rendering/RenderInline.h" | 15 #include "core/rendering/RenderInline.h" |
14 #include "core/rendering/RenderTheme.h" | 16 #include "core/rendering/RenderTheme.h" |
15 #include "core/rendering/RootInlineBox.h" | 17 #include "core/rendering/RootInlineBox.h" |
16 #include "platform/geometry/LayoutPoint.h" | 18 #include "platform/geometry/LayoutPoint.h" |
17 | 19 |
18 namespace blink { | 20 namespace blink { |
19 | 21 |
20 void InlinePainter::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset) | 22 void InlinePainter::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset) |
21 { | 23 { |
22 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, &m_renderInline); | 24 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, &m_renderInline); |
23 LineBoxListPainter(*m_renderInline.lineBoxes()).paint(&m_renderInline, paint
Info, paintOffset); | 25 LineBoxListPainter(*m_renderInline.lineBoxes()).paint(&m_renderInline, paint
Info, paintOffset); |
24 } | 26 } |
25 | 27 |
26 void InlinePainter::paintOutline(PaintInfo& paintInfo, const LayoutPoint& paintO
ffset) | 28 void InlinePainter::paintOutline(PaintInfo& paintInfo, const LayoutPoint& paintO
ffset) |
27 { | 29 { |
28 RenderStyle* styleToUse = m_renderInline.style(); | 30 RenderStyle* styleToUse = m_renderInline.style(); |
29 if (!styleToUse->hasOutline()) | 31 if (!styleToUse->hasOutline()) |
30 return; | 32 return; |
31 | 33 |
| 34 LayoutRect bounds; |
| 35 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { |
| 36 // FIXME: Use tighter bounds. |
| 37 RenderBlock* cb = m_renderInline.containingBlock(); |
| 38 bounds = cb->visualOverflowRect(); |
| 39 bounds.moveBy(paintOffset); |
| 40 } |
| 41 DrawingRecorder recorder(paintInfo.context, &m_renderInline, paintInfo.phase
, bounds); |
| 42 |
32 if (styleToUse->outlineStyleIsAuto()) { | 43 if (styleToUse->outlineStyleIsAuto()) { |
33 if (RenderTheme::theme().shouldDrawDefaultFocusRing(&m_renderInline)) { | 44 if (RenderTheme::theme().shouldDrawDefaultFocusRing(&m_renderInline)) { |
34 // Only paint the focus ring by hand if the theme isn't able to draw
the focus ring. | 45 // Only paint the focus ring by hand if the theme isn't able to draw
the focus ring. |
35 ObjectPainter(m_renderInline).paintFocusRing(paintInfo, paintOffset,
styleToUse); | 46 ObjectPainter(m_renderInline).paintFocusRing(paintInfo, paintOffset,
styleToUse); |
36 } | 47 } |
37 return; | 48 return; |
38 } | 49 } |
39 | 50 |
40 if (styleToUse->outlineStyle() == BNONE) | 51 if (styleToUse->outlineStyle() == BNONE) |
41 return; | 52 return; |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 pixelSnappedBox.maxX() + outlineWidth, | 188 pixelSnappedBox.maxX() + outlineWidth, |
178 pixelSnappedBox.maxY() + outlineWidth, | 189 pixelSnappedBox.maxY() + outlineWidth, |
179 BSBottom, outlineColor, outlineStyle, | 190 BSBottom, outlineColor, outlineStyle, |
180 outlineWidth, | 191 outlineWidth, |
181 outlineWidth, | 192 outlineWidth, |
182 antialias); | 193 antialias); |
183 } | 194 } |
184 } | 195 } |
185 | 196 |
186 } // namespace blink | 197 } // namespace blink |
OLD | NEW |