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

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

Issue 720313002: Push selection gaps logic down to RenderBlockFlow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: move even MOAR! Created 6 years, 1 month 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/BlockFlowPainter.h ('k') | Source/core/paint/BlockPainter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/BlockFlowPainter.cpp
diff --git a/Source/core/paint/BlockFlowPainter.cpp b/Source/core/paint/BlockFlowPainter.cpp
index 1a66ed50f7de6e847477edbffb7c1d4ed1425e0e..5b8d7f3ed6b6ea14050934b25bacd2f9e670eec1 100644
--- a/Source/core/paint/BlockFlowPainter.cpp
+++ b/Source/core/paint/BlockFlowPainter.cpp
@@ -8,6 +8,7 @@
#include "core/rendering/FloatingObjects.h"
#include "core/rendering/PaintInfo.h"
#include "core/rendering/RenderBlockFlow.h"
+#include "core/rendering/RenderLayer.h"
namespace blink {
@@ -44,4 +45,28 @@ void BlockFlowPainter::paintFloats(PaintInfo& paintInfo, const LayoutPoint& pain
}
}
+void BlockFlowPainter::paintSelection(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
+{
+ if (m_renderBlockFlow.shouldPaintSelectionGaps() && paintInfo.phase == PaintPhaseForeground) {
+ LayoutUnit lastTop = 0;
+ LayoutUnit lastLeft = m_renderBlockFlow.logicalLeftSelectionOffset(&m_renderBlockFlow, lastTop);
+ LayoutUnit lastRight = m_renderBlockFlow.logicalRightSelectionOffset(&m_renderBlockFlow, lastTop);
+ GraphicsContextStateSaver stateSaver(*paintInfo.context);
+
+ LayoutRect gapRectsBounds = m_renderBlockFlow.selectionGaps(&m_renderBlockFlow, paintOffset, LayoutSize(), lastTop, lastLeft, lastRight, &paintInfo);
+ if (!gapRectsBounds.isEmpty()) {
+ RenderLayer* layer = m_renderBlockFlow.enclosingLayer();
+ gapRectsBounds.moveBy(-paintOffset);
+ if (!m_renderBlockFlow.hasLayer()) {
+ LayoutRect localBounds(gapRectsBounds);
+ m_renderBlockFlow.flipForWritingMode(localBounds);
+ gapRectsBounds = m_renderBlockFlow.localToContainerQuad(FloatRect(localBounds), layer->renderer()).enclosingBoundingBox();
+ if (layer->renderer()->hasOverflowClip())
+ gapRectsBounds.move(layer->renderBox()->scrolledContentOffset());
+ }
+ layer->addBlockSelectionGapsBounds(gapRectsBounds);
+ }
+ }
+}
+
} // namespace blink
« no previous file with comments | « Source/core/paint/BlockFlowPainter.h ('k') | Source/core/paint/BlockPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698