Commit 2029f305 authored by jbroman@chromium.org's avatar jbroman@chromium.org

Remove unnecessary updateGraphicsContext calls.

These don't do anything, since all it does is update the fill color, which is
not even used in drawHighlightForText (it takes its own color argument).

After this, nearly all updateGraphicsContext calls correspond to a
paintTextWithShadows call, which opens some refactoring options.

Review URL: https://codereview.chromium.org/477143002

git-svn-id: svn://svn.chromium.org/blink/trunk@180376 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 287b10c8
......@@ -775,8 +775,6 @@ void InlineTextBox::paintSelection(GraphicsContext* context, const FloatPoint& b
if (textColor == c)
c = Color(0xff - c.red(), 0xff - c.green(), 0xff - c.blue());
GraphicsContextStateSaver stateSaver(*context);
updateGraphicsContext(context, c, c, 0); // Don't draw text at all!
// If the text is truncated, let the thing being painted in the truncation
// draw its own highlight.
......@@ -800,8 +798,9 @@ void InlineTextBox::paintSelection(GraphicsContext* context, const FloatPoint& b
FloatPoint localOrigin(boxOrigin.x(), boxOrigin.y() - deltaY);
FloatRect clipRect(localOrigin, FloatSize(m_logicalWidth, selHeight));
context->clip(clipRect);
GraphicsContextStateSaver stateSaver(*context);
context->clip(clipRect);
context->drawHighlightForText(font, textRun, localOrigin, selHeight, c, sPos, ePos);
}
......@@ -825,10 +824,6 @@ void InlineTextBox::paintSingleCompositionBackgroundRun(GraphicsContext* context
if (sPos >= ePos)
return;
GraphicsContextStateSaver stateSaver(*context);
updateGraphicsContext(context, backgroundColor, backgroundColor, 0); // Don't draw text at all!
int deltaY = renderer().style()->isFlippedLinesWritingMode() ? selectionBottom() - logicalBottom() : logicalTop() - selectionTop();
int selHeight = selectionHeight();
FloatPoint localOrigin(boxOrigin.x(), boxOrigin.y() - deltaY);
......@@ -1245,7 +1240,6 @@ void InlineTextBox::paintTextMatchMarker(GraphicsContext* pt, const FloatPoint&
RenderTheme::theme().platformActiveTextSearchHighlightColor() :
RenderTheme::theme().platformInactiveTextSearchHighlightColor();
GraphicsContextStateSaver stateSaver(*pt);
updateGraphicsContext(pt, color, color, 0); // Don't draw text at all!
pt->clip(FloatRect(boxOrigin.x(), boxOrigin.y() - deltaY, m_logicalWidth, selHeight));
pt->drawHighlightForText(font, run, FloatPoint(boxOrigin.x(), boxOrigin.y() - deltaY), selHeight, color, sPos, ePos);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment