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

Unified Diff: Source/core/paint/ReplacedPainter.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: 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/ReplacedPainter.cpp
diff --git a/Source/core/paint/ReplacedPainter.cpp b/Source/core/paint/ReplacedPainter.cpp
index 6571e9cbda2b0db4bfa1ebb9a49069ce9781a8ad..fbadae1e4e6e2fe69e4b44b0aa141a590ff9a0de 100644
--- a/Source/core/paint/ReplacedPainter.cpp
+++ b/Source/core/paint/ReplacedPainter.cpp
@@ -41,7 +41,7 @@ void ReplacedPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paint
if (paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) {
if (m_layoutReplaced.styleRef().outlineWidth())
- ObjectPainter(m_layoutReplaced).paintOutline(paintInfo, paintRect, visualOverflowRect);
+ ObjectPainter(m_layoutReplaced).paintOutline(paintInfo, paintRect, visualOverflowRect, adjustedPaintOffset);
return;
}
@@ -89,12 +89,12 @@ void ReplacedPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paint
// The selection tint never gets clipped by border-radius rounding, since we want it to run right up to the edges of
// surrounding content.
bool drawSelectionTint = paintInfo.phase == PaintPhaseForeground && m_layoutReplaced.selectionState() != SelectionNone && !paintInfo.isPrinting();
- if (drawSelectionTint && !LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*paintInfo.context, m_layoutReplaced, DisplayItem::SelectionTint)) {
+ if (drawSelectionTint && !LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*paintInfo.context, m_layoutReplaced, DisplayItem::SelectionTint, paintOffset)) {
LayoutRect selectionPaintingRect = m_layoutReplaced.localSelectionRect();
selectionPaintingRect.moveBy(adjustedPaintOffset);
IntRect selectionPaintingIntRect = pixelSnappedIntRect(selectionPaintingRect);
- LayoutObjectDrawingRecorder drawingRecorder(*paintInfo.context, m_layoutReplaced, DisplayItem::SelectionTint, selectionPaintingIntRect);
+ LayoutObjectDrawingRecorder drawingRecorder(*paintInfo.context, m_layoutReplaced, DisplayItem::SelectionTint, selectionPaintingIntRect, paintOffset);
paintInfo.context->fillRect(selectionPaintingIntRect, m_layoutReplaced.selectionBackgroundColor());
}
}

Powered by Google App Engine
This is Rietveld 408576698