Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Side by Side Diff: third_party/WebKit/Source/core/paint/TableRowPainter.cpp

Issue 2884763003: Combine and simplify LayoutTableSection::DirtiedRows() and DirtiedEffectiveColumns() (Closed)
Patch Set: - Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "core/paint/TableRowPainter.h" 5 #include "core/paint/TableRowPainter.h"
6 6
7 #include "core/layout/LayoutTableCell.h" 7 #include "core/layout/LayoutTableCell.h"
8 #include "core/layout/LayoutTableRow.h" 8 #include "core/layout/LayoutTableRow.h"
9 #include "core/paint/BoxPainter.h" 9 #include "core/paint/BoxPainter.h"
10 #include "core/paint/LayoutObjectDrawingRecorder.h" 10 #include "core/paint/LayoutObjectDrawingRecorder.h"
(...skipping 14 matching lines...) Expand all
25 PaintOutline(paint_info, paint_offset); 25 PaintOutline(paint_info, paint_offset);
26 if (paint_info.phase == kPaintPhaseSelfOutlineOnly) 26 if (paint_info.phase == kPaintPhaseSelfOutlineOnly)
27 return; 27 return;
28 28
29 if (ShouldPaintSelfBlockBackground(paint_info.phase)) { 29 if (ShouldPaintSelfBlockBackground(paint_info.phase)) {
30 const auto* section = layout_table_row_.Section(); 30 const auto* section = layout_table_row_.Section();
31 LayoutRect cull_rect = LayoutRect(paint_info.GetCullRect().rect_); 31 LayoutRect cull_rect = LayoutRect(paint_info.GetCullRect().rect_);
32 cull_rect.MoveBy(layout_table_row_.PhysicalLocation(section)); 32 cull_rect.MoveBy(layout_table_row_.PhysicalLocation(section));
33 LayoutRect logical_rect_in_section = 33 LayoutRect logical_rect_in_section =
34 section->LogicalRectForWritingModeAndDirection(cull_rect); 34 section->LogicalRectForWritingModeAndDirection(cull_rect);
35 CellSpan dirtied_columns = 35 CellSpan dirtied_rows;
36 section->DirtiedEffectiveColumns(logical_rect_in_section); 36 CellSpan dirtied_columns;
37 section->DirtiedRowsAndEffectiveColumns(logical_rect_in_section,
38 dirtied_rows, dirtied_columns);
wkorman 2017/05/16 20:30:11 If we passed pointers rather than refs, could pass
Xianzhu 2017/05/17 00:33:21 This is the only case that only one output is need
37 PaintBoxDecorationBackground(paint_info, paint_offset, dirtied_columns); 39 PaintBoxDecorationBackground(paint_info, paint_offset, dirtied_columns);
38 } 40 }
39 41
40 if (paint_info.phase == kPaintPhaseSelfBlockBackgroundOnly) 42 if (paint_info.phase == kPaintPhaseSelfBlockBackgroundOnly)
41 return; 43 return;
42 44
43 PaintInfo paint_info_for_cells = paint_info.ForDescendants(); 45 PaintInfo paint_info_for_cells = paint_info.ForDescendants();
44 for (LayoutTableCell* cell = layout_table_row_.FirstCell(); cell; 46 for (LayoutTableCell* cell = layout_table_row_.FirstCell(); cell;
45 cell = cell->NextCell()) { 47 cell = cell->NextCell()) {
46 if (!cell->HasSelfPaintingLayer()) 48 if (!cell->HasSelfPaintingLayer())
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 bounds); 91 bounds);
90 LayoutRect paint_rect(adjusted_paint_offset, layout_table_row_.Size()); 92 LayoutRect paint_rect(adjusted_paint_offset, layout_table_row_.Size());
91 93
92 if (has_box_shadow) { 94 if (has_box_shadow) {
93 BoxPainter::PaintNormalBoxShadow(paint_info, paint_rect, 95 BoxPainter::PaintNormalBoxShadow(paint_info, paint_rect,
94 layout_table_row_.StyleRef()); 96 layout_table_row_.StyleRef());
95 } 97 }
96 98
97 if (has_background) { 99 if (has_background) {
98 PaintInfo paint_info_for_cells = paint_info.ForDescendants(); 100 PaintInfo paint_info_for_cells = paint_info.ForDescendants();
99 for (auto c = dirtied_columns.Start(); c < dirtied_columns.end(); c++) { 101 for (auto c = dirtied_columns.Start(); c < dirtied_columns.End(); c++) {
100 if (const auto* cell = 102 if (const auto* cell =
101 section->OriginatingCellAt(layout_table_row_.RowIndex(), c)) 103 section->OriginatingCellAt(layout_table_row_.RowIndex(), c))
102 PaintBackgroundBehindCell(*cell, paint_info_for_cells, paint_offset); 104 PaintBackgroundBehindCell(*cell, paint_info_for_cells, paint_offset);
103 } 105 }
104 } 106 }
105 107
106 if (has_box_shadow) { 108 if (has_box_shadow) {
107 // TODO(wangxianzhu): Calculate the inset shadow bounds by insetting 109 // TODO(wangxianzhu): Calculate the inset shadow bounds by insetting
108 // paintRect by half widths of collapsed borders. 110 // paintRect by half widths of collapsed borders.
109 BoxPainter::PaintInsetBoxShadow(paint_info, paint_rect, 111 BoxPainter::PaintInsetBoxShadow(paint_info, paint_rect,
(...skipping 12 matching lines...) Expand all
122 // flipped blocks direction. 124 // flipped blocks direction.
123 if (!layout_table_row_.HasSelfPaintingLayer()) { 125 if (!layout_table_row_.HasSelfPaintingLayer()) {
124 cell_point = layout_table_row_.Section()->FlipForWritingModeForChild( 126 cell_point = layout_table_row_.Section()->FlipForWritingModeForChild(
125 &cell, cell_point); 127 &cell, cell_point);
126 } 128 }
127 TableCellPainter(cell).PaintContainerBackgroundBehindCell( 129 TableCellPainter(cell).PaintContainerBackgroundBehindCell(
128 paint_info, cell_point, layout_table_row_); 130 paint_info, cell_point, layout_table_row_);
129 } 131 }
130 132
131 } // namespace blink 133 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698