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

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

Issue 1642223002: Delete selection gap code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Integrate feedback. Created 4 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/BlockFlowPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/BlockFlowPainter.cpp b/third_party/WebKit/Source/core/paint/BlockFlowPainter.cpp
index e7d5ca50180f063557d4ce741594ea60331cf081..63365ad28843436035473cd92dda4da727ede84b 100644
--- a/third_party/WebKit/Source/core/paint/BlockFlowPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/BlockFlowPainter.cpp
@@ -41,45 +41,4 @@ void BlockFlowPainter::paintFloats(const PaintInfo& paintInfo, const LayoutPoint
}
}
-void BlockFlowPainter::paintSelection(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
-{
- ASSERT(paintInfo.phase == PaintPhaseForeground);
- if (!m_layoutBlockFlow.shouldPaintSelectionGaps())
- return;
-
- LayoutUnit lastTop = 0;
- LayoutUnit lastLeft = m_layoutBlockFlow.logicalLeftSelectionOffset(&m_layoutBlockFlow, lastTop);
- LayoutUnit lastRight = m_layoutBlockFlow.logicalRightSelectionOffset(&m_layoutBlockFlow, lastTop);
-
- LayoutRect bounds = m_layoutBlockFlow.visualOverflowRect();
- bounds.moveBy(paintOffset);
-
- // Only create a DrawingRecorder and ClipScope if skipRecording is false. This logic is needed
- // because selectionGaps(...) needs to be called even when we do not record.
- bool skipRecording = LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfo.context, m_layoutBlockFlow, DisplayItem::SelectionGap, paintOffset);
- Optional<LayoutObjectDrawingRecorder> drawingRecorder;
- Optional<ClipScope> clipScope;
- if (!skipRecording) {
- drawingRecorder.emplace(paintInfo.context, m_layoutBlockFlow, DisplayItem::SelectionGap, FloatRect(bounds), paintOffset);
- clipScope.emplace(paintInfo.context);
- }
-
- LayoutRect gapRectsBounds = m_layoutBlockFlow.selectionGaps(&m_layoutBlockFlow, paintOffset, LayoutSize(), lastTop, lastLeft, lastRight,
- skipRecording ? nullptr : &paintInfo,
- skipRecording ? nullptr : &(*clipScope));
- // TODO(wkorman): Rework below to process paint invalidation rects during layout rather than paint.
- if (!gapRectsBounds.isEmpty()) {
- PaintLayer* layer = m_layoutBlockFlow.enclosingLayer();
- gapRectsBounds.moveBy(-paintOffset);
- if (!m_layoutBlockFlow.hasLayer()) {
- LayoutRect localBounds(gapRectsBounds);
- m_layoutBlockFlow.flipForWritingMode(localBounds);
- gapRectsBounds = LayoutRect(m_layoutBlockFlow.localToAncestorQuad(FloatRect(localBounds), layer->layoutObject()).enclosingBoundingBox());
- if (layer->layoutObject()->hasOverflowClip())
- gapRectsBounds.move(layer->layoutBox()->scrolledContentOffset());
- }
- layer->addBlockSelectionGapsBounds(gapRectsBounds);
- }
-}
-
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/line/RootInlineBox.cpp ('k') | third_party/WebKit/Source/core/paint/BlockPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698