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

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

Issue 645363003: Consolidate most simple vs. complex Font methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: minor cleanup Created 6 years, 2 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 | « Source/core/rendering/TextPainter.h ('k') | Source/platform/fonts/Font.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/TextPainter.cpp
diff --git a/Source/core/rendering/TextPainter.cpp b/Source/core/rendering/TextPainter.cpp
index 142fead0626c52667020b12314df6c97b760e786..b2c2ac7e0ca425744c5d47d9de0a6ace55d90947 100644
--- a/Source/core/rendering/TextPainter.cpp
+++ b/Source/core/rendering/TextPainter.cpp
@@ -172,39 +172,29 @@ TextPainter::Style TextPainter::selectionPaintingStyle(RenderObject& renderer, b
}
template <TextPainter::PaintInternalStep step>
-void TextPainter::paintInternalRun(TextRunPaintInfo& textRunPaintInfo, int from, int to, TextBlobPtr* cachedTextBlob)
+void TextPainter::paintInternalRun(TextRunPaintInfo& textRunPaintInfo, int from, int to)
{
textRunPaintInfo.from = from;
textRunPaintInfo.to = to;
if (step == PaintEmphasisMark) {
- m_graphicsContext->drawEmphasisMarks(m_font, textRunPaintInfo, m_emphasisMark, m_textOrigin + IntSize(0, m_emphasisMarkOffset));
- return;
- }
-
- ASSERT(step == PaintText);
-
- TextBlobPtr localTextBlob;
- TextBlobPtr& textBlob = cachedTextBlob ? *cachedTextBlob : localTextBlob;
- bool canUseTextBlobs = RuntimeEnabledFeatures::textBlobEnabled();
-
- if (canUseTextBlobs && !textBlob)
- textBlob = m_font.buildTextBlob(textRunPaintInfo, m_textOrigin, m_graphicsContext->couldUseLCDRenderedText());
-
- if (canUseTextBlobs && textBlob)
- m_font.drawTextBlob(m_graphicsContext, textBlob.get(), m_textOrigin.data());
- else
+ m_graphicsContext->drawEmphasisMarks(m_font, textRunPaintInfo, m_emphasisMark,
+ m_textOrigin + IntSize(0, m_emphasisMarkOffset));
+ } else {
+ ASSERT(step == PaintText);
m_graphicsContext->drawText(m_font, textRunPaintInfo, m_textOrigin);
+ }
}
template <TextPainter::PaintInternalStep Step>
void TextPainter::paintInternal(int startOffset, int endOffset, int truncationPoint, TextBlobPtr* cachedTextBlob)
{
- // FIXME: We should be able to use cachedTextBlob in more cases.
TextRunPaintInfo textRunPaintInfo(m_run);
textRunPaintInfo.bounds = m_textBounds;
if (startOffset <= endOffset) {
- paintInternalRun<Step>(textRunPaintInfo, startOffset, endOffset, cachedTextBlob);
+ // FIXME: We should be able to use cachedTextBlob in more cases.
+ textRunPaintInfo.cachedTextBlob = cachedTextBlob;
+ paintInternalRun<Step>(textRunPaintInfo, startOffset, endOffset);
} else {
if (endOffset > 0)
paintInternalRun<Step>(textRunPaintInfo, 0, endOffset);
« no previous file with comments | « Source/core/rendering/TextPainter.h ('k') | Source/platform/fonts/Font.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698