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/TableRowPainter.h" | 6 #include "core/paint/TableRowPainter.h" |
7 | 7 |
8 #include "core/layout/LayoutTableCell.h" | 8 #include "core/layout/LayoutTableCell.h" |
9 #include "core/layout/LayoutTableRow.h" | 9 #include "core/layout/LayoutTableRow.h" |
10 #include "core/paint/GraphicsContextAnnotator.h" | |
11 #include "core/paint/LayoutObjectDrawingRecorder.h" | 10 #include "core/paint/LayoutObjectDrawingRecorder.h" |
12 #include "core/paint/ObjectPainter.h" | 11 #include "core/paint/ObjectPainter.h" |
13 #include "core/paint/PaintInfo.h" | 12 #include "core/paint/PaintInfo.h" |
14 #include "core/paint/TableCellPainter.h" | 13 #include "core/paint/TableCellPainter.h" |
15 | 14 |
16 namespace blink { | 15 namespace blink { |
17 | 16 |
18 void TableRowPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paint
Offset) | 17 void TableRowPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paint
Offset) |
19 { | 18 { |
20 ASSERT(m_layoutTableRow.hasSelfPaintingLayer()); | 19 ASSERT(m_layoutTableRow.hasSelfPaintingLayer()); |
21 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, &m_layoutTableRow); | |
22 | 20 |
23 paintOutlineForRowIfNeeded(paintInfo, paintOffset); | 21 paintOutlineForRowIfNeeded(paintInfo, paintOffset); |
24 for (LayoutTableCell* cell = m_layoutTableRow.firstCell(); cell; cell = cell
->nextCell()) { | 22 for (LayoutTableCell* cell = m_layoutTableRow.firstCell(); cell; cell = cell
->nextCell()) { |
25 // Paint the row background behind the cell. | 23 // Paint the row background behind the cell. |
26 if (paintInfo.phase == PaintPhaseBlockBackground || paintInfo.phase == P
aintPhaseChildBlockBackground) { | 24 if (paintInfo.phase == PaintPhaseBlockBackground || paintInfo.phase == P
aintPhaseChildBlockBackground) { |
27 if (m_layoutTableRow.hasBackground()) { | 25 if (m_layoutTableRow.hasBackground()) { |
28 TableCellPainter tableCellPainter(*cell); | 26 TableCellPainter tableCellPainter(*cell); |
29 LayoutObjectDrawingRecorder recorder(*paintInfo.context, *cell,
DisplayItem::TableCellBackgroundFromSelfPaintingRow, tableCellPainter.paintBound
s(paintOffset, TableCellPainter::AddOffsetFromParent)); | 27 LayoutObjectDrawingRecorder recorder(*paintInfo.context, *cell,
DisplayItem::TableCellBackgroundFromSelfPaintingRow, tableCellPainter.paintBound
s(paintOffset, TableCellPainter::AddOffsetFromParent)); |
30 if (!recorder.canUseCachedDrawing()) | 28 if (!recorder.canUseCachedDrawing()) |
31 tableCellPainter.paintBackgroundsBehindCell(paintInfo, paint
Offset, &m_layoutTableRow); | 29 tableCellPainter.paintBackgroundsBehindCell(paintInfo, paint
Offset, &m_layoutTableRow); |
(...skipping 10 matching lines...) Expand all Loading... |
42 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutTableRow.location(); | 40 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutTableRow.location(); |
43 PaintPhase paintPhase = paintInfo.phase; | 41 PaintPhase paintPhase = paintInfo.phase; |
44 if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline)
&& m_layoutTableRow.style()->visibility() == VISIBLE) { | 42 if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline)
&& m_layoutTableRow.style()->visibility() == VISIBLE) { |
45 LayoutRect visualOverflowRect(m_layoutTableRow.visualOverflowRect()); | 43 LayoutRect visualOverflowRect(m_layoutTableRow.visualOverflowRect()); |
46 visualOverflowRect.moveBy(adjustedPaintOffset); | 44 visualOverflowRect.moveBy(adjustedPaintOffset); |
47 ObjectPainter(m_layoutTableRow).paintOutline(paintInfo, LayoutRect(adjus
tedPaintOffset, m_layoutTableRow.size()), visualOverflowRect); | 45 ObjectPainter(m_layoutTableRow).paintOutline(paintInfo, LayoutRect(adjus
tedPaintOffset, m_layoutTableRow.size()), visualOverflowRect); |
48 } | 46 } |
49 } | 47 } |
50 | 48 |
51 } // namespace blink | 49 } // namespace blink |
OLD | NEW |