Draw all underline segments in a particular run in the same call
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Jan 2014 21:56:26 +0000 (21:56 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Jan 2014 21:56:26 +0000 (21:56 +0000)
commitae4e60566c1610a695dbb6cb14b0b48e1a5bdfde
tree1e000746aecb208ac400145282ab4ee402d5072c
parent61fe9afec68ee270eee02c82fbbc412c3c7cedd7
Draw all underline segments in a particular run in the same call
https://bugs.webkit.org/show_bug.cgi?id=127082

Reviewed by Simon Fraser.

Instead of running CGContextFillRect() in a loop, we can instead call CGContextFillRects()

In my tests, this seems to have about 0.5% speedup.

This patch creates some redundant code, but I think that refactoring would make the code
much less readable. I also am hesitant to make drawLineForText call drawLinesForText because
of the overhead of the vector that would be needed.

As there is no behavior change, no new tests are necessary

* platform/graphics/GraphicsContext.h:
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::drawLinesForText):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::platformInit):
* platform/graphics/wince/GraphicsContextWinCE.cpp:
(WebCore::GraphicsContext::drawLinesForText):
* rendering/InlineTextBox.cpp:
(WebCore::drawSkipInkUnderline):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162150 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/GraphicsContext.h
Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp
Source/WebCore/rendering/InlineTextBox.cpp