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/LineBoxListPainter.h" | 9 #include "core/paint/LineBoxListPainter.h" |
10 #include "core/paint/ObjectPainter.h" | 10 #include "core/paint/ObjectPainter.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 if (!styleToUse->hasOutline()) | 31 if (!styleToUse->hasOutline()) |
32 return; | 32 return; |
33 | 33 |
34 LayoutRect bounds; | 34 LayoutRect bounds; |
35 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { | 35 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { |
36 // FIXME: Use tighter bounds. | 36 // FIXME: Use tighter bounds. |
37 RenderBlock* cb = m_renderInline.containingBlock(); | 37 RenderBlock* cb = m_renderInline.containingBlock(); |
38 bounds = cb->visualOverflowRect(); | 38 bounds = cb->visualOverflowRect(); |
39 bounds.moveBy(paintOffset); | 39 bounds.moveBy(paintOffset); |
40 } | 40 } |
41 RenderDrawingRecorder recorder(paintInfo.context, &m_renderInline, paintInfo
.phase, bounds); | 41 RenderDrawingRecorder recorder(paintInfo.context, m_renderInline, paintInfo.
phase, bounds); |
| 42 if (recorder.canUseCachedDrawing()) |
| 43 return; |
42 | 44 |
43 if (styleToUse->outlineStyleIsAuto()) { | 45 if (styleToUse->outlineStyleIsAuto()) { |
44 if (RenderTheme::theme().shouldDrawDefaultFocusRing(&m_renderInline)) { | 46 if (RenderTheme::theme().shouldDrawDefaultFocusRing(&m_renderInline)) { |
45 // Only paint the focus ring by hand if the theme isn't able to draw
the focus ring. | 47 // Only paint the focus ring by hand if the theme isn't able to draw
the focus ring. |
46 ObjectPainter(m_renderInline).paintFocusRing(paintInfo, paintOffset,
styleToUse); | 48 ObjectPainter(m_renderInline).paintFocusRing(paintInfo, paintOffset,
styleToUse); |
47 } | 49 } |
48 return; | 50 return; |
49 } | 51 } |
50 | 52 |
51 if (styleToUse->outlineStyle() == BNONE) | 53 if (styleToUse->outlineStyle() == BNONE) |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 pixelSnappedBox.maxX() + outlineWidth, | 190 pixelSnappedBox.maxX() + outlineWidth, |
189 pixelSnappedBox.maxY() + outlineWidth, | 191 pixelSnappedBox.maxY() + outlineWidth, |
190 BSBottom, outlineColor, outlineStyle, | 192 BSBottom, outlineColor, outlineStyle, |
191 outlineWidth, | 193 outlineWidth, |
192 outlineWidth, | 194 outlineWidth, |
193 antialias); | 195 antialias); |
194 } | 196 } |
195 } | 197 } |
196 | 198 |
197 } // namespace blink | 199 } // namespace blink |
OLD | NEW |