| 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 "core/paint/TableSectionPainter.h" | 5 #include "core/paint/TableSectionPainter.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutTableCell.h" | 7 #include "core/layout/LayoutTableCell.h" |
| 8 #include "core/layout/LayoutTableCol.h" | 8 #include "core/layout/LayoutTableCol.h" |
| 9 #include "core/layout/LayoutTableRow.h" | 9 #include "core/layout/LayoutTableRow.h" |
| 10 #include "core/paint/BoxClipper.h" | 10 #include "core/paint/BoxClipper.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 const CollapsedBorderValue& currentBorderValue) { | 158 const CollapsedBorderValue& currentBorderValue) { |
| 159 if (!m_layoutTableSection.numRows() || | 159 if (!m_layoutTableSection.numRows() || |
| 160 !m_layoutTableSection.table()->effectiveColumns().size()) | 160 !m_layoutTableSection.table()->effectiveColumns().size()) |
| 161 return; | 161 return; |
| 162 | 162 |
| 163 LayoutPoint adjustedPaintOffset = | 163 LayoutPoint adjustedPaintOffset = |
| 164 paintOffset + m_layoutTableSection.location(); | 164 paintOffset + m_layoutTableSection.location(); |
| 165 BoxClipper boxClipper(m_layoutTableSection, paintInfo, adjustedPaintOffset, | 165 BoxClipper boxClipper(m_layoutTableSection, paintInfo, adjustedPaintOffset, |
| 166 ForceContentsClip); | 166 ForceContentsClip); |
| 167 | 167 |
| 168 LayoutRect localPaintInvalidationRect = | 168 LayoutRect localVisualRect = LayoutRect(paintInfo.cullRect().m_rect); |
| 169 LayoutRect(paintInfo.cullRect().m_rect); | 169 localVisualRect.moveBy(-adjustedPaintOffset); |
| 170 localPaintInvalidationRect.moveBy(-adjustedPaintOffset); | |
| 171 | 170 |
| 172 LayoutRect tableAlignedRect = | 171 LayoutRect tableAlignedRect = |
| 173 m_layoutTableSection.logicalRectForWritingModeAndDirection( | 172 m_layoutTableSection.logicalRectForWritingModeAndDirection( |
| 174 localPaintInvalidationRect); | 173 localVisualRect); |
| 175 | 174 |
| 176 CellSpan dirtiedRows = m_layoutTableSection.dirtiedRows(tableAlignedRect); | 175 CellSpan dirtiedRows = m_layoutTableSection.dirtiedRows(tableAlignedRect); |
| 177 CellSpan dirtiedColumns = | 176 CellSpan dirtiedColumns = |
| 178 m_layoutTableSection.dirtiedEffectiveColumns(tableAlignedRect); | 177 m_layoutTableSection.dirtiedEffectiveColumns(tableAlignedRect); |
| 179 | 178 |
| 180 if (dirtiedColumns.start() >= dirtiedColumns.end()) | 179 if (dirtiedColumns.start() >= dirtiedColumns.end()) |
| 181 return; | 180 return; |
| 182 | 181 |
| 183 // Collapsed borders are painted from the bottom right to the top left so that | 182 // Collapsed borders are painted from the bottom right to the top left so that |
| 184 // precedence due to cell position is respected. | 183 // precedence due to cell position is respected. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 197 LayoutPoint cellPoint = m_layoutTableSection.flipForWritingModeForChild( | 196 LayoutPoint cellPoint = m_layoutTableSection.flipForWritingModeForChild( |
| 198 cell, adjustedPaintOffset); | 197 cell, adjustedPaintOffset); |
| 199 TableCellPainter(*cell).paintCollapsedBorders(paintInfo, cellPoint, | 198 TableCellPainter(*cell).paintCollapsedBorders(paintInfo, cellPoint, |
| 200 currentBorderValue); | 199 currentBorderValue); |
| 201 } | 200 } |
| 202 } | 201 } |
| 203 } | 202 } |
| 204 | 203 |
| 205 void TableSectionPainter::paintObject(const PaintInfo& paintInfo, | 204 void TableSectionPainter::paintObject(const PaintInfo& paintInfo, |
| 206 const LayoutPoint& paintOffset) { | 205 const LayoutPoint& paintOffset) { |
| 207 LayoutRect localPaintInvalidationRect = | 206 LayoutRect localVisualRect = LayoutRect(paintInfo.cullRect().m_rect); |
| 208 LayoutRect(paintInfo.cullRect().m_rect); | 207 localVisualRect.moveBy(-paintOffset); |
| 209 localPaintInvalidationRect.moveBy(-paintOffset); | |
| 210 | 208 |
| 211 LayoutRect tableAlignedRect = | 209 LayoutRect tableAlignedRect = |
| 212 m_layoutTableSection.logicalRectForWritingModeAndDirection( | 210 m_layoutTableSection.logicalRectForWritingModeAndDirection( |
| 213 localPaintInvalidationRect); | 211 localVisualRect); |
| 214 | 212 |
| 215 CellSpan dirtiedRows = m_layoutTableSection.dirtiedRows(tableAlignedRect); | 213 CellSpan dirtiedRows = m_layoutTableSection.dirtiedRows(tableAlignedRect); |
| 216 CellSpan dirtiedColumns = | 214 CellSpan dirtiedColumns = |
| 217 m_layoutTableSection.dirtiedEffectiveColumns(tableAlignedRect); | 215 m_layoutTableSection.dirtiedEffectiveColumns(tableAlignedRect); |
| 218 | 216 |
| 219 if (dirtiedColumns.start() >= dirtiedColumns.end()) | 217 if (dirtiedColumns.start() >= dirtiedColumns.end()) |
| 220 return; | 218 return; |
| 221 | 219 |
| 222 PaintInfo paintInfoForDescendants = paintInfo.forDescendants(); | 220 PaintInfo paintInfoForDescendants = paintInfo.forDescendants(); |
| 223 | 221 |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 LayoutRect bounds = BoxPainter(m_layoutTableSection) | 391 LayoutRect bounds = BoxPainter(m_layoutTableSection) |
| 394 .boundsForDrawingRecorder(paintInfo, paintOffset); | 392 .boundsForDrawingRecorder(paintInfo, paintOffset); |
| 395 LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutTableSection, | 393 LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutTableSection, |
| 396 type, bounds); | 394 type, bounds); |
| 397 BoxPainter::paintBoxShadow( | 395 BoxPainter::paintBoxShadow( |
| 398 paintInfo, LayoutRect(paintOffset, m_layoutTableSection.size()), | 396 paintInfo, LayoutRect(paintOffset, m_layoutTableSection.size()), |
| 399 m_layoutTableSection.styleRef(), shadowStyle); | 397 m_layoutTableSection.styleRef(), shadowStyle); |
| 400 } | 398 } |
| 401 | 399 |
| 402 } // namespace blink | 400 } // namespace blink |
| OLD | NEW |