Refactor away SVGTextMetricsBuilder::advance
This method has two logical parts: Advancing the text position and checking for termination, and computing the metrics for the current character. Split this method to better show this. The latter part is put into a new method, computeMetricsForCurrentCharacter, while the former part is open-coded in SVGTextMetricsBuilder::measureTextRenderer. The advance{Simple,Complex}Text methods are renamed to computeMetricsForCurrentCharacter{Simple,Complex}. With this change, it becomes easier to see that SVGTextMetricsBuilder::m_currentMetrics can be trivially removed in favor of returning it from computeMetricsForCurrentCharacter, and storing it on the stack in SVGTextMetricsBuilder::measureTextRenderer. The same is true for SVGTextMetricsBuilder::m_complexStartToCurrentMetrics, which can be made local to computeMetricsForCurrentCharacterComplex. Review URL: https://codereview.chromium.org/184103024 git-svn-id: svn://svn.chromium.org/blink/trunk@168461 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Showing
Please register or sign in to comment