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

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

Issue 1220583004: Refactor DrawingRecorders to check for cached drawings earlier (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 5 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 | « Source/core/paint/ScrollableAreaPainter.cpp ('k') | Source/core/paint/TablePainter.cpp » ('j') | 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 e89146edfb135cfd810051c9ab270176aa7e0cd8..96bbd319251e546f910e51c9ba65aec243a370ae 100644
--- a/Source/core/paint/TableCellPainter.cpp
+++ b/Source/core/paint/TableCellPainter.cpp
@@ -106,10 +106,10 @@ void TableCellPainter::paintCollapsedBorders(const PaintInfo& paintInfo, const L
return;
GraphicsContext* graphicsContext = paintInfo.context;
- LayoutObjectDrawingRecorder recorder(*graphicsContext, m_layoutTableCell, paintInfo.phase, borderRect);
- if (recorder.canUseCachedDrawing())
+ if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*graphicsContext, m_layoutTableCell, paintInfo.phase))
return;
+ LayoutObjectDrawingRecorder recorder(*graphicsContext, m_layoutTableCell, paintInfo.phase, borderRect);
Color cellColor = m_layoutTableCell.resolveColor(CSSPropertyColor);
bool antialias = BoxPainter::shouldAntialiasLines(graphicsContext);
@@ -180,11 +180,12 @@ 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))
+ return;
+
LayoutRect visualOverflowRect = m_layoutTableCell.visualOverflowRect();
visualOverflowRect.moveBy(paintOffset);
LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutTableCell, DisplayItem::BoxDecorationBackground, pixelSnappedIntRect(visualOverflowRect));
- if (recorder.canUseCachedDrawing())
- return;
LayoutRect paintRect = paintBounds(paintOffset, DoNotAddOffsetFromParent);
@@ -210,11 +211,11 @@ void TableCellPainter::paintMask(const PaintInfo& paintInfo, const LayoutPoint&
if (!tableElt->collapseBorders() && m_layoutTableCell.style()->emptyCells() == HIDE && !m_layoutTableCell.firstChild())
return;
- LayoutRect paintRect = paintBounds(paintOffset, DoNotAddOffsetFromParent);
- LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutTableCell, paintInfo.phase, paintRect);
- if (recorder.canUseCachedDrawing())
+ if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*paintInfo.context, m_layoutTableCell, paintInfo.phase))
return;
+ LayoutRect paintRect = paintBounds(paintOffset, DoNotAddOffsetFromParent);
+ LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutTableCell, paintInfo.phase, paintRect);
BoxPainter(m_layoutTableCell).paintMaskImages(paintInfo, paintRect);
}
« no previous file with comments | « Source/core/paint/ScrollableAreaPainter.cpp ('k') | Source/core/paint/TablePainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698