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 "config.h" | 5 #include "config.h" |
6 #include "core/paint/TableSectionPainter.h" | 6 #include "core/paint/TableSectionPainter.h" |
7 | 7 |
8 #include "core/layout/LayoutTable.h" | 8 #include "core/layout/LayoutTable.h" |
9 #include "core/layout/LayoutTableCell.h" | 9 #include "core/layout/LayoutTableCell.h" |
10 #include "core/layout/LayoutTableCol.h" | 10 #include "core/layout/LayoutTableCol.h" |
11 #include "core/layout/LayoutTableRow.h" | 11 #include "core/layout/LayoutTableRow.h" |
12 #include "core/paint/BoxClipper.h" | 12 #include "core/paint/BoxClipper.h" |
13 #include "core/paint/GraphicsContextAnnotator.h" | |
14 #include "core/paint/LayoutObjectDrawingRecorder.h" | 13 #include "core/paint/LayoutObjectDrawingRecorder.h" |
15 #include "core/paint/ObjectPainter.h" | 14 #include "core/paint/ObjectPainter.h" |
16 #include "core/paint/PaintInfo.h" | 15 #include "core/paint/PaintInfo.h" |
17 #include "core/paint/TableCellPainter.h" | 16 #include "core/paint/TableCellPainter.h" |
18 #include "core/paint/TableRowPainter.h" | 17 #include "core/paint/TableRowPainter.h" |
19 | 18 |
20 namespace blink { | 19 namespace blink { |
21 | 20 |
22 void TableSectionPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& p
aintOffset) | 21 void TableSectionPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& p
aintOffset) |
23 { | 22 { |
24 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, &m_layoutTableSection); | |
25 | |
26 ASSERT(!m_layoutTableSection.needsLayout()); | 23 ASSERT(!m_layoutTableSection.needsLayout()); |
27 // avoid crashing on bugs that cause us to paint with dirty layout | 24 // avoid crashing on bugs that cause us to paint with dirty layout |
28 if (m_layoutTableSection.needsLayout()) | 25 if (m_layoutTableSection.needsLayout()) |
29 return; | 26 return; |
30 | 27 |
31 unsigned totalRows = m_layoutTableSection.numRows(); | 28 unsigned totalRows = m_layoutTableSection.numRows(); |
32 unsigned totalCols = m_layoutTableSection.table()->columns().size(); | 29 unsigned totalCols = m_layoutTableSection.table()->columns().size(); |
33 | 30 |
34 if (!totalRows || !totalCols) | 31 if (!totalRows || !totalCols) |
35 return; | 32 return; |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 if (rowHasBackground && !row->hasSelfPaintingLayer()) | 197 if (rowHasBackground && !row->hasSelfPaintingLayer()) |
201 tableCellPainter.paintBackgroundsBehindCell(paintInfo, cellP
oint, row); | 198 tableCellPainter.paintBackgroundsBehindCell(paintInfo, cellP
oint, row); |
202 } | 199 } |
203 } | 200 } |
204 } | 201 } |
205 if ((!cell->hasSelfPaintingLayer() && !row->hasSelfPaintingLayer())) | 202 if ((!cell->hasSelfPaintingLayer() && !row->hasSelfPaintingLayer())) |
206 cell->paint(paintInfo, cellPoint); | 203 cell->paint(paintInfo, cellPoint); |
207 } | 204 } |
208 | 205 |
209 } // namespace blink | 206 } // namespace blink |
OLD | NEW |