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

Unified Diff: Source/core/rendering/InlineTextBox.cpp

Issue 477143002: Remove unnecessary updateGraphicsContext calls. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/InlineTextBox.cpp
diff --git a/Source/core/rendering/InlineTextBox.cpp b/Source/core/rendering/InlineTextBox.cpp
index e1a36d330861201212f24d637545988a23063ba9..5762ce3bd23beaabbc731a1d5c3882d924d9ca70 100644
--- a/Source/core/rendering/InlineTextBox.cpp
+++ b/Source/core/rendering/InlineTextBox.cpp
@@ -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);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698