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/paint/BoxClipper.h" | 8 #include "core/paint/BoxClipper.h" |
9 #include "core/paint/ObjectPainter.h" | 9 #include "core/paint/ObjectPainter.h" |
10 #include "core/paint/RenderDrawingRecorder.h" | 10 #include "core/paint/RenderDrawingRecorder.h" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 RenderTableRow* row = toRenderTableRow(cell->parent()); | 164 RenderTableRow* row = toRenderTableRow(cell->parent()); |
165 | 165 |
166 if (paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChild
BlockBackground) { | 166 if (paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChild
BlockBackground) { |
167 // We need to handle painting a stack of backgrounds. This stack (from b
ottom to top) consists of | 167 // We need to handle painting a stack of backgrounds. This stack (from b
ottom to top) consists of |
168 // the column group, column, row group, row, and then the cell. | 168 // the column group, column, row group, row, and then the cell. |
169 RenderTableCol* column = m_renderTableSection.table()->colElement(cell->
col()); | 169 RenderTableCol* column = m_renderTableSection.table()->colElement(cell->
col()); |
170 RenderTableCol* columnGroup = column ? column->enclosingColumnGroup() :
0; | 170 RenderTableCol* columnGroup = column ? column->enclosingColumnGroup() :
0; |
171 | 171 |
172 TableCellPainter tableCellPainter(*cell); | 172 TableCellPainter tableCellPainter(*cell); |
173 | 173 |
174 RenderDrawingRecorder recorder(paintInfo.context, &m_renderTableSection,
paintPhase, tableCellPainter.paintBounds(paintOffset, TableCellPainter::AddOffs
etFromParent)); | 174 RenderDrawingRecorder recorder(paintInfo.context, m_renderTableSection,
paintPhase, tableCellPainter.paintBounds(paintOffset, TableCellPainter::AddOffse
tFromParent)); |
| 175 if (!recorder.canUseCachedDrawing()) { |
| 176 // Column groups and columns first. |
| 177 // FIXME: Columns and column groups do not currently support opacity
, and they are being painted "too late" in |
| 178 // the stack, since we have already opened a transparency layer (pot
entially) for the table row group. |
| 179 // Note that we deliberately ignore whether or not the cell has a la
yer, since these backgrounds paint "behind" the |
| 180 // cell. |
| 181 tableCellPainter.paintBackgroundsBehindCell(paintInfo, cellPoint, co
lumnGroup); |
| 182 tableCellPainter.paintBackgroundsBehindCell(paintInfo, cellPoint, co
lumn); |
175 | 183 |
176 // Column groups and columns first. | 184 // Paint the row group next. |
177 // FIXME: Columns and column groups do not currently support opacity, an
d they are being painted "too late" in | 185 tableCellPainter.paintBackgroundsBehindCell(paintInfo, cellPoint, &m
_renderTableSection); |
178 // the stack, since we have already opened a transparency layer (potenti
ally) for the table row group. | |
179 // Note that we deliberately ignore whether or not the cell has a layer,
since these backgrounds paint "behind" the | |
180 // cell. | |
181 tableCellPainter.paintBackgroundsBehindCell(paintInfo, cellPoint, column
Group); | |
182 tableCellPainter.paintBackgroundsBehindCell(paintInfo, cellPoint, column
); | |
183 | 186 |
184 // Paint the row group next. | 187 // Paint the row next, but only if it doesn't have a layer. If a row
has a layer, it will be responsible for |
185 tableCellPainter.paintBackgroundsBehindCell(paintInfo, cellPoint, &m_ren
derTableSection); | 188 // painting the row background for the cell. |
186 | 189 if (!row->hasSelfPaintingLayer()) |
187 // Paint the row next, but only if it doesn't have a layer. If a row has
a layer, it will be responsible for | 190 tableCellPainter.paintBackgroundsBehindCell(paintInfo, cellPoint
, row); |
188 // painting the row background for the cell. | 191 } |
189 if (!row->hasSelfPaintingLayer()) | |
190 tableCellPainter.paintBackgroundsBehindCell(paintInfo, cellPoint, ro
w); | |
191 } | 192 } |
192 if ((!cell->hasSelfPaintingLayer() && !row->hasSelfPaintingLayer())) | 193 if ((!cell->hasSelfPaintingLayer() && !row->hasSelfPaintingLayer())) |
193 cell->paint(paintInfo, cellPoint); | 194 cell->paint(paintInfo, cellPoint); |
194 } | 195 } |
195 | 196 |
196 } // namespace blink | 197 } // namespace blink |
OLD | NEW |