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

Unified Diff: Source/core/paint/TableCellPainter.cpp

Issue 1168643006: Let cull rect of collapsed border contain all painted area (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/TableCellPainter.cpp
diff --git a/Source/core/paint/TableCellPainter.cpp b/Source/core/paint/TableCellPainter.cpp
index b642ddae56c94a065d7a6dbc6768a3ba21aa41af..98ddaa79237fe6b7ff46da230481b656e5a09dda 100644
--- a/Source/core/paint/TableCellPainter.cpp
+++ b/Source/core/paint/TableCellPainter.cpp
@@ -72,17 +72,6 @@ void TableCellPainter::paintCollapsedBorders(const PaintInfo& paintInfo, const L
if (!paintInfo.shouldPaintWithinRoot(&m_layoutTableCell) || m_layoutTableCell.style()->visibility() != VISIBLE)
return;
- LayoutRect paintRect = paintBounds(paintOffset, AddOffsetFromParent);
-
- LayoutRect drawingCullRect(paintRect);
- drawingCullRect.expandEdges(m_layoutTableCell.table()->outerBorderTop(), m_layoutTableCell.table()->outerBorderRight(),
- m_layoutTableCell.table()->outerBorderBottom(), m_layoutTableCell.table()->outerBorderLeft());
- if (drawingCullRect.y() >= paintInfo.rect.maxY())
chrishtr 2015/06/04 22:21:06 You're removing a non-SP culling optimization. Was
Xianzhu 2015/06/05 00:02:14 The cullrect was incorrect (which doesn't cover al
- return;
-
- if (drawingCullRect.maxY() <= paintInfo.rect.y())
- return;
-
const CollapsedBorderValue* tableCurrentBorderValue = m_layoutTableCell.table()->currentBorderValue();
if (!tableCurrentBorderValue)
return;
@@ -101,25 +90,28 @@ void TableCellPainter::paintCollapsedBorders(const PaintInfo& paintInfo, const L
if (!shouldPaintTop && !shouldPaintBottom && !shouldPaintLeft && !shouldPaintRight)
return;
- GraphicsContext* graphicsContext = paintInfo.context;
- LayoutObjectDrawingRecorder recorder(*graphicsContext, m_layoutTableCell, paintInfo.phase, drawingCullRect);
- if (recorder.canUseCachedDrawing())
- return;
-
- bool antialias = BoxPainter::shouldAntialiasLines(graphicsContext);
-
// Adjust our x/y/width/height so that we paint the collapsed borders at the correct location.
int topWidth = topBorderValue.width();
int bottomWidth = bottomBorderValue.width();
int leftWidth = leftBorderValue.width();
int rightWidth = rightBorderValue.width();
+ LayoutRect paintRect = paintBounds(paintOffset, AddOffsetFromParent);
chrishtr 2015/06/05 00:31:06 This is not used? Why not fix paintBounds?
Xianzhu 2015/06/05 00:40:58 Here paintRect is used to calculate borderRect bel
chrishtr 2015/06/05 04:55:28 Oh right, sorry. My comment was too hasty.
IntRect borderRect = pixelSnappedIntRect(paintRect.x() - leftWidth / 2,
paintRect.y() - topWidth / 2,
paintRect.width() + leftWidth / 2 + (rightWidth + 1) / 2,
paintRect.height() + topWidth / 2 + (bottomWidth + 1) / 2);
+ if (!borderRect.intersects(paintInfo.rect))
+ return;
+
+ GraphicsContext* graphicsContext = paintInfo.context;
+ LayoutObjectDrawingRecorder recorder(*graphicsContext, m_layoutTableCell, paintInfo.phase, borderRect);
+ if (recorder.canUseCachedDrawing())
+ return;
+
Color cellColor = m_layoutTableCell.resolveColor(CSSPropertyColor);
+ bool antialias = BoxPainter::shouldAntialiasLines(graphicsContext);
// We never paint diagonals at the joins. We simply let the border with the highest
// precedence paint on top of borders with lower precedence.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698