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

Unified Diff: third_party/WebKit/Source/core/paint/TableSectionPainter.cpp

Issue 1781463002: Fix table background painting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sample code for improved collapsed border painting Created 3 years, 11 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
Index: third_party/WebKit/Source/core/paint/TableSectionPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/TableSectionPainter.cpp b/third_party/WebKit/Source/core/paint/TableSectionPainter.cpp
index 77fda1696be1d5ad4fe7402832bce88453184cb2..3dc42a6d507bf46f92fc9c40c84ddeac1ef7cef9 100644
--- a/third_party/WebKit/Source/core/paint/TableSectionPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/TableSectionPainter.cpp
@@ -14,6 +14,7 @@
#include "core/paint/ObjectPainter.h"
#include "core/paint/PaintInfo.h"
#include "core/paint/TableCellPainter.h"
+#include "core/paint/TableCollapsedBorderPainter.h"
#include "core/paint/TableRowPainter.h"
#include <algorithm>
@@ -79,6 +80,7 @@ void TableSectionPainter::paintCollapsedBorders(const PaintInfo& paintInfo, cons
if (dirtiedColumns.start() >= dirtiedColumns.end())
return;
+
// Collapsed borders are painted from the bottom right to the top left so that precedence
// due to cell position is respected.
for (unsigned r = dirtiedRows.end(); r > dirtiedRows.start(); r--) {
@@ -95,6 +97,28 @@ void TableSectionPainter::paintCollapsedBorders(const PaintInfo& paintInfo, cons
}
}
+void TableSectionPainter::paintCollapsedBorders2(const PaintInfo& paintInfo, const LayoutPoint& paintOffset, TableCollapsedBorderPainter& previousPainter)
+{
+ if (!m_layoutTableSection.numRows() || !m_layoutTableSection.table()->effectiveColumns().size())
+ return;
+
+ LayoutPoint adjustedPaintOffset = paintOffset + m_layoutTableSection.location();
+ BoxClipper boxClipper(m_layoutTableSection, paintInfo, adjustedPaintOffset, ForceContentsClip);
+
+ LayoutRect localPaintInvalidationRect = LayoutRect(paintInfo.cullRect().m_rect);
+ localPaintInvalidationRect.moveBy(-adjustedPaintOffset);
+
+ LayoutRect tableAlignedRect = m_layoutTableSection.logicalRectForWritingModeAndDirection(localPaintInvalidationRect);
+
+ CellSpan dirtiedRows = m_layoutTableSection.dirtiedRows(tableAlignedRect);
+ CellSpan dirtiedEffColumns = m_layoutTableSection.dirtiedEffectiveColumns(tableAlignedRect);
+
+ TableCollapsedBorderPainter painter(&m_layoutTableSection);
+ painter.paintBorders(paintInfo, paintOffset, dirtiedRows, dirtiedEffColumns, previousPainter);
+ previousPainter = painter;
+ return;
+}
+
void TableSectionPainter::paintObject(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
LayoutRect localPaintInvalidationRect = LayoutRect(paintInfo.cullRect().m_rect);

Powered by Google App Engine
This is Rietveld 408576698