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/GridPainter.h" | 6 #include "core/paint/GridPainter.h" |
7 | 7 |
8 #include "core/layout/LayoutGrid.h" | 8 #include "core/layout/LayoutGrid.h" |
9 #include "core/paint/BlockPainter.h" | 9 #include "core/paint/BlockPainter.h" |
10 #include "core/paint/PaintInfo.h" | 10 #include "core/paint/PaintInfo.h" |
| 11 #include <algorithm> |
11 | 12 |
12 namespace blink { | 13 namespace blink { |
13 | 14 |
14 static GridSpan dirtiedGridAreas(const Vector<LayoutUnit>& coordinates, LayoutUn
it start, LayoutUnit end) | 15 static GridSpan dirtiedGridAreas(const Vector<LayoutUnit>& coordinates, LayoutUn
it start, LayoutUnit end) |
15 { | 16 { |
16 // This function does a binary search over the coordinates. | 17 // This function does a binary search over the coordinates. |
17 // This doesn't work with grid items overflowing their grid areas, but that
is managed with m_gridItemsOverflowingGridArea. | 18 // This doesn't work with grid items overflowing their grid areas, but that
is managed with m_gridItemsOverflowingGridArea. |
18 | 19 |
19 size_t startGridAreaIndex = std::upper_bound(coordinates.begin(), coordinate
s.end() - 1, start) - coordinates.begin(); | 20 size_t startGridAreaIndex = std::upper_bound(coordinates.begin(), coordinate
s.end() - 1, start) - coordinates.begin(); |
20 if (startGridAreaIndex > 0) | 21 if (startGridAreaIndex > 0) |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 LayoutBox* current = gridItemAndPaintIndex.first; | 76 LayoutBox* current = gridItemAndPaintIndex.first; |
76 if (current == previous) | 77 if (current == previous) |
77 continue; | 78 continue; |
78 | 79 |
79 BlockPainter(m_layoutGrid).paintChildAsInlineBlock(*current, paintInfo,
paintOffset); | 80 BlockPainter(m_layoutGrid).paintChildAsInlineBlock(*current, paintInfo,
paintOffset); |
80 previous = current; | 81 previous = current; |
81 } | 82 } |
82 } | 83 } |
83 | 84 |
84 } // namespace blink | 85 } // namespace blink |
OLD | NEW |