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" |
11 #include "core/layout/LayoutTableSection.h" | 11 #include "core/layout/LayoutTableSection.h" |
12 #include "core/paint/BoxPaintInvalidator.h" | 12 #include "core/paint/BoxPaintInvalidator.h" |
13 #include "core/paint/PaintInvalidator.h" | 13 #include "core/paint/PaintInvalidator.h" |
14 | 14 |
15 namespace blink { | 15 namespace blink { |
16 | 16 |
17 PaintInvalidationReason TablePaintInvalidator::InvalidatePaint() { | 17 PaintInvalidationReason TablePaintInvalidator::InvalidatePaint() { |
18 PaintInvalidationReason reason = | 18 PaintInvalidationReason reason = |
19 BoxPaintInvalidator(table_, context_).InvalidatePaint(); | 19 BoxPaintInvalidator(table_, context_).InvalidatePaint(); |
20 | 20 |
21 // If any col changed background, we need to invalidate all sections because | 21 // If any col changed background, we need to invalidate all sections because |
22 // col background paints into section's background display item. | 22 // col background paints into section's background display item. |
23 bool has_col_changed_background = false; | 23 bool has_col_changed_background = false; |
24 if (table_.HasColElements()) { | 24 if (table_.HasColOrColGroups()) { |
25 bool visual_rect_changed = context_.old_visual_rect != table_.VisualRect(); | 25 bool visual_rect_changed = context_.old_visual_rect != table_.VisualRect(); |
26 for (LayoutTableCol* col = table_.FirstColumn(); col; | 26 for (LayoutTableCol* col = table_.FirstColumn(); col; |
27 col = col->NextColumn()) { | 27 col = col->NextColumn()) { |
28 // LayoutTableCol uses the table's localVisualRect(). Should check column | 28 // LayoutTableCol uses the table's localVisualRect(). Should check column |
29 // for paint invalidation when table's visual rect changed. | 29 // for paint invalidation when table's visual rect changed. |
30 if (visual_rect_changed) | 30 if (visual_rect_changed) |
31 col->SetMayNeedPaintInvalidation(); | 31 col->SetMayNeedPaintInvalidation(); |
32 // This ensures that the backgroundChangedSinceLastPaintInvalidation flag | 32 // This ensures that the backgroundChangedSinceLastPaintInvalidation flag |
33 // is up-to-date. | 33 // is up-to-date. |
34 col->EnsureIsReadyForPaintInvalidation(); | 34 col->EnsureIsReadyForPaintInvalidation(); |
(...skipping 14 matching lines...) Expand all Loading... |
49 ObjectPaintInvalidator(*section) | 49 ObjectPaintInvalidator(*section) |
50 .SlowSetPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient( | 50 .SlowSetPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient( |
51 *section, PaintInvalidationReason::kStyle); | 51 *section, PaintInvalidationReason::kStyle); |
52 } | 52 } |
53 } | 53 } |
54 | 54 |
55 return reason; | 55 return reason; |
56 } | 56 } |
57 | 57 |
58 } // namespace blink | 58 } // namespace blink |
OLD | NEW |