Extract out combined text query into a member function
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Sep 2017 22:28:43 +0000 (22:28 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Sep 2017 22:28:43 +0000 (22:28 +0000)
commit23ecaf4a6c9a9d5f75cb5d9a2ff79a074e0a8421
tree85511d2ec5977256e7fd39663e772e76bfcfb043
parentffa997d4e3cc381501eeea30098507891ee4fbc6
Extract out combined text query into a member function
https://bugs.webkit.org/show_bug.cgi?id=177493

Reviewed by Zalan Bujtas.

Towards removing duplication throughout the paint code extract the
querying for the combined text of an inline text box into a member
function.

For a similar reason, update functions to query lineStyle() instead
of passing this information an argument.

No functionality changed. So, no new tests.

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint): Extract logic to query for combined text
from here to InlineTextBox::combinedText() and modify code to call this
member function.
(WebCore::InlineTextBox::paintTextSubrangeBackground): Query for line style
instead of taking it as an argument.
(WebCore::InlineTextBox::paintCompositionBackground): Ditto.
(WebCore::InlineTextBox::paintTextMatchMarker): Ditto.
(WebCore::InlineTextBox::paintDecoration): Update code to query combinedText()
instead of taking RenderCombineText as an argument. While I am here make use of
GraphicsContextStateSaver to save and restore the graphics context state when
we have a non-empty clip rect.
(WebCore::InlineTextBox::paintDocumentMarker): Query for line style instead of
taking it as an argument.
(WebCore::InlineTextBox::paintDocumentMarkers): Ditto.
(WebCore::InlineTextBox::combinedText const): Added; extracted from InlineTextBox::paint().
* rendering/InlineTextBox.h:
* rendering/TextPainter.h:
(WebCore::TextPainter::setEmphasisMark): Modified to take a const RenderCombineText*
as opposed to a pointer to a non-const RenderCombineText.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@222528 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/rendering/InlineTextBox.cpp
Source/WebCore/rendering/InlineTextBox.h
Source/WebCore/rendering/TextPainter.h