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/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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 { | 55 { |
56 DCHECK(shouldPaintSelfBlockBackground(paintInfo.phase)); | 56 DCHECK(shouldPaintSelfBlockBackground(paintInfo.phase)); |
57 if (!m_layoutTableRow.styleRef().boxShadow()) | 57 if (!m_layoutTableRow.styleRef().boxShadow()) |
58 return; | 58 return; |
59 | 59 |
60 DisplayItem::Type type = shadowStyle == Normal ? DisplayItem::TableRowBoxSha
dowNormal : DisplayItem::TableRowBoxShadowInset; | 60 DisplayItem::Type type = shadowStyle == Normal ? DisplayItem::TableRowBoxSha
dowNormal : DisplayItem::TableRowBoxShadowInset; |
61 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfo.contex
t, m_layoutTableRow, type)) | 61 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfo.contex
t, m_layoutTableRow, type)) |
62 return; | 62 return; |
63 | 63 |
64 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutTableRow.location(); | 64 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutTableRow.location(); |
65 LayoutRect bounds = BoxPainter(m_layoutTableRow).boundsForDrawingRecorder(ad
justedPaintOffset); | 65 LayoutRect bounds = BoxPainter(m_layoutTableRow).boundsForDrawingRecorder(pa
intInfo, adjustedPaintOffset); |
66 LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutTableRow, ty
pe, bounds); | 66 LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutTableRow, ty
pe, bounds); |
67 BoxPainter::paintBoxShadow(paintInfo, LayoutRect(adjustedPaintOffset, m_layo
utTableRow.size()), m_layoutTableRow.styleRef(), shadowStyle); | 67 BoxPainter::paintBoxShadow(paintInfo, LayoutRect(adjustedPaintOffset, m_layo
utTableRow.size()), m_layoutTableRow.styleRef(), shadowStyle); |
68 } | 68 } |
69 | 69 |
70 void TableRowPainter::paintBackgroundBehindCell(const LayoutTableCell& cell, con
st PaintInfo& paintInfo, const LayoutPoint& paintOffset) | 70 void TableRowPainter::paintBackgroundBehindCell(const LayoutTableCell& cell, con
st PaintInfo& paintInfo, const LayoutPoint& paintOffset) |
71 { | 71 { |
72 DCHECK(m_layoutTableRow.hasBackground() && !m_layoutTableRow.hasSelfPainting
Layer()); | 72 DCHECK(m_layoutTableRow.hasBackground() && !m_layoutTableRow.hasSelfPainting
Layer()); |
73 LayoutPoint cellPoint = m_layoutTableRow.section()->flipForWritingModeForChi
ld(&cell, paintOffset); | 73 LayoutPoint cellPoint = m_layoutTableRow.section()->flipForWritingModeForChi
ld(&cell, paintOffset); |
74 TableCellPainter(cell).paintContainerBackgroundBehindCell(paintInfo, cellPoi
nt, m_layoutTableRow, DisplayItem::TableCellBackgroundFromRow); | 74 TableCellPainter(cell).paintContainerBackgroundBehindCell(paintInfo, cellPoi
nt, m_layoutTableRow, DisplayItem::TableCellBackgroundFromRow); |
75 } | 75 } |
76 | 76 |
77 } // namespace blink | 77 } // namespace blink |
OLD | NEW |