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

Side by Side Diff: third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp

Issue 1610233002: [Reland] Remove PaintInfo's paintingRoot (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/InlineTextBoxPainter.h" 5 #include "core/paint/InlineTextBoxPainter.h"
6 6
7 #include "core/editing/CompositionUnderline.h" 7 #include "core/editing/CompositionUnderline.h"
8 #include "core/editing/Editor.h" 8 #include "core/editing/Editor.h"
9 #include "core/editing/markers/DocumentMarkerController.h" 9 #include "core/editing/markers/DocumentMarkerController.h"
10 #include "core/editing/markers/RenderedDocumentMarker.h" 10 #include "core/editing/markers/RenderedDocumentMarker.h"
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 // When painting selection, we want to include a highlight when the 253 // When painting selection, we want to include a highlight when the
254 // selection spans line breaks. In other cases such as invisible elements 254 // selection spans line breaks. In other cases such as invisible elements
255 // or those with no text that are not line breaks, we can skip painting 255 // or those with no text that are not line breaks, we can skip painting
256 // wholesale. 256 // wholesale.
257 // TODO(wkorman): Constrain line break painting to appropriate paint phase. 257 // TODO(wkorman): Constrain line break painting to appropriate paint phase.
258 // This code path is only called in PaintPhaseForeground whereas we would 258 // This code path is only called in PaintPhaseForeground whereas we would
259 // expect PaintPhaseSelection. The existing haveSelection logic in paint() 259 // expect PaintPhaseSelection. The existing haveSelection logic in paint()
260 // tests for != PaintPhaseTextClip. 260 // tests for != PaintPhaseTextClip.
261 bool paintLineBreaks = RuntimeEnabledFeatures::selectionPaintingWithoutSelec tionGapsEnabled(); 261 bool paintLineBreaks = RuntimeEnabledFeatures::selectionPaintingWithoutSelec tionGapsEnabled();
262 if ((!paintLineBreaks && m_inlineTextBox.isLineBreak()) 262 if ((!paintLineBreaks && m_inlineTextBox.isLineBreak())
263 || !paintInfo.shouldPaintWithinRoot(LineLayoutPaintShim::layoutObjectFro m(m_inlineTextBox.lineLayoutItem()))
264 || m_inlineTextBox.lineLayoutItem().style()->visibility() != VISIBLE 263 || m_inlineTextBox.lineLayoutItem().style()->visibility() != VISIBLE
265 || m_inlineTextBox.truncation() == cFullTruncation 264 || m_inlineTextBox.truncation() == cFullTruncation
266 || !m_inlineTextBox.len()) 265 || !m_inlineTextBox.len())
267 return false; 266 return false;
268 return true; 267 return true;
269 } 268 }
270 269
271 unsigned InlineTextBoxPainter::underlinePaintStart(const CompositionUnderline& u nderline) 270 unsigned InlineTextBoxPainter::underlinePaintStart(const CompositionUnderline& u nderline)
272 { 271 {
273 return std::max(static_cast<unsigned>(m_inlineTextBox.start()), underline.st artOffset); 272 return std::max(static_cast<unsigned>(m_inlineTextBox.start()), underline.st artOffset);
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 869
871 Color color = LayoutTheme::theme().platformTextSearchHighlightColor(marker-> activeMatch()); 870 Color color = LayoutTheme::theme().platformTextSearchHighlightColor(marker-> activeMatch());
872 GraphicsContext& context = paintInfo.context; 871 GraphicsContext& context = paintInfo.context;
873 GraphicsContextStateSaver stateSaver(context); 872 GraphicsContextStateSaver stateSaver(context);
874 context.clip(FloatRect(boxOrigin.x().toFloat(), (boxOrigin.y() - deltaY).toF loat(), m_inlineTextBox.logicalWidth().toFloat(), selHeight)); 873 context.clip(FloatRect(boxOrigin.x().toFloat(), (boxOrigin.y() - deltaY).toF loat(), m_inlineTextBox.logicalWidth().toFloat(), selHeight));
875 context.drawHighlightForText(font, run, FloatPoint(boxOrigin.x().toFloat(), (boxOrigin.y() - deltaY).toFloat()), selHeight, color, sPos, ePos); 874 context.drawHighlightForText(font, run, FloatPoint(boxOrigin.x().toFloat(), (boxOrigin.y() - deltaY).toFloat()), selHeight, color, sPos, ePos);
876 } 875 }
877 876
878 877
879 } // namespace blink 878 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/InlineFlowBoxPainter.cpp ('k') | third_party/WebKit/Source/core/paint/PaintInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698