OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "core/paint/TablePaintInvalidator.h" | 5 #include "core/paint/TablePaintInvalidator.h" |
6 | 6 |
7 #include "core/layout/LayoutTable.h" | 7 #include "core/layout/LayoutTable.h" |
8 #include "core/layout/LayoutTableCell.h" | 8 #include "core/layout/LayoutTableCell.h" |
9 #include "core/layout/LayoutTableCol.h" | 9 #include "core/layout/LayoutTableCol.h" |
10 #include "core/layout/LayoutTableRow.h" | 10 #include "core/layout/LayoutTableRow.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 !section | 43 !section |
44 ->shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState
()) | 44 ->shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState
()) |
45 continue; | 45 continue; |
46 for (LayoutTableRow* row = section->firstRow(); row; row = row->nextRow()) { | 46 for (LayoutTableRow* row = section->firstRow(); row; row = row->nextRow()) { |
47 if (!hasColChangedBackground && | 47 if (!hasColChangedBackground && |
48 !section->backgroundChangedSinceLastPaintInvalidation() && | 48 !section->backgroundChangedSinceLastPaintInvalidation() && |
49 !row->backgroundChangedSinceLastPaintInvalidation()) | 49 !row->backgroundChangedSinceLastPaintInvalidation()) |
50 continue; | 50 continue; |
51 for (LayoutTableCell* cell = row->firstCell(); cell; | 51 for (LayoutTableCell* cell = row->firstCell(); cell; |
52 cell = cell->nextCell()) { | 52 cell = cell->nextCell()) { |
| 53 cell->ensureIsReadyForPaintInvalidation(); |
53 bool invalidated = false; | 54 bool invalidated = false; |
54 // Table cells paint container's background on the container's backing | 55 // Table cells paint container's background on the container's backing |
55 // instead of its own (if any), so we must invalidate it by the | 56 // instead of its own (if any), so we must invalidate it by the |
56 // containers. | 57 // containers. |
57 if (section->backgroundChangedSinceLastPaintInvalidation()) { | 58 if (section->backgroundChangedSinceLastPaintInvalidation()) { |
58 sectionInvalidator | 59 sectionInvalidator |
59 .slowSetPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient( | 60 .slowSetPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient( |
60 *cell, PaintInvalidationStyleChange); | 61 cell->backgroundDisplayItemClient(), |
| 62 PaintInvalidationStyleChange); |
61 invalidated = true; | 63 invalidated = true; |
62 } else if (hasColChangedBackground) { | 64 } else if (hasColChangedBackground) { |
63 LayoutTable::ColAndColGroup colAndColGroup = | 65 LayoutTable::ColAndColGroup colAndColGroup = |
64 m_table.colElementAtAbsoluteColumn(cell->absoluteColumnIndex()); | 66 m_table.colElementAtAbsoluteColumn(cell->absoluteColumnIndex()); |
65 LayoutTableCol* column = colAndColGroup.col; | 67 LayoutTableCol* column = colAndColGroup.col; |
66 LayoutTableCol* columnGroup = colAndColGroup.colgroup; | 68 LayoutTableCol* columnGroup = colAndColGroup.colgroup; |
67 if ((columnGroup && | 69 if ((columnGroup && |
68 columnGroup->backgroundChangedSinceLastPaintInvalidation()) || | 70 columnGroup->backgroundChangedSinceLastPaintInvalidation()) || |
69 (column && | 71 (column && |
70 column->backgroundChangedSinceLastPaintInvalidation())) { | 72 column->backgroundChangedSinceLastPaintInvalidation())) { |
71 sectionInvalidator | 73 sectionInvalidator |
72 .slowSetPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient( | 74 .slowSetPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient( |
73 *cell, PaintInvalidationStyleChange); | 75 cell->backgroundDisplayItemClient(), |
| 76 PaintInvalidationStyleChange); |
74 invalidated = true; | 77 invalidated = true; |
75 } | 78 } |
76 } | 79 } |
77 if ((!invalidated || row->hasSelfPaintingLayer()) && | 80 if ((!invalidated || row->hasSelfPaintingLayer()) && |
78 row->backgroundChangedSinceLastPaintInvalidation()) | 81 row->backgroundChangedSinceLastPaintInvalidation()) { |
79 ObjectPaintInvalidator(*row) | 82 ObjectPaintInvalidator(*row) |
80 .slowSetPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient( | 83 .slowSetPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient( |
81 *cell, PaintInvalidationStyleChange); | 84 cell->backgroundDisplayItemClient(), |
| 85 PaintInvalidationStyleChange); |
| 86 } |
82 } | 87 } |
83 } | 88 } |
84 } | 89 } |
85 | 90 |
86 return reason; | 91 return reason; |
87 } | 92 } |
88 | 93 |
89 } // namespace blink | 94 } // namespace blink |
OLD | NEW |