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

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

Issue 1236183003: Add 'printing' flag to PaintInfo (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: PrintAdaption -> Printing; printing -> isPrinting; Comment fixups. 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/InlineTextBoxPainter.h ('k') | Source/core/paint/LineBoxListPainter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/InlineTextBoxPainter.cpp
diff --git a/Source/core/paint/InlineTextBoxPainter.cpp b/Source/core/paint/InlineTextBoxPainter.cpp
index 065c6120c80a31971a5165fda86bde8d82139305..b3a0668b30b33448373241e4f2569d51e6ba4ec0 100644
--- a/Source/core/paint/InlineTextBoxPainter.cpp
+++ b/Source/core/paint/InlineTextBoxPainter.cpp
@@ -69,7 +69,7 @@ void InlineTextBoxPainter::paint(const PaintInfo& paintInfo, const LayoutPoint&
if (logicalStart >= paintEnd || logicalStart + logicalExtent <= paintStart)
return;
- bool isPrinting = m_inlineTextBox.layoutObject().document().printing();
+ bool isPrinting = paintInfo.isPrinting();
// Determine whether or not we're selected.
bool haveSelection = !isPrinting && paintInfo.phase != PaintPhaseTextClip && m_inlineTextBox.selectionState() != LayoutObject::SelectionNone;
@@ -238,7 +238,7 @@ void InlineTextBoxPainter::paint(const PaintInfo& paintInfo, const LayoutPoint&
TextPainter::updateGraphicsContext(context, textStyle, m_inlineTextBox.isHorizontal(), stateSaver);
if (combinedText)
context->concatCTM(TextPainter::rotation(boxRect, TextPainter::Clockwise));
- paintDecoration(context, boxOrigin, textDecorations);
+ paintDecoration(paintInfo, boxOrigin, textDecorations);
if (combinedText)
context->concatCTM(TextPainter::rotation(boxRect, TextPainter::Counterclockwise));
}
@@ -705,13 +705,14 @@ static void paintAppliedDecoration(GraphicsContext* context, FloatPoint start, f
}
}
-void InlineTextBoxPainter::paintDecoration(GraphicsContext* context, const LayoutPoint& boxOrigin, TextDecoration deco)
+void InlineTextBoxPainter::paintDecoration(const PaintInfo& paintInfo, const LayoutPoint& boxOrigin, TextDecoration deco)
{
- GraphicsContextStateSaver stateSaver(*context);
-
if (m_inlineTextBox.truncation() == cFullTruncation)
return;
+ GraphicsContext* context = paintInfo.context;
+ GraphicsContextStateSaver stateSaver(*context);
+
LayoutPoint localOrigin(boxOrigin);
LayoutUnit width = m_inlineTextBox.logicalWidth();
@@ -728,7 +729,7 @@ void InlineTextBoxPainter::paintDecoration(GraphicsContext* context, const Layou
m_inlineTextBox.layoutObject().getTextDecorations(deco, underline, overline, linethrough, true, true);
// Use a special function for underlines to get the positioning exactly right.
- bool isPrinting = m_inlineTextBox.layoutObject().document().printing();
+ bool isPrinting = paintInfo.isPrinting();
const ComputedStyle& styleToUse = m_inlineTextBox.layoutObject().styleRef(m_inlineTextBox.isFirstLineStyle());
float baseline = styleToUse.fontMetrics().ascent();
« no previous file with comments | « Source/core/paint/InlineTextBoxPainter.h ('k') | Source/core/paint/LineBoxListPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698