| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 return; | 48 return; |
| 49 | 49 |
| 50 LayoutPoint paginationOffset = paintOffset; | 50 LayoutPoint paginationOffset = paintOffset; |
| 51 // Move paginationOffset to the top of the second page. | 51 // Move paginationOffset to the top of the second page. |
| 52 paginationOffset.move(0, pageHeight - table->pageLogicalOffset()); | 52 paginationOffset.move(0, pageHeight - table->pageLogicalOffset()); |
| 53 // Now move paginationOffset to the top of the page the cull rect starts on. | 53 // Now move paginationOffset to the top of the page the cull rect starts on. |
| 54 if (paintInfo.cullRect().m_rect.y() > paginationOffset.y()) | 54 if (paintInfo.cullRect().m_rect.y() > paginationOffset.y()) |
| 55 paginationOffset.move(0, pageHeight * static_cast<int>((paintInfo.cullRe
ct().m_rect.y() - paginationOffset.y()) / pageHeight)); | 55 paginationOffset.move(0, pageHeight * static_cast<int>((paintInfo.cullRe
ct().m_rect.y() - paginationOffset.y()) / pageHeight)); |
| 56 LayoutUnit bottomBound = std::min(LayoutUnit(paintInfo.cullRect().m_rect.max
Y()), paintOffset.y() + table->logicalHeight()); | 56 LayoutUnit bottomBound = std::min(LayoutUnit(paintInfo.cullRect().m_rect.max
Y()), paintOffset.y() + table->logicalHeight()); |
| 57 while (paginationOffset.y() < bottomBound) { | 57 while (paginationOffset.y() < bottomBound) { |
| 58 LayoutPoint nestedOffset = paginationOffset + LayoutPoint(0, m_layoutTab
leSection.offsetForRepeatingHeader()); |
| 58 if (itemToPaint == PaintCollapsedBorders) | 59 if (itemToPaint == PaintCollapsedBorders) |
| 59 paintCollapsedSectionBorders(paintInfo, paginationOffset, currentBor
derValue); | 60 paintCollapsedSectionBorders(paintInfo, nestedOffset, currentBorderV
alue); |
| 60 else | 61 else |
| 61 paintSection(paintInfo, paginationOffset); | 62 paintSection(paintInfo, nestedOffset); |
| 62 paginationOffset.move(0, pageHeight); | 63 paginationOffset.move(0, pageHeight); |
| 63 } | 64 } |
| 64 } | 65 } |
| 65 | 66 |
| 66 void TableSectionPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& p
aintOffset) | 67 void TableSectionPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& p
aintOffset) |
| 67 { | 68 { |
| 68 paintSection(paintInfo, paintOffset); | 69 paintSection(paintInfo, paintOffset); |
| 69 LayoutTable* table = m_layoutTableSection.table(); | 70 LayoutTable* table = m_layoutTableSection.table(); |
| 70 if (table->header() == m_layoutTableSection) | 71 if (table->header() == m_layoutTableSection) |
| 71 paintRepeatingHeaderGroup(paintInfo, paintOffset, CollapsedBorderValue()
, PaintSection); | 72 paintRepeatingHeaderGroup(paintInfo, paintOffset, CollapsedBorderValue()
, PaintSection); |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 DisplayItem::Type type = shadowStyle == Normal ? DisplayItem::TableSectionBo
xShadowNormal : DisplayItem::TableSectionBoxShadowInset; | 299 DisplayItem::Type type = shadowStyle == Normal ? DisplayItem::TableSectionBo
xShadowNormal : DisplayItem::TableSectionBoxShadowInset; |
| 299 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfo.contex
t, m_layoutTableSection, type)) | 300 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfo.contex
t, m_layoutTableSection, type)) |
| 300 return; | 301 return; |
| 301 | 302 |
| 302 LayoutRect bounds = BoxPainter(m_layoutTableSection).boundsForDrawingRecorde
r(paintOffset); | 303 LayoutRect bounds = BoxPainter(m_layoutTableSection).boundsForDrawingRecorde
r(paintOffset); |
| 303 LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutTableSection
, type, bounds); | 304 LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutTableSection
, type, bounds); |
| 304 BoxPainter::paintBoxShadow(paintInfo, LayoutRect(paintOffset, m_layoutTableS
ection.size()), m_layoutTableSection.styleRef(), shadowStyle); | 305 BoxPainter::paintBoxShadow(paintInfo, LayoutRect(paintOffset, m_layoutTableS
ection.size()), m_layoutTableSection.styleRef(), shadowStyle); |
| 305 } | 306 } |
| 306 | 307 |
| 307 } // namespace blink | 308 } // namespace blink |
| OLD | NEW |