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/LineBoxListPainter.h" | 6 #include "core/paint/LineBoxListPainter.h" |
7 | 7 |
8 #include "core/paint/InlinePainter.h" | 8 #include "core/paint/InlinePainter.h" |
9 #include "core/paint/ViewDisplayList.h" | 9 #include "core/paint/ViewDisplayList.h" |
10 #include "core/rendering/InlineFlowBox.h" | 10 #include "core/rendering/InlineFlowBox.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 ASSERT(renderer->isRenderBlock() || (renderer->isRenderInline() && renderer-
>hasLayer())); // The only way an inline could paint like this is if it has a la
yer. | 26 ASSERT(renderer->isRenderBlock() || (renderer->isRenderInline() && renderer-
>hasLayer())); // The only way an inline could paint like this is if it has a la
yer. |
27 | 27 |
28 // If we have no lines then we have no work to do. | 28 // If we have no lines then we have no work to do. |
29 if (!m_renderLineBoxList.firstLineBox()) | 29 if (!m_renderLineBoxList.firstLineBox()) |
30 return; | 30 return; |
31 | 31 |
32 if (!m_renderLineBoxList.anyLineIntersectsRect(renderer, paintInfo.rect, pai
ntOffset)) | 32 if (!m_renderLineBoxList.anyLineIntersectsRect(renderer, paintInfo.rect, pai
ntOffset)) |
33 return; | 33 return; |
34 | 34 |
35 PaintInfo info(paintInfo); | 35 PaintInfo info(paintInfo); |
36 PaintCommandRecorder recorder(paintInfo.context, renderer, paintInfo.phase,
renderer->borderBoundingBox()); | 36 PaintCommandRecorder recorder(paintInfo.context, renderer, paintInfo.phase,
pixelSnappedIntRect(paintOffset, renderer->borderBoundingBox().size())); |
37 ListHashSet<RenderInline*> outlineObjects; | 37 ListHashSet<RenderInline*> outlineObjects; |
38 info.setOutlineObjects(&outlineObjects); | 38 info.setOutlineObjects(&outlineObjects); |
39 | 39 |
40 // See if our root lines intersect with the dirty rect. If so, then we paint | 40 // See if our root lines intersect with the dirty rect. If so, then we paint |
41 // them. Note that boxes can easily overlap, so we can't make any assumption
s | 41 // them. Note that boxes can easily overlap, so we can't make any assumption
s |
42 // based off positions of our first line box or our last line box. | 42 // based off positions of our first line box or our last line box. |
43 for (InlineFlowBox* curr = m_renderLineBoxList.firstLineBox(); curr; curr =
curr->nextLineBox()) { | 43 for (InlineFlowBox* curr = m_renderLineBoxList.firstLineBox(); curr; curr =
curr->nextLineBox()) { |
44 if (m_renderLineBoxList.lineIntersectsDirtyRect(renderer, curr, info, pa
intOffset)) { | 44 if (m_renderLineBoxList.lineIntersectsDirtyRect(renderer, curr, info, pa
intOffset)) { |
45 RootInlineBox& root = curr->root(); | 45 RootInlineBox& root = curr->root(); |
46 curr->paint(info, paintOffset, root.lineTop(), root.lineBottom()); | 46 curr->paint(info, paintOffset, root.lineTop(), root.lineBottom()); |
47 } | 47 } |
48 } | 48 } |
49 | 49 |
50 if (info.phase == PaintPhaseOutline || info.phase == PaintPhaseSelfOutline |
| info.phase == PaintPhaseChildOutlines) { | 50 if (info.phase == PaintPhaseOutline || info.phase == PaintPhaseSelfOutline |
| info.phase == PaintPhaseChildOutlines) { |
51 ListHashSet<RenderInline*>::iterator end = info.outlineObjects()->end(); | 51 ListHashSet<RenderInline*>::iterator end = info.outlineObjects()->end(); |
52 for (ListHashSet<RenderInline*>::iterator it = info.outlineObjects()->be
gin(); it != end; ++it) { | 52 for (ListHashSet<RenderInline*>::iterator it = info.outlineObjects()->be
gin(); it != end; ++it) { |
53 RenderInline* flow = *it; | 53 RenderInline* flow = *it; |
54 InlinePainter(*flow).paintOutline(info, paintOffset); | 54 InlinePainter(*flow).paintOutline(info, paintOffset); |
55 } | 55 } |
56 info.outlineObjects()->clear(); | 56 info.outlineObjects()->clear(); |
57 } | 57 } |
58 } | 58 } |
59 | 59 |
60 } // namespace blink | 60 } // namespace blink |
OLD | NEW |