Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: third_party/WebKit/Source/core/paint/TableCellPainter.cpp

Issue 2225033003: Separate backgroundObscurationStatus and hasBoxDecorationBackground (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/TableCellPainter.h" 5 #include "core/paint/TableCellPainter.h"
6 6
7 #include "core/layout/LayoutTableCell.h" 7 #include "core/layout/LayoutTableCell.h"
8 #include "core/paint/BlockPainter.h" 8 #include "core/paint/BlockPainter.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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 } 170 }
171 } 171 }
172 172
173 void TableCellPainter::paintBoxDecorationBackground(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) 173 void TableCellPainter::paintBoxDecorationBackground(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
174 { 174 {
175 LayoutTable* table = m_layoutTableCell.table(); 175 LayoutTable* table = m_layoutTableCell.table();
176 if (!table->collapseBorders() && m_layoutTableCell.style()->emptyCells() == EmptyCellsHide && !m_layoutTableCell.firstChild()) 176 if (!table->collapseBorders() && m_layoutTableCell.style()->emptyCells() == EmptyCellsHide && !m_layoutTableCell.firstChild())
177 return; 177 return;
178 178
179 bool needsToPaintBorder = m_layoutTableCell.styleRef().hasBorderDecoration() && !table->collapseBorders(); 179 bool needsToPaintBorder = m_layoutTableCell.styleRef().hasBorderDecoration() && !table->collapseBorders();
180 if (!m_layoutTableCell.hasBackground() && !m_layoutTableCell.styleRef().boxS hadow() && !needsToPaintBorder) 180 if (!m_layoutTableCell.styleRef().hasBackground() && !m_layoutTableCell.styl eRef().boxShadow() && !needsToPaintBorder)
181 return; 181 return;
182 182
183 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfo.contex t, m_layoutTableCell, DisplayItem::BoxDecorationBackground)) 183 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfo.contex t, m_layoutTableCell, DisplayItem::BoxDecorationBackground))
184 return; 184 return;
185 185
186 LayoutRect visualOverflowRect = m_layoutTableCell.visualOverflowRect(); 186 LayoutRect visualOverflowRect = m_layoutTableCell.visualOverflowRect();
187 visualOverflowRect.moveBy(paintOffset); 187 visualOverflowRect.moveBy(paintOffset);
188 // TODO(chrishtr): the pixel-snapping here is likely incorrect. 188 // TODO(chrishtr): the pixel-snapping here is likely incorrect.
189 LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutTableCell, D isplayItem::BoxDecorationBackground, pixelSnappedIntRect(visualOverflowRect)); 189 LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutTableCell, D isplayItem::BoxDecorationBackground, pixelSnappedIntRect(visualOverflowRect));
190 190
(...skipping 26 matching lines...) Expand all
217 BoxPainter(m_layoutTableCell).paintMaskImages(paintInfo, paintRect); 217 BoxPainter(m_layoutTableCell).paintMaskImages(paintInfo, paintRect);
218 } 218 }
219 219
220 LayoutRect TableCellPainter::paintRectNotIncludingVisualOverflow(const LayoutPoi nt& paintOffset) 220 LayoutRect TableCellPainter::paintRectNotIncludingVisualOverflow(const LayoutPoi nt& paintOffset)
221 { 221 {
222 return LayoutRect(paintOffset, LayoutSize(m_layoutTableCell.pixelSnappedSize ())); 222 return LayoutRect(paintOffset, LayoutSize(m_layoutTableCell.pixelSnappedSize ()));
223 } 223 }
224 224
225 } // namespace blink 225 } // namespace blink
226 226
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/BoxPainter.cpp ('k') | third_party/WebKit/Source/core/paint/TableRowPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698