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

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

Issue 1315993004: Implement a paint offset cache for slimming paint v2 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix bugs caught by unittest failures Created 5 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/paint/TableCellPainter.cpp
diff --git a/Source/core/paint/TableCellPainter.cpp b/Source/core/paint/TableCellPainter.cpp
index 69dbf214ab578951c76139cb9c0c860f6c531059..9d9c1ee34762da9b7d1690e56e74f5f9b51f5aee 100644
--- a/Source/core/paint/TableCellPainter.cpp
+++ b/Source/core/paint/TableCellPainter.cpp
@@ -112,10 +112,10 @@ void TableCellPainter::paintCollapsedBorders(const PaintInfo& paintInfo, const L
return;
GraphicsContext* graphicsContext = paintInfo.context;
- if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*graphicsContext, m_layoutTableCell, static_cast<DisplayItem::Type>(displayItemType)))
+ if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*graphicsContext, m_layoutTableCell, static_cast<DisplayItem::Type>(displayItemType), paintOffset))
return;
- LayoutObjectDrawingRecorder recorder(*graphicsContext, m_layoutTableCell, static_cast<DisplayItem::Type>(displayItemType), borderRect);
+ LayoutObjectDrawingRecorder recorder(*graphicsContext, m_layoutTableCell, static_cast<DisplayItem::Type>(displayItemType), borderRect, paintOffset);
Color cellColor = m_layoutTableCell.resolveColor(CSSPropertyColor);
bool antialias = BoxPainter::shouldAntialiasLines(graphicsContext);
@@ -187,13 +187,13 @@ void TableCellPainter::paintBoxDecorationBackground(const PaintInfo& paintInfo,
if (!m_layoutTableCell.hasBackground() && !m_layoutTableCell.styleRef().boxShadow() && !needsToPaintBorder)
return;
- if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*paintInfo.context, m_layoutTableCell, DisplayItem::BoxDecorationBackground))
+ if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*paintInfo.context, m_layoutTableCell, DisplayItem::BoxDecorationBackground, paintOffset))
return;
LayoutRect visualOverflowRect = m_layoutTableCell.visualOverflowRect();
visualOverflowRect.moveBy(paintOffset);
// TODO(chrishtr): the pixel-snapping here is likely incorrect.
- LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutTableCell, DisplayItem::BoxDecorationBackground, pixelSnappedIntRect(visualOverflowRect));
+ LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutTableCell, DisplayItem::BoxDecorationBackground, pixelSnappedIntRect(visualOverflowRect), paintOffset);
LayoutRect paintRect = paintBounds(paintOffset, DoNotAddOffsetFromParent);
@@ -219,11 +219,11 @@ void TableCellPainter::paintMask(const PaintInfo& paintInfo, const LayoutPoint&
if (!tableElt->collapseBorders() && m_layoutTableCell.style()->emptyCells() == HIDE && !m_layoutTableCell.firstChild())
return;
- if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*paintInfo.context, m_layoutTableCell, paintInfo.phase))
+ if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*paintInfo.context, m_layoutTableCell, paintInfo.phase, paintOffset))
return;
LayoutRect paintRect = paintBounds(paintOffset, DoNotAddOffsetFromParent);
- LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutTableCell, paintInfo.phase, paintRect);
+ LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutTableCell, paintInfo.phase, paintRect, paintOffset);
BoxPainter(m_layoutTableCell).paintMaskImages(paintInfo, paintRect);
}

Powered by Google App Engine
This is Rietveld 408576698