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

Unified Diff: Source/core/paint/SVGInlineTextBoxPainter.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/SVGInlineTextBoxPainter.h ('k') | Source/core/paint/SVGRootInlineBoxPainter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/SVGInlineTextBoxPainter.cpp
diff --git a/Source/core/paint/SVGInlineTextBoxPainter.cpp b/Source/core/paint/SVGInlineTextBoxPainter.cpp
index a9165ca9b4556085601b48569f8bca7b62757b35..98a34802c9b50607fa83f4f6c6f7d28faf286d4e 100644
--- a/Source/core/paint/SVGInlineTextBoxPainter.cpp
+++ b/Source/core/paint/SVGInlineTextBoxPainter.cpp
@@ -31,10 +31,9 @@ static inline bool textShouldBePainted(LayoutSVGInlineText& textLayoutObject)
return textLayoutObject.scaledFont().fontDescription().computedPixelSize();
}
-bool SVGInlineTextBoxPainter::shouldPaintSelection() const
+bool SVGInlineTextBoxPainter::shouldPaintSelection(const PaintInfo& paintInfo) const
{
- bool isPrinting = m_svgInlineTextBox.layoutObject().document().printing();
- return !isPrinting && m_svgInlineTextBox.selectionState() != LayoutObject::SelectionNone;
+ return !paintInfo.isPrinting() && m_svgInlineTextBox.selectionState() != LayoutObject::SelectionNone;
}
void SVGInlineTextBoxPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
@@ -49,7 +48,7 @@ void SVGInlineTextBoxPainter::paint(const PaintInfo& paintInfo, const LayoutPoin
// We're explicitly not supporting composition & custom underlines and custom highlighters -- unlike InlineTextBox.
// If we ever need that for SVG, it's very easy to refactor and reuse the code.
- if (paintInfo.phase == PaintPhaseSelection && !shouldPaintSelection())
+ if (paintInfo.phase == PaintPhaseSelection && !shouldPaintSelection(paintInfo))
return;
LayoutSVGInlineText& textLayoutObject = toLayoutSVGInlineText(m_svgInlineTextBox.layoutObject());
@@ -80,7 +79,7 @@ void SVGInlineTextBoxPainter::paintTextFragments(const PaintInfo& paintInfo, Lay
bool hasVisibleStroke = svgStyle.hasVisibleStroke();
const ComputedStyle* selectionStyle = &style;
- bool shouldPaintSelection = this->shouldPaintSelection();
+ bool shouldPaintSelection = this->shouldPaintSelection(paintInfo);
if (shouldPaintSelection) {
selectionStyle = parentLayoutObject.getCachedPseudoStyle(SELECTION);
if (selectionStyle) {
@@ -149,9 +148,9 @@ void SVGInlineTextBoxPainter::paintSelectionBackground(const PaintInfo& paintInf
if (m_svgInlineTextBox.layoutObject().style()->visibility() != VISIBLE)
return;
- ASSERT(!m_svgInlineTextBox.layoutObject().document().printing());
+ ASSERT(!paintInfo.isPrinting());
- if (paintInfo.phase == PaintPhaseSelection || !shouldPaintSelection())
+ if (paintInfo.phase == PaintPhaseSelection || !shouldPaintSelection(paintInfo))
return;
Color backgroundColor = m_svgInlineTextBox.layoutObject().selectionBackgroundColor();
@@ -308,7 +307,7 @@ void SVGInlineTextBoxPainter::paintTextWithShadows(const PaintInfo& paintInfo, c
GraphicsContext* context = paintInfo.context;
// Text shadows are disabled when printing. http://crbug.com/258321
- bool hasShadow = shadowList && !context->printing();
+ bool hasShadow = shadowList && !paintInfo.isPrinting();
FloatPoint textOrigin(fragment.x, fragment.y);
FloatSize textSize(fragment.width, fragment.height);
« no previous file with comments | « Source/core/paint/SVGInlineTextBoxPainter.h ('k') | Source/core/paint/SVGRootInlineBoxPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698